GrafX2 2.9.3227
The ultimate 256-color painting program
|
Interchange File Format (Electronic Arts) More...
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... | |
Interchange File Format (Electronic Arts)
This is the "native" format of Amiga. We support ILBM/PBM/ACBM
void Test_IFF | ( | FILE * | IFF_file, |
const char * | sub_type | ||
) |
Test if a file is in IFF format.
References File_error, format, Read_bytes(), and Read_dword_be().
Referenced by Test_ACBM(), Test_LBM(), and Test_PBM().
void Test_PBM | ( | T_IO_Context * | context, |
FILE * | f | ||
) |
References Test_IFF().
void Test_LBM | ( | T_IO_Context * | context, |
FILE * | f | ||
) |
References Test_IFF().
void Test_ACBM | ( | T_IO_Context * | context, |
FILE * | f | ||
) |
References Test_IFF().
|
static |
Skips the current section in an IFF file.
This function should be called while the file pointer is right after the 4-character code that identifies the section.
References Read_dword_be().
Referenced by IFF_Wait_for().
|
static |
Wait for a specific IFF chunk.
References IFF_Skip_section(), and Read_bytes().
Referenced by LBM_Decode().
|
static |
Decodes the color of one pixel from the ILBM line buffer.
Planar to chunky conversion
buffer | Planar buffer |
x_pos | Position of the pixel in graphic line |
real_line_size | Width of one bitplane in memory, in bytes |
bitplanes | Number of bitplanes |
Referenced by Draw_IFF_line(), Draw_IFF_line_HAM(), and Draw_IFF_line_PCHG().
|
static |
chunky to planar
Referenced by Load_IFF(), and Save_IFF().
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.
context | the IO context |
buffer | Planar buffer |
y_pos | Current line |
real_line_size | Width of one bitplane in memory, in bytes |
bitplanes | Number of bitplanes |
References Get_IFF_color(), Set_pixel(), Set_pixel_24b(), and T_IO_Context::Width.
Referenced by LBM_Decode(), Load_IFF(), Load_INFO(), Load_PCX(), and Load_SCx().
|
static |
decode pixels with palette changes per line (copper list:)
References T_Components::B, T_Components::G, Get_IFF_color(), T_IFF_PCHG_Palette::Next, NULL, T_IFF_PCHG_Palette::Palette, T_Components::R, Set_pixel_24b(), T_IFF_PCHG_Palette::StartLine, and T_IO_Context::Width.
Referenced by LBM_Decode().
|
static |
Decode a HAM line to 24bits pixels.
References T_Components::B, T_Components::G, Get_IFF_color(), T_IFF_PCHG_Palette::Next, NULL, T_IFF_PCHG_Palette::Palette, T_IO_Context::Palette, T_Components::R, Set_pixel_24b(), T_IFF_PCHG_Palette::StartLine, and T_IO_Context::Width.
Referenced by LBM_Decode(), and Load_IFF().
|
static |
Decode PBM data.
Supports compressions :
References File_error, GFX2_ERROR, GFX2_Log(), Read_byte(), Read_bytes(), and Set_pixel().
Referenced by Load_IFF().
|
static |
Decode LBM data.
Supports packings :
References Draw_IFF_line(), Draw_IFF_line_HAM(), Draw_IFF_line_PCHG(), File_error, GFX2_Log(), GFX2_malloc, GFX2_WARNING, T_IO_Context::Height, IFF_Wait_for(), NULL, Read_byte(), Read_bytes(), Read_dword_be(), Read_word_be(), and T_IO_Context::Width.
Referenced by Load_IFF().
|
static |
Decode RAST chunk (from Atari ST pictures)
References T_Components::B, File_error, T_Components::G, T_IFF_PCHG_Palette::Next, NULL, T_IFF_PCHG_Palette::Palette, T_IO_Context::Palette, T_Components::R, Read_word_be(), and T_IFF_PCHG_Palette::StartLine.
Referenced by Load_IFF().
|
static |
Sets 32 upper colors of EHB palette.
32 colors in the palette.
The next 32 colors are the same with values divided by 2
References T_Components::B, T_Components::G, and T_Components::R.
Referenced by Load_IFF().
void Load_IFF | ( | T_IO_Context * | context | ) |
Load IFF picture (PBM/ILBM/ACBM) or animation.
References T_IFF_AnimHeader::abstime, T_Components::B, T_IO_Context::Background_transparent, T_IFF_Header::BitPlanes, T_IFF_AnimHeader::bits, T_Config::Clear_palette, T_IO_Context::Color_cycles, COLOR_CYCLING_SPEED_MAX, T_IO_Context::Comment, COMMENT_SIZE, T_IFF_Header::Compression, Config, CONTEXT_PALETTE, CONTEXT_PREVIEW, CONTEXT_PREVIEW_PALETTE, T_IO_Context::Cycle_range, Draw_IFF_line(), Draw_IFF_line_HAM(), T_Color_cycle::End, File_error, File_length_file(), flags, format, FORMAT_ACBM, FORMAT_LBM, FORMAT_PBM, T_Components::G, GFX2_DEBUG, GFX2_ERROR, GFX2_INFO, GFX2_Log(), GFX2_LogHexDump(), GFX2_malloc, GFX2_WARNING, T_IFF_AnimHeader::h, T_IFF_Header::Height, T_IO_Context::Height, IFF_Set_EHB_Palette(), IMAGE_MODE_ANIMATION, T_IFF_AnimHeader::interleave, T_Color_cycle::Inverse, LBM_Decode(), T_IFF_Header::Mask, T_IFF_AnimHeader::mask, T_IFF_PCHG_Palette::Next, NULL, Open_file_read(), T_IFF_AnimHeader::operation, T_IO_Context::Original_height, Original_screen_X, Original_screen_Y, T_IO_Context::Original_width, T_IFF_AnimHeader::pad0, T_IFF_Header::Pad1, T_IFF_PCHG_Palette::Palette, T_IO_Context::Palette, PBM_Decode(), T_IO_Context::Pitch, PIXEL_SIMPLE, PIXEL_TALL, PIXEL_TALL3, PIXEL_WIDE, Pre_load(), T_Components::R, RAST_chunk_decode(), Read_byte(), Read_bytes(), Read_dword_be(), Read_word_be(), T_IFF_AnimHeader::reltime, Set_frame_duration(), Set_IFF_color(), Set_image_mode(), Set_loading_layer(), T_Color_cycle::Speed, T_Color_cycle::Start, T_IFF_PCHG_Palette::StartLine, SWAP_BYTES, T_IO_Context::Target_address, T_IFF_Header::Transp_col, T_IO_Context::Transparent_color, T_IO_Context::Type, T_IFF_AnimHeader::w, T_IFF_Header::Width, T_IO_Context::Width, T_IFF_AnimHeader::x, T_IFF_Header::X_aspect, T_IFF_Header::X_org, T_IFF_Header::X_screen, T_IFF_AnimHeader::y, T_IFF_Header::Y_aspect, T_IFF_Header::Y_org, and T_IFF_Header::Y_screen.
void Save_IFF | ( | T_IO_Context * | context | ) |
Save IFF file (LBM or PBM)
References T_IO_Context::Background_transparent, T_IFF_Header::BitPlanes, T_IO_Context::Color_cycles, T_IO_Context::Comment, T_IFF_Header::Compression, T_IO_Context::Cycle_range, T_Color_cycle::End, File_error, flags, T_IO_Context::Format, FORMAT_LBM, Get_pixel(), GFX2_DEBUG, GFX2_Log(), T_IFF_Header::Height, T_IO_Context::Height, T_Color_cycle::Inverse, T_IFF_Header::Mask, NULL, Open_file_write(), PackBits_pack_add(), PackBits_pack_flush(), PackBits_pack_init(), T_IFF_Header::Pad1, T_IO_Context::Palette, PIXEL_DOUBLE, PIXEL_QUAD, PIXEL_SIMPLE, PIXEL_TALL, PIXEL_TALL2, PIXEL_TALL3, PIXEL_TRIPLE, PIXEL_WIDE, PIXEL_WIDE2, T_IO_Context::Ratio, Remove_file(), Set_IFF_color(), T_Color_cycle::Speed, T_Color_cycle::Start, T_IFF_Header::Transp_col, T_IO_Context::Transparent_color, T_IFF_Header::Width, T_IO_Context::Width, Write_byte(), Write_bytes(), Write_dword_be(), Write_word_be(), T_IFF_Header::X_aspect, T_IFF_Header::X_org, T_IFF_Header::X_screen, T_IFF_Header::Y_aspect, T_IFF_Header::Y_org, and T_IFF_Header::Y_screen.