GrafX2 2.9.3227
The ultimate 256-color painting program
ifformat.c File Reference

Saving and loading IFF picture formats. More...

#include <stdlib.h>
#include <string.h>
#include "fileformats.h"
#include "loadsavefuncs.h"
#include "io.h"
#include "misc.h"
#include "packbits.h"
#include "gfx2mem.h"
#include "gfx2log.h"
#include <endian.h>
+ Include dependency graph for ifformat.c:

Data Structures

struct  T_IFF_Header
 
struct  T_IFF_AnimHeader
 
struct  T_IFF_PCHG_Palette
 

Functions

void Test_IFF (FILE *IFF_file, const char *sub_type)
 Test if a file is in IFF format. More...
 
void Test_PBM (T_IO_Context *context, FILE *f)
 
void Test_LBM (T_IO_Context *context, FILE *f)
 
void Test_ACBM (T_IO_Context *context, FILE *f)
 
static int IFF_Skip_section (FILE *file)
 Skips the current section in an IFF file. More...
 
static byte IFF_Wait_for (FILE *file, const char *expected_section)
 Wait for a specific IFF chunk. More...
 
static dword Get_IFF_color (const byte *buffer, word x_pos, word real_line_size, byte bitplanes)
 Decodes the color of one pixel from the ILBM line buffer. More...
 
static void Set_IFF_color (byte *buffer, word x_pos, byte color, word real_line_size, byte bitplanes)
 chunky to planar More...
 
void Draw_IFF_line (T_IO_Context *context, const byte *buffer, short y_pos, short real_line_size, byte bitplanes)
 Planar to chunky conversion of a line. More...
 
static void Draw_IFF_line_PCHG (T_IO_Context *context, const byte *buffer, short y_pos, short real_line_size, byte bitplanes, const T_IFF_PCHG_Palette *PCHG_palettes)
 decode pixels with palette changes per line (copper list:) More...
 
static void Draw_IFF_line_HAM (T_IO_Context *context, const byte *buffer, short y_pos, short real_line_size, byte bitplanes, const T_IFF_PCHG_Palette *PCHG_palettes)
 Decode a HAM line to 24bits pixels. More...
 
static void PBM_Decode (T_IO_Context *context, FILE *file, byte compression, word width, word height)
 Decode PBM data. More...
 
static void LBM_Decode (T_IO_Context *context, FILE *file, byte compression, byte Image_HAM, byte stored_bit_planes, byte real_bit_planes, const T_IFF_PCHG_Palette *PCHG_palettes)
 Decode LBM data. More...
 
static void RAST_chunk_decode (T_IO_Context *context, FILE *file, dword section_size, T_IFF_PCHG_Palette **PCHG_palettes)
 Decode RAST chunk (from Atari ST pictures) More...
 
static void IFF_Set_EHB_Palette (T_Components *palette)
 Sets 32 upper colors of EHB palette. More...
 
void Load_IFF (T_IO_Context *context)
 Load IFF picture (PBM/ILBM/ACBM) or animation. More...
 
void Save_IFF (T_IO_Context *context)
 Save IFF file (LBM or PBM) More...
 

Detailed Description

Saving and loading IFF picture formats.