GrafX2 2.9.3227
The ultimate 256-color painting program
|
The Test, Load and Save function for each supported file formats are referenced in File_formats. More...
Modules | |
Amstrad CPC/CPC+ picture formats | |
Support for Amstrad CPC/CPC+ picture formats. | |
Bitmap and icon files | |
.BMP/.ICO/.CUR files from OS/2 or Windows | |
SCx format | |
ColoRix VGA Paint SCx File Format. | |
GIF format | |
Graphics Interchange Format. | |
Interchange File Format | |
Interchange File Format (Electronic Arts) | |
MSX picture formats | |
MODE2 : 256x192 Support for the MSX pictures. | |
PNG format | |
Portable Network Graphics. | |
Atari ST picture formats | |
Support for Atari ST picture formats. | |
TIFF | |
Tagged Image File Format. | |
Functions | |
void | Test_PKM (T_IO_Context *, FILE *) |
void | Load_PKM (T_IO_Context *) |
void | Save_PKM (T_IO_Context *) |
void | Test_LBM (T_IO_Context *, FILE *) |
void | Test_PBM (T_IO_Context *, FILE *) |
void | Test_ACBM (T_IO_Context *, FILE *) |
void | Load_IFF (T_IO_Context *) |
Load IFF picture (PBM/ILBM/ACBM) or animation. More... | |
void | Save_IFF (T_IO_Context *) |
Save IFF file (LBM or PBM) More... | |
void | Test_GIF (T_IO_Context *, FILE *) |
Test if a file is GIF format. More... | |
void | Load_GIF (T_IO_Context *) |
Load GIF file. More... | |
void | Save_GIF (T_IO_Context *) |
Save a GIF file. More... | |
void | Test_PCX (T_IO_Context *, FILE *) |
void | Load_PCX (T_IO_Context *) |
void | Save_PCX (T_IO_Context *) |
void | Test_BMP (T_IO_Context *, FILE *) |
Test for BMP format. More... | |
void | Load_BMP (T_IO_Context *) |
Load BMP file. More... | |
void | Save_BMP (T_IO_Context *) |
Save BMP file. More... | |
void | Test_IMG (T_IO_Context *, FILE *) |
void | Load_IMG (T_IO_Context *) |
void | Save_IMG (T_IO_Context *) |
void | Test_SCx (T_IO_Context *, FILE *) |
Test if a file is SCx format. More... | |
void | Load_SCx (T_IO_Context *) |
Read a SCx file. More... | |
void | Save_SCx (T_IO_Context *) |
Save a SCx file. More... | |
void | Test_CEL (T_IO_Context *, FILE *) |
void | Load_CEL (T_IO_Context *) |
void | Save_CEL (T_IO_Context *) |
void | Test_KCF (T_IO_Context *, FILE *) |
void | Load_KCF (T_IO_Context *) |
void | Save_KCF (T_IO_Context *) |
void | Test_PAL (T_IO_Context *, FILE *) |
void | Load_PAL (T_IO_Context *) |
void | Save_PAL (T_IO_Context *) |
void | Test_GPL (T_IO_Context *, FILE *) |
Test for GPL (Gimp Palette) file format. More... | |
void | Load_GPL (T_IO_Context *) |
Load GPL (Gimp Palette) file format. More... | |
void | Save_GPL (T_IO_Context *) |
Save GPL (Gimp Palette) file format. More... | |
void | Test_PI1 (T_IO_Context *, FILE *) |
Test for Degas file format. More... | |
void | Load_PI1 (T_IO_Context *) |
Load Degas file format. More... | |
void | Save_PI1 (T_IO_Context *) |
Save a PI1 Degas uncompressed picture. More... | |
void | Test_PC1 (T_IO_Context *, FILE *) |
Test for Degas Elite Compressed format. More... | |
void | Load_PC1 (T_IO_Context *) |
Load Degas Elite compressed files. More... | |
void | Save_PC1 (T_IO_Context *) |
Save a Degas Elite compressed picture. More... | |
void | Test_CA1 (T_IO_Context *, FILE *) |
test for CrackArt format. More... | |
void | Load_CA1 (T_IO_Context *) |
void | Save_CA1 (T_IO_Context *) |
Save a 320x200 16c picture in CrackArt format. More... | |
void | Test_TNY (T_IO_Context *, FILE *) |
void | Load_TNY (T_IO_Context *) |
void | Save_TNY (T_IO_Context *) |
Save in Tiny compressed format. More... | |
void | Test_NEO (T_IO_Context *, FILE *) |
NeoChrome Format : More... | |
void | Load_NEO (T_IO_Context *) |
Load Neochrome file format. More... | |
void | Save_NEO (T_IO_Context *) |
Save in NeoChrome format. More... | |
void | Test_C64 (T_IO_Context *, FILE *) |
Test for a C64 picture file. More... | |
void | Load_C64 (T_IO_Context *) |
Load C64 pictures formats. More... | |
void | Save_C64 (T_IO_Context *) |
Save C64 picture. More... | |
void | Test_PRG (T_IO_Context *, FILE *) |
Test for a C64 auto-load machine language program which could be a picture. More... | |
void | Load_PRG (T_IO_Context *) |
Load C64 autoload pictures. More... | |
void | Save_PRG (T_IO_Context *) |
Save autoloading C64 picture. More... | |
void | Test_GPX (T_IO_Context *, FILE *) |
void | Load_GPX (T_IO_Context *) |
void | Test_SCR (T_IO_Context *, FILE *) |
Test for SCR file (Amstrad CPC) More... | |
void | Load_SCR (T_IO_Context *) |
Load Advanced OCP Art Studio files (Amstrad CPC) More... | |
void | Save_SCR (T_IO_Context *) |
Save Amstrad SCR file. More... | |
void | Test_CM5 (T_IO_Context *, FILE *) |
Test for CM5 - Amstrad CPC "Mode 5" picture. More... | |
void | Load_CM5 (T_IO_Context *) |
Load Amstrad CPC "Mode 5" picture. More... | |
void | Save_CM5 (T_IO_Context *) |
Save a CPC Mode 5 picture. More... | |
void | Test_PPH (T_IO_Context *, FILE *) |
Amstrad CPC 'PPH' for Perfect Pix. More... | |
void | Load_PPH (T_IO_Context *) |
void | Save_PPH (T_IO_Context *) |
Not yet implemented. More... | |
void | Test_GOS (T_IO_Context *, FILE *) |
Test for GO1/GO2/KIT - Amstrad Plus Graphos. More... | |
void | Load_GOS (T_IO_Context *) |
Load GO1/GO2/KIT - Amstrad CPC Plus Graphos. More... | |
void | Save_GOS (T_IO_Context *) |
void | Test_SGX (T_IO_Context *, FILE *) |
Test for SGX file (SymbOS) More... | |
void | Load_SGX (T_IO_Context *) |
void | Save_SGX (T_IO_Context *) |
void | Save_XPM (T_IO_Context *) |
void | Test_ICO (T_IO_Context *, FILE *) |
void | Load_ICO (T_IO_Context *) |
void | Save_ICO (T_IO_Context *) |
void | Test_PNG (T_IO_Context *, FILE *) |
Test for PNG format. More... | |
void | Load_PNG (T_IO_Context *) |
Read PNG format files. More... | |
void | Save_PNG (T_IO_Context *) |
Save a PNG file. More... | |
void | Load_PNG_Sub (T_IO_Context *context, FILE *file, const char *memory_buffer, unsigned long memory_buffer_size) |
Read PNG format file. More... | |
void | Save_PNG_Sub (T_IO_Context *context, FILE *file, char **buffer, unsigned long *buffer_size) |
Save a PNG to file or memory. More... | |
void | Test_INFO (T_IO_Context *, FILE *) |
void | Load_INFO (T_IO_Context *) |
void | Test_FLI (T_IO_Context *, FILE *) |
Test for the Autodesk Animator FLI/FLC format. More... | |
void | Load_FLI (T_IO_Context *) |
Load file in the Autodesk Animator FLI/FLC format. More... | |
void | Test_MOTO (T_IO_Context *, FILE *) |
Test for Thomson file. More... | |
void | Load_MOTO (T_IO_Context *) |
Load a picture for Thomson TO8/TO8D/TO9/TO9+/MO6. More... | |
void | Save_MOTO (T_IO_Context *) |
Save a picture in MAP or BIN Thomson MO/TO file format. More... | |
void | Test_HGR (T_IO_Context *, FILE *) |
Test for an Apple II HGR or DHGR raw file. More... | |
void | Load_HGR (T_IO_Context *) |
Load HGR (280x192) or DHGR (560x192) Apple II pictures. More... | |
void | Save_HGR (T_IO_Context *) |
Save HGR (280x192) or DHGR (560x192) Apple II pictures. More... | |
void | Test_TIFF (T_IO_Context *, FILE *) |
test for a valid TIFF More... | |
void | Load_TIFF (T_IO_Context *) |
Load TIFF from file. More... | |
void | Save_TIFF (T_IO_Context *) |
Save TIFF. More... | |
void | Load_TIFF_from_memory (T_IO_Context *, const void *, unsigned long) |
Load TIFF from memory. More... | |
void | Save_TIFF_to_memory (T_IO_Context *, void **, unsigned long *) |
Save TIFF to memory. More... | |
void | Test_GRB (T_IO_Context *, FILE *) |
Test for a HP-48 Grob file. More... | |
void | Load_GRB (T_IO_Context *) |
void | Test_MSX (T_IO_Context *, FILE *) |
void | Load_MSX (T_IO_Context *) |
Load a MSX Screen 2 picture. More... | |
void | Save_MSX (T_IO_Context *) |
Save MSX .SC2 file. More... | |
void | Test_2GS (T_IO_Context *, FILE *) |
Test for an Apple 2 GS picture file. More... | |
void | Load_2GS (T_IO_Context *) |
void | Save_2GS (T_IO_Context *) |
The Test, Load and Save function for each supported file formats are referenced in File_formats.
void Test_PKM | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
void Load_PKM | ( | T_IO_Context * | context | ) |
References Back_color, T_IO_Context::Comment, COMMENT_SIZE, File_error, File_length_file(), FORMAT_PKM, GFX2_DEBUG, GFX2_Log(), T_IO_Context::Height, T_PKM_Header::Height, T_PKM_Header::Ident, T_PKM_Header::Jump, T_PKM_Header::Method, Open_file_read(), Original_screen_X, Original_screen_Y, T_IO_Context::Palette, T_PKM_Header::Palette, Palette_64_to_256(), PIXEL_SIMPLE, Pre_load(), Read_byte(), Read_bytes(), Read_word_be(), Read_word_le(), T_PKM_Header::Recog1, T_PKM_Header::Recog2, Set_pixel(), T_IO_Context::Width, and T_PKM_Header::Width.
Referenced by Test_Save().
void Save_PKM | ( | T_IO_Context * | context | ) |
References Back_color, T_IO_Context::Comment, File_error, Find_recog(), Get_pixel(), T_IO_Context::Height, T_PKM_Header::Height, T_PKM_Header::Ident, T_PKM_Header::Jump, T_PKM_Header::Method, NULL, Open_file_write(), T_IO_Context::Palette, T_PKM_Header::Palette, Palette_256_to_64(), T_PKM_Header::Recog1, T_PKM_Header::Recog2, Remove_file(), Screen_height, Screen_width, T_IO_Context::Width, T_PKM_Header::Width, Write_byte(), Write_bytes(), Write_one_byte, and Write_word_le().
void Test_LBM | ( | T_IO_Context * | context, |
FILE * | f | ||
) |
References Test_IFF().
void Test_PBM | ( | T_IO_Context * | context, |
FILE * | f | ||
) |
References Test_IFF().
void Test_ACBM | ( | T_IO_Context * | context, |
FILE * | f | ||
) |
References Test_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.
void Test_GIF | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test if a file is GIF format.
checks if the signature (6 first bytes) is either GIF87a or GIF89a
References File_error, and Read_bytes().
void Load_GIF | ( | T_IO_Context * | context | ) |
Load GIF file.
References T_GIF_LSDB::Aspect, T_GIF_LSDB::Backcol, T_IO_Context::Background_transparent, T_Document::backups, T_Config::Clear_palette, T_IO_Context::Color_cycles, T_IO_Context::Comment, COMMENT_SIZE, Config, Constraint_mode_from_label(), CONTEXT_BRUSH, CONTEXT_MAIN_IMAGE, CONTEXT_PREVIEW, T_GIF_context::current_code, T_Document::current_layer, T_IO_Context::Cycle_range, T_GIF_GCE::Delay_time, DISPOSAL_METHOD_RESTORE_BGCOLOR, T_Color_cycle::End, File_error, File_length_file(), Fill_canvas(), flags, FORMAT_GIF, GFX2_DEBUG, GFX2_ERROR, GFX2_INFO, GFX2_Log(), GFX2_malloc, GIF_get_next_code(), GIF_new_pixel(), T_GIF_LSDB::Height, T_Page::Height, T_Page::Image, T_GIF_IDB::Image_height, T_Page::Image_mode, IMAGE_MODE_ANIMATION, T_GIF_IDB::Image_width, T_GIF_IDB::Indicator, T_GIF_context::interlaced, T_Color_cycle::Inverse, label, T_GIF_context::last_byte, Main, MAX, MIN, T_GIF_context::nb_bits, NULL, Open_file_read(), T_IO_Context::Original_file_directory, T_IO_Context::Original_file_name, Original_screen_X, Original_screen_Y, T_GIF_GCE::Packed_fields, T_List_of_pages::Pages, T_IO_Context::Palette, T_GIF_context::pass, PIXEL_SIMPLE, PIXEL_TALL, PIXEL_TALL3, PIXEL_WIDE, T_Image::Pixels, T_GIF_IDB::Pos_X, T_GIF_context::pos_X, T_GIF_IDB::Pos_Y, T_GIF_context::pos_Y, Pre_load(), Read_byte(), Read_bytes(), Read_word_be(), Read_word_le(), T_GIF_context::remainder_bits, T_GIF_context::remainder_byte, T_GIF_LSDB::Resol, Set_frame_duration(), Set_image_mode(), Set_loading_layer(), T_Color_cycle::Speed, T_Color_cycle::Start, T_GIF_context::stop, T_GIF_GCE::Transparent_color, T_IO_Context::Transparent_color, T_IO_Context::Type, T_GIF_LSDB::Width, and T_Page::Width.
Referenced by Test_Save().
void Save_GIF | ( | T_IO_Context * | context | ) |
Save a GIF file.
0x21 Extension Label 0xFF Application Extension Label 0x0B Block Size "NETSCAPE" Application Identifier (8 bytes) "2.0" Application Authentication Code (3 bytes) 0x03 Sub-block Data Size 0xLL 01 to loop 0xSSSS (little endian) number of loops, 0 means infinite loop 0x00 Block terminatorsee http://www.vurdalakov.net/misc/gif/netscape-looping-application-extension
0x21 Extension Label 0xFF Application Extension Label 0x0B Block Size "GFX2MODE" Application Identifier (8 bytes) "2.6" Application Authentication Code (3 bytes) 0xll Sub-block Data Size string label 0x00 Block terminator
0x21 Extension Label 0xFF Application Extension Label 0x0B Block Size "CRNG\0\0\0\0" "CRNG" Application Identifier (8 bytes) "1.0" Application Authentication Code (3 bytes) 0xll Sub-block Data Size (6 bytes per color cycle) For each color cycle : 0xRRRR (big endian) Rate 0xFFFF (big endian) Flags 0xSS start (lower color index) 0xEE end (higher color index) 0x00 Block terminator
0x21 Extension Label 0xFF Application Extension Label 0x0B Block Size "GFX2PATH" "GFX2PATH" Application Identifier (8 bytes) "\0\0\0" Application Authentication Code (3 bytes) 0xll Sub-block Data Size : path size (including null) "..path.." path (null-terminated) 0xll Sub-block Data Size : filename size (including null) "..file.." file name (null-terminated) 0x00 Block terminator
References T_GIF_LSDB::Aspect, T_GIF_LSDB::Backcol, T_IO_Context::Background_transparent, T_Document::backups, T_GIF_GCE::Block_identifier, T_GIF_GCE::Block_size, T_GIF_GCE::Block_terminator, T_IO_Context::Color_cycles, T_IO_Context::Comment, Config, Constraint_mode_label(), CONTEXT_MAIN_IMAGE, T_IO_Context::Cycle_range, gif_alphabet::daughter, T_GIF_GCE::Delay_time, DISPOSAL_METHOD_DO_NOT_DISPOSE, DISPOSAL_METHOD_RESTORE_BGCOLOR, T_Color_cycle::End, File_error, flags, gif_alphabet::free, T_GIF_GCE::Function, Get_frame_duration(), Get_pixel(), GFX2_DEBUG, GFX2_Log(), GFX2_malloc, GIF_empty_buffer(), GIF_INVALID_CODE, GIF_next_pixel(), GIF_set_code(), T_GIF_LSDB::Height, T_IO_Context::Height, T_GIF_IDB::Image_height, T_Page::Image_mode, IMAGE_MODE_ANIMATION, T_GIF_IDB::Image_width, T_GIF_IDB::Indicator, T_Color_cycle::Inverse, label, T_GIF_context::last_byte, Main, gif_alphabet::max, T_GIF_context::nb_bits, T_GIF_IDB::Nb_bits_pixel, T_IO_Context::Nb_layers, NULL, Open_file_write(), T_IO_Context::Original_file_directory, T_IO_Context::Original_file_name, T_GIF_GCE::Packed_fields, T_List_of_pages::Pages, T_IO_Context::Palette, PIXEL_TALL, PIXEL_TALL2, PIXEL_TALL3, PIXEL_WIDE, PIXEL_WIDE2, T_GIF_IDB::Pos_X, T_GIF_context::pos_X, T_GIF_IDB::Pos_Y, T_GIF_context::pos_Y, gif_alphabet::prefix, T_IO_Context::Ratio, T_GIF_context::remainder_bits, T_GIF_context::remainder_byte, Remove_file(), T_GIF_LSDB::Resol, Screen_height, T_Config::Screen_size_in_GIF, Screen_width, Set_saving_layer(), gif_alphabet::sister, T_Color_cycle::Speed, T_Color_cycle::Start, T_GIF_context::stop, gif_alphabet::suffix, T_GIF_GCE::Transparent_color, T_IO_Context::Transparent_color, T_IO_Context::Type, T_GIF_LSDB::Width, T_IO_Context::Width, Write_byte(), Write_bytes(), Write_word_be(), and Write_word_le().
void Test_PCX | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
References T_PCX_Header::Bytes_per_plane_line, T_PCX_Header::Compression, T_PCX_Header::Depth, File_error, T_PCX_Header::Filler, T_PCX_Header::Manufacturer, T_PCX_Header::Palette_16c, T_PCX_Header::Palette_info, PCX_header, T_PCX_Header::Plane, Read_byte(), Read_bytes(), Read_word_le(), T_PCX_Header::Reserved, T_PCX_Header::Screen_X, T_PCX_Header::Screen_Y, T_PCX_Header::Version, T_PCX_Header::X_dpi, T_PCX_Header::X_max, T_PCX_Header::X_min, T_PCX_Header::Y_dpi, T_PCX_Header::Y_max, and T_PCX_Header::Y_min.
void Load_PCX | ( | T_IO_Context * | context | ) |
References T_PCX_Header::Bytes_per_plane_line, T_Config::Clear_palette, T_PCX_Header::Compression, Config, T_PCX_Header::Depth, Draw_IFF_line(), Draw_PCX_line(), File_error, File_length_file(), T_PCX_Header::Filler, FORMAT_PCX, GFX2_ERROR, GFX2_Log(), T_IO_Context::Height, T_PCX_Header::Manufacturer, NULL, Open_file_read(), Original_screen_X, Original_screen_Y, T_IO_Context::Palette, T_PCX_Header::Palette_16c, T_PCX_Header::Palette_info, PCX_header, PIXEL_SIMPLE, T_PCX_Header::Plane, Pre_load(), Read_byte(), Read_bytes(), Read_word_le(), T_PCX_Header::Reserved, T_PCX_Header::Screen_X, T_PCX_Header::Screen_Y, Set_CGA_Color(), Set_pixel(), Set_pixel_24b(), T_PCX_Header::Version, T_IO_Context::Width, T_PCX_Header::X_dpi, T_PCX_Header::X_max, T_PCX_Header::X_min, T_PCX_Header::Y_dpi, T_PCX_Header::Y_max, and T_PCX_Header::Y_min.
void Save_PCX | ( | T_IO_Context * | context | ) |
References T_PCX_Header::Bytes_per_plane_line, T_PCX_Header::Compression, T_PCX_Header::Depth, File_error, T_PCX_Header::Filler, Get_pixel(), T_IO_Context::Height, T_PCX_Header::Manufacturer, NULL, Open_file_write(), T_IO_Context::Palette, T_PCX_Header::Palette_16c, T_PCX_Header::Palette_info, PCX_header, T_PCX_Header::Plane, Remove_file(), T_PCX_Header::Reserved, Screen_height, Screen_width, T_PCX_Header::Screen_X, T_PCX_Header::Screen_Y, T_PCX_Header::Version, T_IO_Context::Width, Write_bytes(), Write_one_byte, Write_word_le(), T_PCX_Header::X_dpi, T_PCX_Header::X_max, T_PCX_Header::X_min, T_PCX_Header::Y_dpi, T_PCX_Header::Y_max, and T_PCX_Header::Y_min.
void Test_BMP | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for BMP format.
References File_error, GFX2_DEBUG, GFX2_Log(), T_BMP_Header::Offset, Read_bytes(), Read_dword_le(), Read_word_le(), T_BMP_Header::Reserved_1, T_BMP_Header::Reserved_2, T_BMP_Header::Signature, T_BMP_Header::Size_1, and T_BMP_Header::Size_2.
void Load_BMP | ( | T_IO_Context * | context | ) |
Load BMP file.
References T_BMP_Header::Clr_Imprt, T_BMP_Header::Compression, File_error, File_length_file(), FORMAT_BMP, GFX2_DEBUG, GFX2_Log(), GFX2_WARNING, T_BMP_Header::Height, Load_BMP_Palette(), LOAD_BMP_PIXEL_FLAG_TOP_DOWN, Load_BMP_Pixels(), T_BMP_Header::Nb_bits, T_BMP_Header::Nb_Clr, NULL, T_BMP_Header::Offset, Open_file_read(), PIXEL_SIMPLE, PIXEL_TALL, PIXEL_WIDE, T_BMP_Header::Planes, Pre_load(), Read_bytes(), Read_dword_le(), Read_word_le(), T_BMP_Header::Reserved_1, T_BMP_Header::Reserved_2, T_BMP_Header::Signature, T_BMP_Header::Size_1, T_BMP_Header::Size_2, T_BMP_Header::Size_3, T_BMP_Header::Width, T_BMP_Header::XPM, and T_BMP_Header::YPM.
void Save_BMP | ( | T_IO_Context * | context | ) |
Save BMP file.
References T_BMP_Header::Clr_Imprt, T_BMP_Header::Compression, File_error, Get_pixel(), T_BMP_Header::Height, T_IO_Context::Height, T_BMP_Header::Nb_bits, T_BMP_Header::Nb_Clr, NULL, T_BMP_Header::Offset, Open_file_write(), T_IO_Context::Palette, T_BMP_Header::Planes, Remove_file(), T_BMP_Header::Reserved_1, T_BMP_Header::Reserved_2, T_BMP_Header::Signature, T_BMP_Header::Size_1, T_BMP_Header::Size_2, T_BMP_Header::Size_3, T_BMP_Header::Width, T_IO_Context::Width, Write_bytes(), Write_dword_le(), Write_one_byte, Write_word_le(), T_BMP_Header::XPM, and T_BMP_Header::YPM.
void Test_IMG | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
void Load_IMG | ( | T_IO_Context * | context | ) |
References File_error, File_length_file(), T_IMG_Header::Filler1, T_IMG_Header::Filler2, FORMAT_IMG, T_IO_Context::Height, T_IMG_Header::Height, NULL, Open_file_read(), T_IO_Context::Palette, T_IMG_Header::Palette, PIXEL_SIMPLE, Pre_load(), Read_bytes(), Read_word_le(), Set_pixel(), T_IO_Context::Width, and T_IMG_Header::Width.
void Save_IMG | ( | T_IO_Context * | context | ) |
References File_error, T_IMG_Header::Filler1, T_IMG_Header::Filler2, Get_pixel(), T_IO_Context::Height, T_IMG_Header::Height, NULL, Open_file_write(), T_IO_Context::Palette, T_IMG_Header::Palette, Remove_file(), T_IO_Context::Width, T_IMG_Header::Width, Write_bytes(), Write_one_byte, and Write_word_le().
void Test_SCx | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test if a file is SCx format.
References File_error, T_SCx_Header::Filler1, T_SCx_Header::Height, T_SCx_Header::PaletteType, Read_byte(), Read_bytes(), Read_word_le(), T_SCx_Header::StorageType, and T_SCx_Header::Width.
void Load_SCx | ( | T_IO_Context * | context | ) |
Read a SCx file.
References T_Config::Clear_palette, Config, Draw_IFF_line(), File_error, File_length_file(), T_SCx_Header::Filler1, FORMAT_SCx, GFX2_Log(), GFX2_WARNING, T_SCx_Header::Height, T_IO_Context::Height, Open_file_read(), T_IO_Context::Palette, Palette_64_to_256(), T_SCx_Header::PaletteType, PIXEL_SIMPLE, Pre_load(), Read_byte(), Read_bytes(), Read_word_le(), Set_pixel(), T_SCx_Header::StorageType, T_SCx_Header::Width, and T_IO_Context::Width.
void Save_SCx | ( | T_IO_Context * | context | ) |
Save a SCx file.
References File_error, T_IO_Context::File_name, T_IO_Context::File_name_unicode, T_SCx_Header::Filler1, Get_pixel(), T_SCx_Header::Height, T_IO_Context::Height, NULL, Open_file_write(), T_IO_Context::Palette, Palette_256_to_64(), T_SCx_Header::PaletteType, Remove_file(), T_SCx_Header::StorageType, Unicode_strlen(), T_SCx_Header::Width, T_IO_Context::Width, Write_byte(), Write_bytes(), Write_one_byte, and Write_word_le().
void Test_CEL | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
References File_error, File_length_file(), T_CEL_Header2::Filler1, T_CEL_Header2::Filler2, T_CEL_Header1::Height, T_CEL_Header2::Height, T_CEL_Header2::Kind, T_CEL_Header2::Nb_bits, Read_byte(), Read_bytes(), Read_word_le(), T_CEL_Header2::Signature, T_CEL_Header1::Width, T_CEL_Header2::Width, T_CEL_Header2::X_offset, and T_CEL_Header2::Y_offset.
void Load_CEL | ( | T_IO_Context * | context | ) |
References File_error, File_length_file(), T_CEL_Header2::Filler1, T_CEL_Header2::Filler2, FORMAT_CEL, T_IO_Context::Height, T_CEL_Header1::Height, T_CEL_Header2::Height, T_CEL_Header2::Kind, T_CEL_Header2::Nb_bits, Open_file_read(), Original_screen_X, Original_screen_Y, PIXEL_SIMPLE, Pre_load(), Read_byte(), Read_bytes(), Read_word_le(), Set_pixel(), T_CEL_Header2::Signature, T_IO_Context::Width, T_CEL_Header1::Width, T_CEL_Header2::Width, T_CEL_Header2::X_offset, and T_CEL_Header2::Y_offset.
void Save_CEL | ( | T_IO_Context * | context | ) |
References Count_used_colors(), File_error, T_CEL_Header2::Filler1, T_CEL_Header2::Filler2, Get_pixel(), T_IO_Context::Height, T_CEL_Header1::Height, T_CEL_Header2::Height, T_CEL_Header2::Kind, T_CEL_Header2::Nb_bits, NULL, Open_file_write(), Remove_file(), T_CEL_Header2::Signature, T_IO_Context::Width, T_CEL_Header1::Width, T_CEL_Header2::Width, Write_byte(), Write_bytes(), Write_one_byte, Write_word_le(), T_CEL_Header2::X_offset, and T_CEL_Header2::Y_offset.
void Test_KCF | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
References T_KCF_Header::Byte1, T_KCF_Header::Byte2, T_KCF_Header::color, File_error, File_length_file(), T_CEL_Header2::Filler1, T_CEL_Header2::Filler2, T_CEL_Header2::Height, T_CEL_Header2::Kind, T_CEL_Header2::Nb_bits, T_KCF_Header::Palette, Read_byte(), Read_bytes(), Read_word_le(), T_CEL_Header2::Signature, T_CEL_Header2::Width, T_CEL_Header2::X_offset, and T_CEL_Header2::Y_offset.
void Load_KCF | ( | T_IO_Context * | context | ) |
References T_KCF_Header::Byte1, T_KCF_Header::Byte2, T_Config::Clear_palette, T_KCF_Header::color, Config, File_error, File_length_file(), T_CEL_Header2::Filler1, T_CEL_Header2::Filler2, T_CEL_Header2::Height, T_CEL_Header2::Kind, T_CEL_Header2::Nb_bits, Open_file_read(), T_IO_Context::Palette, T_KCF_Header::Palette, Read_byte(), Read_bytes(), Read_word_le(), T_CEL_Header2::Signature, T_CEL_Header2::Width, T_CEL_Header2::X_offset, and T_CEL_Header2::Y_offset.
void Save_KCF | ( | T_IO_Context * | context | ) |
References T_KCF_Header::Byte1, T_KCF_Header::Byte2, T_KCF_Header::color, Count_used_colors(), File_error, T_CEL_Header2::Filler1, T_CEL_Header2::Filler2, T_CEL_Header2::Height, T_CEL_Header2::Kind, T_CEL_Header2::Nb_bits, NULL, Open_file_write(), T_IO_Context::Palette, T_KCF_Header::Palette, Remove_file(), T_CEL_Header2::Signature, T_CEL_Header2::Width, Write_byte(), Write_bytes(), Write_word_le(), T_CEL_Header2::X_offset, and T_CEL_Header2::Y_offset.
void Test_PAL | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
References File_error, File_length_file(), and Read_bytes().
void Load_PAL | ( | T_IO_Context * | context | ) |
References File_error, File_length_file(), Open_file_read(), T_IO_Context::Palette, Palette_64_to_256(), Read_bytes(), and Read_word_le().
void Save_PAL | ( | T_IO_Context * | context | ) |
References File_error, NULL, Open_file_write(), T_IO_Context::Palette, and Remove_file().
void Test_GPL | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for GPL (Gimp Palette) file format.
References File_error, File_length_file(), and Read_bytes().
void Load_GPL | ( | T_IO_Context * | context | ) |
Load GPL (Gimp Palette) file format.
References T_IO_Context::Comment, File_error, GFX2_DEBUG, GFX2_Log(), NULL, Open_file_read(), T_IO_Context::Palette, Read_byte_line(), and skip_padding().
void Save_GPL | ( | T_IO_Context * | context | ) |
Save GPL (Gimp Palette) file format.
References File_error, T_IO_Context::File_name, NULL, Open_file_write(), T_IO_Context::Palette, and Remove_file().
void Test_PI1 | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for Degas file format.
References File_error, File_length_file(), and Read_word_be().
void Load_PI1 | ( | T_IO_Context * | context | ) |
Load Degas file format.
References T_Config::Clear_palette, Config, File_error, File_length_file(), FORMAT_PI1, GFX2_DEBUG, GFX2_Log(), NULL, Open_file_read(), T_IO_Context::Palette, PI1_8b_to_16p(), PI1_decode_palette(), PI1_load_ranges(), PI2_4b_to_16p(), PI4_16b_to_16p(), PIXEL_SIMPLE, PIXEL_TALL, PIXEL_WIDE, Pre_load(), Read_bytes(), Read_word_be(), and Set_pixel().
void Save_PI1 | ( | T_IO_Context * | context | ) |
Save a PI1 Degas uncompressed picture.
References T_IO_Context::Color_cycles, File_error, Get_pixel(), GFX2_malloc, NULL, Open_file_write(), T_IO_Context::Palette, PI1_16p_to_8b(), PI1_code_palette(), PI1_save_ranges(), Remove_file(), and Write_bytes().
void Test_PC1 | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for Degas Elite Compressed format.
References File_error, File_length_file(), and Read_word_be().
void Load_PC1 | ( | T_IO_Context * | context | ) |
Load Degas Elite compressed files.
References T_Config::Clear_palette, Config, File_error, File_length_file(), FORMAT_PC1, GFX2_DEBUG, GFX2_INFO, GFX2_Log(), GFX2_malloc, NULL, Open_file_read(), PackBits_unpack_from_file(), PACKBITS_UNPACK_OK, T_IO_Context::Palette, PC1_4bp_to_1line(), PI1_decode_palette(), PI1_load_ranges(), PIXEL_SIMPLE, PIXEL_TALL, Pre_load(), Read_bytes(), Read_word_be(), and Set_pixel().
void Save_PC1 | ( | T_IO_Context * | context | ) |
Save a Degas Elite compressed picture.
References File_error, Get_pixel(), GFX2_malloc, NULL, Open_file_write(), PackBits_pack_buffer(), T_IO_Context::Palette, PC1_1line_to_4bp(), PI1_code_palette(), PI1_save_ranges(), Remove_file(), Write_bytes(), and Write_word_be().
void Test_CA1 | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
test for CrackArt format.
Test that the files starts with the "CA" signature, then 1 byte for the compressed flag (0 or 1), then 1 byte for the resolution (0=low, 1=med, 2=high)
References File_error, and Read_bytes().
void Load_CA1 | ( | T_IO_Context * | context | ) |
References T_Config::Clear_palette, Config, File_error, File_length_file(), FORMAT_CA1, GFX2_DEBUG, GFX2_Log(), GFX2_malloc, NULL, Open_file_read(), T_IO_Context::Palette, PI1_8b_to_16p(), PI1_decode_palette(), PI2_4b_to_16p(), PIXEL_SIMPLE, PIXEL_TALL, Pre_load(), Read_byte(), Read_bytes(), Read_word_be(), and Set_pixel().
void Save_CA1 | ( | T_IO_Context * | context | ) |
Save a 320x200 16c picture in CrackArt format.
References File_error, Get_pixel(), GFX2_DEBUG, GFX2_Log(), GFX2_malloc, NULL, Open_file_write(), T_IO_Context::Palette, PI1_16p_to_8b(), PI1_code_palette(), Write_byte(), Write_bytes(), and Write_word_be().
void Test_TNY | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
References File_error, File_length_file(), GFX2_DEBUG, GFX2_Log(), Read_byte(), and Read_word_be().
void Load_TNY | ( | T_IO_Context * | context | ) |
Tiny stuff packs the ST RAM in 4 planes of 8000 bytes Data is organized by column in each plane Warning : this is the same organization for all 3 ST Video modes
References T_Config::Clear_palette, T_IO_Context::Color_cycles, Config, T_IO_Context::Cycle_range, T_Color_cycle::End, File_error, File_length_file(), FORMAT_TNY, GFX2_DEBUG, GFX2_Log(), GFX2_malloc, T_Color_cycle::Inverse, NULL, Open_file_read(), T_IO_Context::Palette, PI1_8b_to_16p(), PI1_decode_palette(), PI2_4b_to_16p(), PIXEL_SIMPLE, PIXEL_TALL, Pre_load(), Read_byte(), Read_bytes(), Read_word_be(), Set_pixel(), T_Color_cycle::Speed, and T_Color_cycle::Start.
void Save_TNY | ( | T_IO_Context * | context | ) |
Save in Tiny compressed format.
fill the buffer with the special Tiny Stuff organization
References File_error, NULL, Open_file_write(), T_IO_Context::Palette, PI1_16p_to_8b(), PI1_code_palette(), T_IO_Context::Pitch, Remove_file(), T_IO_Context::Target_address, WORDS_EQU, Write_byte(), Write_bytes(), and Write_word_be().
void Test_NEO | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
NeoChrome Format :
1 word flag word [always 0] 1 word resolution [0 = low res, 1 = medium res, 2 = high res] 16 words palette 12 bytes filename [usually " . "] 1 word color animation limits. High bit (bit 15) set if color animation data is valid. Low byte contains color animation limits (4 most significant bits are left/lower limit, 4 least significant bits are right/upper limit). 1 word color animation speed and direction. High bit (bit 15) set if animation is on. Low order byte is # vblanks per step. If negative, scroll is left (decreasing). Number of vblanks between cycles is |x| - 1 1 word # of color steps (as defined in previous word) to display picture before going to the next. (For use in slide shows) 1 word image X offset [unused, always 0] 1 word image Y offset [unused, always 0] 1 word image width [unused, always 320] 1 word image height [unused, always 200] 33 words reserved for future expansion 32000 bytes pixel data
Dali *.SD0 (ST low resolution) .SD1 (ST medium resolution) .SD2 (ST high resolution)
Files do not seem to have any resolution or bit plane info stored in them. The file extension seems to be the only way to determine the contents.
1 long file id? [always 0] 16 words palette 92 bytes reserved? [usually 0]
References File_error, File_length_file(), and Read_word_be().
void Load_NEO | ( | T_IO_Context * | context | ) |
Load Neochrome file format.
References T_Config::Clear_palette, T_IO_Context::Color_cycles, COLOR_CYCLING_SPEED_MAX, Config, T_IO_Context::Cycle_range, T_Color_cycle::End, File_error, File_length_file(), FORMAT_NEO, GFX2_DEBUG, GFX2_Log(), GFX2_LogHexDump(), T_Color_cycle::Inverse, NULL, Open_file_read(), T_IO_Context::Palette, PI1_8b_to_16p(), PI1_decode_palette(), PI2_4b_to_16p(), PIXEL_SIMPLE, PIXEL_TALL, Pre_load(), Read_bytes(), Read_word_be(), Set_pixel(), T_Color_cycle::Speed, and T_Color_cycle::Start.
void Save_NEO | ( | T_IO_Context * | context | ) |
Save in NeoChrome format.
References T_IO_Context::Color_cycles, T_IO_Context::Cycle_range, T_Color_cycle::End, File_error, T_IO_Context::File_name, Get_pixel(), T_Color_cycle::Inverse, NULL, Open_file_write(), T_IO_Context::Palette, PI1_16p_to_8b(), PI1_code_palette(), Remove_file(), T_Color_cycle::Speed, T_Color_cycle::Start, Write_byte(), Write_bytes(), and Write_word_be().
void Test_C64 | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for a C64 picture file.
Checks the file size and the load address
References :
References C64_unpack_doodle(), File_error, File_length_file(), GFX2_DEBUG, GFX2_Log(), GFX2_malloc, NULL, Read_bytes(), and Read_word_le().
void Load_C64 | ( | T_IO_Context * | context | ) |
Load C64 pictures formats.
Supports:
see http://unusedino.de/ec64/technical/formats/bitmap.html
context | the IO context |
References c64_format_names, C64_set_palette(), C64_unpack_amica(), C64_unpack_doodle(), C64_unpack_draz(), T_Config::Clear_palette, T_IO_Context::Comment, COMMENT_SIZE, Config, F_bitmap, F_fli, F_hires, F_invalid, F_multi, File_error, File_length_file(), FORMAT_C64, GFX2_malloc, IMAGE_MODE_C64FLI, IMAGE_MODE_C64HIRES, IMAGE_MODE_C64MULTI, Load_C64_fli(), Load_C64_hires(), Load_C64_multi(), NULL, Open_file_read(), T_IO_Context::Palette, PIXEL_SIMPLE, PIXEL_WIDE, Pre_load(), T_IO_Context::Ratio, Read_bytes(), Set_image_mode(), and T_IO_Context::Transparent_color.
Referenced by Test_C64_Formats().
void Save_C64 | ( | T_IO_Context * | context | ) |
Save C64 picture.
Supports :
context | the IO context |
References F_bitmap, F_fli, F_hires, F_invalid, F_multi, File_error, T_IO_Context::File_name, GFX2_DEBUG, GFX2_Log(), T_IO_Context::Height, T_IO_Context::Nb_layers, Save_C64_fli(), Save_C64_fli_monolayer(), Save_C64_hires(), Save_C64_multi(), Save_C64_window(), Set_saving_layer(), Warning_message(), and T_IO_Context::Width.
void Test_PRG | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for a C64 auto-load machine language program which could be a picture.
References C64_isBinaryProgram(), File_error, File_length_file(), and Read_word_le().
void Load_PRG | ( | T_IO_Context * | context | ) |
Load C64 autoload pictures.
context | the IO context |
References c64state::backgrounds, c64state::bitmap, C64_isBinaryProgram(), C64_LoadPrg(), C64_set_palette(), C64_VICMODE_FLI, C64_VICMODE_MULTI, T_Config::Clear_palette, Config, F_fli, F_hires, F_invalid, F_multi, File_error, File_length_file(), FORMAT_PRG, IMAGE_MODE_C64FLI, IMAGE_MODE_C64HIRES, IMAGE_MODE_C64MULTI, Load_C64_fli(), Load_C64_hires(), Load_C64_multi(), NULL, Open_file_read(), T_IO_Context::Palette, PIXEL_SIMPLE, PIXEL_WIDE, Pre_load(), c64state::ram, T_IO_Context::Ratio, Read_word_le(), c64state::screen, Set_image_mode(), T_IO_Context::Transparent_color, and c64state::vicmode.
void Save_PRG | ( | T_IO_Context * | context | ) |
Save autoloading C64 picture.
References c64state::bitmap, C64_color_ram_pack(), Encode_C64_hires(), Encode_C64_multicolor(), F_hires, F_invalid, F_multi, File_error, GFX2_DEBUG, GFX2_ERROR, GFX2_Log(), T_IO_Context::Height, NULL, Open_file_write(), PackBits_pack_buffer(), picview_prg, Set_saving_layer(), Warning_message(), T_IO_Context::Width, Write_byte(), and Write_bytes().
void Test_GPX | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
References File_error, and Read_bytes().
void Load_GPX | ( | T_IO_Context * | context | ) |
References c64state::bitmap, C64_set_palette(), T_Config::Clear_palette, T_IO_Context::Comment, COMMENT_SIZE, Config, File_error, File_length_file(), FORMAT_GPX, GFX2_DEBUG, GFX2_ERROR, GFX2_Log(), GFX2_malloc, IMAGE_MODE_C64HIRES, IMAGE_MODE_C64MULTI, Load_C64_multi(), mode, NULL, Open_file_read(), T_IO_Context::Palette, PIXEL_SIMPLE, PIXEL_WIDE, Pre_load(), T_IO_Context::Ratio, Read_bytes(), READU32LE, screen, Set_image_mode(), and T_IO_Context::Transparent_color.
void Test_SCR | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for SCR file (Amstrad CPC)
SCR file format is originally from "Advanced OCP Art Studio" : http://www.cpcwiki.eu/index.php/Format:Advanced_OCP_Art_Studio_File_Formats
.WIN "window" format is also supported.
SCR files are normally just a dump of the 16K of video memory. So they are essentially 16 kilobytes of pixel data without any header. To make things more fun, there is an optional compression. This all makes detection a bit fuzzy. However there are various things we can still check:
C7D0: 3a d0 d7 cd 1c bd 21 d1 d7 46 48 cd 38 bc af 21 | :.....!..FH.8..!
C7E0: d1 d7 46 48 f5 e5 cd 32 bc e1 f1 23 3c fe 10 20 | ..FH...2...#<..
C7F0: f1 c3 18 bb 00 00 00 00 00 00 00 00 00 00 00 00 | ................
D7D0: 00 1a 00 0c 03 0b 01 0d 17 10 02 0f 09 19 06 00 | ................
References sgx_data::context, CPC_check_AMSDOS(), sgx_data::file, File_error, File_length_file(), sgx_data::file_size, GFX2_DEBUG, GFX2_Log(), GFX2_LogHexDump(), mode, NULL, Open_file_read_with_alternate_ext(), Read_byte(), and Read_bytes().
void Load_SCR | ( | T_IO_Context * | context | ) |
Load Advanced OCP Art Studio files (Amstrad CPC)
Standard resolution files (Mode 0 160x200, mode 1 320x200 and mode 2 640x200) are supported. The .PAL file is loaded if available. "MJH" RLE packing is supported. Embedded CRTC registers and palette data from various tools is also supported.
.WIN "window" format is also loaded here and allows different picture sizes.
References T_Config::Clear_palette, Close_window(), T_IO_Context::Comment, COMMENT_SIZE, Config, sgx_data::context, CONTEXT_MAIN_IMAGE, CPC_check_AMSDOS(), CPC_Firmware_to_Hardware_color(), CPC_set_HW_palette(), Depack_CPC_LZW(), Display_cursor(), sgx_data::file, File_error, File_length_file(), sgx_data::file_size, FORMAT_SCR, GFX2_DEBUG, GFX2_ERROR, GFX2_INFO, GFX2_is_mem_filled_with(), GFX2_Log(), GFX2_LogHexDump(), GFX2_malloc, GFX2_WARNING, sgx_data::height, INPUT_TYPE_INTEGER, KEY_ESCAPE, KEY_RETURN, LEFT_SIDE, MC_Dark, MC_Light, mode, NULL, Num2str, Open_file_read(), Open_file_read_with_alternate_ext(), Open_window(), T_IO_Context::Palette, PIXEL_SIMPLE, PIXEL_TALL, PIXEL_WIDE, Pre_load(), Print_in_window(), Read_byte(), Read_bytes(), Read_word_le(), Readline(), Set_pixel(), T_IO_Context::Type, Update_window_area, sgx_data::width, Window_attribute2, Window_clicked_button(), Window_dropdown_add_item(), Window_dropdown_clear_items(), Window_height, Window_input_content(), Window_set_dropdown_button(), Window_set_input_button(), Window_set_normal_button(), and Window_width.
void Save_SCR | ( | T_IO_Context * | context | ) |
Save Amstrad SCR file.
guess mode from aspect ratio :
Mode and palette are stored in a .PAL file for compatibility with OCP Art studio.
The picture color index should be 0-15, The CPC Hardware palette is expected to be set (indexes 64 to 95)
If the picture is using overscan (more than 16384 bytes) we produce a iMPdraw v2 format autoloading file. see http://orgams.wikidot.com/le-format-impdraw-v2
If the picture is not using overscan (standard resolutions, < 16384 screen buffer) a BASIC loader is saved.
Add possibility to set R9 value
Add OCP packing support
References sgx_data::context, CPC_compare_colors(), CPC_is_CPC_old_color(), cpc_scr_simple_loader, CPC_set_HW_palette(), CPC_write_AMSDOS_header(), sgx_data::file, File_error, T_IO_Context::File_name, GFX2_DEBUG, GFX2_Log(), GFX2_WARNING, T_IO_Context::Height, impdraw_loader, NULL, Open_file_write(), Open_file_write_with_alternate_ext(), T_IO_Context::Palette, PIXEL_TALL, PIXEL_TALL2, PIXEL_TALL3, PIXEL_WIDE, PIXEL_WIDE2, T_IO_Context::Ratio, raw2crtc(), T_IO_Context::Width, Write_byte(), and Write_bytes().
void Test_CM5 | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for CM5 - Amstrad CPC "Mode 5" picture.
This is a format designed by SyX. There is one .GFX file in the usual amstrad format and a .CM5 file with the palette, which varies over time.
CM5 file is 2049 bytes, GFX is 18432 bytes.
References sgx_data::context, CPC_check_AMSDOS(), sgx_data::file, File_error, File_length_file(), sgx_data::file_size, NULL, and Open_file_read_with_alternate_ext().
void Load_CM5 | ( | T_IO_Context * | context | ) |
Load Amstrad CPC "Mode 5" picture.
Only support 288x256 resolution as the Mode 5 Viewer app only handles this single resolution.
References T_Config::Clear_palette, Config, sgx_data::context, CONTEXT_MAIN_IMAGE, CONTEXT_PREVIEW, CPC_check_AMSDOS(), CPC_set_HW_palette(), sgx_data::file, File_error, First_color_in_palette, FORMAT_CM5, T_IO_Context::Height, IMAGE_MODE_MODE5, NULL, Open_file_read(), Open_file_read_with_alternate_ext(), T_IO_Context::Palette, PIXEL_SIMPLE, Pre_load(), Read_byte(), Set_image_mode(), Set_loading_layer(), Set_pixel(), T_IO_Context::Type, and T_IO_Context::Width.
void Save_CM5 | ( | T_IO_Context * | context | ) |
Save a CPC Mode 5 picture.
Resolution is fixed to 288x256. The pictures uses 5 layers. 4 for defining the "inks" the 5th to select one of the 4 inks.
The .CM5 file contains the inks from layers 1-4, the .GFX file contains the pixel data in linear fashion
Check picture has 5 layers
Check the constraints on the layers
References sgx_data::context, sgx_data::file, File_error, Get_pixel(), Open_file_write(), Open_file_write_with_alternate_ext(), Set_saving_layer(), and Write_byte().
void Test_PPH | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Amstrad CPC 'PPH' for Perfect Pix.
This is a format designed by Rhino. There are 3 modes:
References sgx_data::context, sgx_data::file, File_error, File_length_file(), sgx_data::file_size, NULL, Open_file_read_with_alternate_ext(), and Read_bytes().
void Load_PPH | ( | T_IO_Context * | context | ) |
References sgx_data::context, sgx_data::file, File_error, File_length_file(), sgx_data::file_size, FORMAT_PPH, sgx_data::height, mode, NULL, Open_file_read(), Open_file_read_with_alternate_ext(), T_IO_Context::Palette, PIXEL_SIMPLE, PIXEL_TALL, PIXEL_WIDE, pph_blend(), Pre_load(), T_IO_Context::Ratio, Read_byte(), Read_word_le(), Set_pixel(), and sgx_data::width.
void Save_PPH | ( | T_IO_Context * | context | ) |
Not yet implemented.
References sgx_data::context.
void Test_GOS | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for GO1/GO2/KIT - Amstrad Plus Graphos.
This format is made of 3 files .KIT hold the palette in "Kit4096" format. There are 16 colors each stored as 12 bit RGB in RB0G order. .GO1 and GO2 hold each half of the picture (top and bottom) The file always cover the whole display of the Plus (192*272 mode 0 pixels) Only mode 0 is possible.
References sgx_data::context, CPC_check_AMSDOS(), sgx_data::file, File_error, File_length_file(), sgx_data::file_size, NULL, and Open_file_read_with_alternate_ext().
void Load_GOS | ( | T_IO_Context * | context | ) |
Load GO1/GO2/KIT - Amstrad CPC Plus Graphos.
References T_Config::Clear_palette, Config, sgx_data::context, CPC_check_AMSDOS(), CPC_set_HW_palette(), sgx_data::file, File_error, File_length_file(), sgx_data::file_size, FORMAT_GOS, GFX2_malloc, NULL, Open_file_read(), Open_file_read_with_alternate_ext(), T_IO_Context::Palette, PIXEL_WIDE, Pre_load(), Read_byte(), Read_bytes(), Read_word_le(), and Set_pixel().
Referenced by Test_Save().
void Save_GOS | ( | T_IO_Context * | context | ) |
References sgx_data::context, sgx_data::file, File_error, GFX2_DEBUG, GFX2_Log(), T_IO_Context::Height, NULL, Open_file_write(), Open_file_write_with_alternate_ext(), T_IO_Context::Palette, T_IO_Context::Pitch, raw2crtc(), T_IO_Context::Target_address, T_IO_Context::Width, Write_bytes(), and Write_word_le().
void Test_SGX | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for SGX file (SymbOS)
http://www.cpcwiki.eu/index.php/Format:SGX_(SymbOS_graphic_files)
References File_error, File_length_file(), and Read_bytes().
void Load_SGX | ( | T_IO_Context * | context | ) |
References sgx_data::context, sgx_data::file, File_error, File_length_file(), sgx_data::file_size, FORMAT_SGX, GFX2_DEBUG, GFX2_Log(), sgx_data::height, sgx_data::ncolors, NULL, Open_file_read(), PIXEL_SIMPLE, Pre_load(), Read_SGX(), Set_SGX_Palette(), SGX_Get_dimensions(), SGX_Load_Picture(), and sgx_data::width.
void Save_SGX | ( | T_IO_Context * | context | ) |
void Save_XPM | ( | T_IO_Context * | context | ) |
void Test_ICO | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
References File_error, and Read_word_le().
void Load_ICO | ( | T_IO_Context * | context | ) |
References T_IO_Context::Background_transparent, T_ICO_ImageEntry::bpp, T_ICO_ImageEntry::bytecount, T_BMP_Header::Clr_Imprt, T_BMP_Header::Compression, File_error, File_length_file(), FORMAT_ICO, GFX2_DEBUG, GFX2_Log(), GFX2_WARNING, T_BMP_Header::Height, T_ICO_ImageEntry::height, Load_BMP_Palette(), LOAD_BMP_PIXEL_FLAG_TOP_DOWN, LOAD_BMP_PIXEL_FLAG_TRANSP_PLANE, Load_BMP_Pixels(), Load_PNG_Sub(), T_BMP_Header::Nb_bits, T_BMP_Header::Nb_Clr, T_ICO_ImageEntry::ncolors, NULL, T_ICO_ImageEntry::offset, Open_file_read(), PIXEL_SIMPLE, T_BMP_Header::Planes, T_ICO_ImageEntry::planes, Pre_load(), Read_byte(), Read_bytes(), Read_dword_le(), Read_word_le(), T_ICO_ImageEntry::reserved, T_BMP_Header::Size_2, T_BMP_Header::Size_3, T_IO_Context::Transparent_color, T_BMP_Header::Width, T_ICO_ImageEntry::width, T_BMP_Header::XPM, and T_BMP_Header::YPM.
void Save_ICO | ( | T_IO_Context * | context | ) |
References T_IO_Context::Background_transparent, T_ICO_ImageEntry::bpp, T_ICO_ImageEntry::bytecount, T_BMP_Header::Clr_Imprt, T_BMP_Header::Compression, File_error, Get_pixel(), GFX2_Log(), GFX2_WARNING, T_BMP_Header::Height, T_ICO_ImageEntry::height, T_IO_Context::Height, T_BMP_Header::Nb_bits, T_BMP_Header::Nb_Clr, T_ICO_ImageEntry::ncolors, NULL, T_ICO_ImageEntry::offset, Open_file_write(), T_IO_Context::Palette, T_BMP_Header::Planes, T_ICO_ImageEntry::planes, Remove_file(), T_ICO_ImageEntry::reserved, T_BMP_Header::Size_2, T_BMP_Header::Size_3, T_IO_Context::Transparent_color, T_BMP_Header::Width, T_ICO_ImageEntry::width, T_IO_Context::Width, Write_byte(), Write_dword_le(), Write_one_byte, Write_word_le(), T_BMP_Header::XPM, and T_BMP_Header::YPM.
void Test_PNG | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for PNG format.
The 8 byte signature at the start of file is tested
References File_error, and Read_bytes().
void Load_PNG | ( | T_IO_Context * | context | ) |
Read PNG format files.
just read/test the header and call Load_PNG_Sub()
References File_error, Load_PNG_Sub(), NULL, Open_file_read(), and Read_bytes().
void Save_PNG | ( | T_IO_Context * | context | ) |
Save a PNG file.
References File_error, NULL, Open_file_write(), Remove_file(), and Save_PNG_Sub().
void Load_PNG_Sub | ( | T_IO_Context * | context, |
FILE * | file, | ||
const char * | memory_buffer, | ||
unsigned long | memory_buffer_size | ||
) |
Read PNG format file.
References PNG_memory_buffer::buffer, T_Config::Clear_palette, COMMENT_SIZE, Config, CONTEXT_BRUSH, CONTEXT_MAIN_IMAGE, CONTEXT_PALETTE, CONTEXT_PREVIEW, CONTEXT_PREVIEW_PALETTE, CONTEXT_SURFACE, File_error, File_length_file(), FORMAT_PNG, GFX2_DEBUG, GFX2_Log(), MIN, NULL, PIXEL_SIMPLE, PIXEL_TALL, PIXEL_WIDE, png_get_bit_depth, png_get_color_type, png_get_image_height, png_get_image_width, png_get_rowbytes, png_jmpbuf, PNG_memory_read(), PNG_read_unknown_chunk(), png_set_expand_gray_1_2_4_to_8, Pre_load(), Set_pixel(), Set_pixel_24b(), and PNG_memory_buffer::size.
Referenced by Load_BMP_Pixels(), Load_ClipBoard_Image(), Load_ICO(), and Load_PNG().
void Save_PNG_Sub | ( | T_IO_Context * | context, |
FILE * | file, | ||
char ** | buffer, | ||
unsigned long * | buffer_size | ||
) |
Save a PNG to file or memory.
context | the IO context |
file | the FILE to write to or NULL to write to memory |
buffer | will receive a malloc'ed buffer if writting to memory |
buffer_size | will receive the PNG size in memory |
References T_IO_Context::Background_transparent, PNG_memory_buffer::buffer, memory_buffer::buffer, T_IO_Context::Color_cycles, T_IO_Context::Comment, T_IO_Context::Cycle_range, T_Color_cycle::End, File_error, flags, T_IO_Context::Height, T_Color_cycle::Inverse, NULL, memory_buffer::offset, T_IO_Context::Palette, T_IO_Context::Pitch, Pixel_ratio, PIXEL_TALL, PIXEL_TALL2, PIXEL_TALL3, PIXEL_WIDE, PIXEL_WIDE2, PNG_HAVE_PLTE, png_jmpbuf, PNG_memory_flush(), PNG_memory_write(), T_Color_cycle::Speed, T_Color_cycle::Start, T_IO_Context::Target_address, T_IO_Context::Transparent_color, and T_IO_Context::Width.
Referenced by Save_ClipBoard_Image(), and Save_PNG().
void Test_INFO | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
References File_error, T_INFO_Header::Magic, Read_INFO_Header(), and T_INFO_Header::Version.
void Load_INFO | ( | T_IO_Context * | context | ) |
References T_IO_Context::Background_transparent, T_Config::Clear_palette, T_IO_Context::Comment, COMMENT_SIZE, Config, CONTEXT_PREVIEW, CONTEXT_PREVIEW_PALETTE, Decode_NewIcons(), T_INFO_Header::DefaultTool, T_INFO_ImageHeader::Depth, Draw_IFF_line(), T_INFO_Header::DrawerData, File_error, File_length_file(), FORMAT_INFO, T_INFO_Header::GadgetRender, GFX2_Log(), GFX2_WARNING, T_INFO_Header::Height, T_INFO_ImageHeader::Height, IMAGE_MODE_ANIMATION, T_INFO_Header::Magic, MIN, NULL, Open_file_read(), T_IO_Context::Palette, PIXEL_SIMPLE, Pre_load(), Read_bytes(), Read_dword_be(), Read_INFO_Header(), Read_INFO_ImageHeader(), Read_INFO_String(), T_INFO_Header::SelectRender, Set_image_mode(), Set_loading_layer(), Set_pixel(), T_INFO_Header::ToolTypes, T_INFO_Header::ToolWindow, T_IO_Context::Transparent_color, T_IO_Context::Type, T_INFO_Header::UserData, T_INFO_Header::Width, and T_INFO_ImageHeader::Width.
void Test_FLI | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for the Autodesk Animator FLI/FLC format.
Not to be confused with Commodore 64 FLI.
References File_error, Load_FLI_Header(), and T_FLIC_Header::type.
void Load_FLI | ( | T_IO_Context * | context | ) |
Load file in the Autodesk Animator FLI/FLC format.
Not to be confused with Commodore 64 FLI.
References T_Document::backups, T_Config::Clear_palette, Config, CONTEXT_MAIN_IMAGE, CONTEXT_PREVIEW, CONTEXT_PREVIEW_PALETTE, T_Document::current_layer, T_FLIC_Header::depth, File_error, File_length_file(), FORMAT_FLI, Get_image_mode(), GFX2_Log(), GFX2_WARNING, T_FLIC_Header::height, T_Page::Height, T_Page::Image, IMAGE_MODE_ANIMATION, Load_FLI_Header(), Main, NULL, Open_file_read(), T_List_of_pages::Pages, T_IO_Context::Palette, PIXEL_SIMPLE, T_Image::Pixels, Pre_load(), Read_byte(), Read_dword_le(), Read_word_le(), Set_frame_duration(), Set_image_mode(), Set_loading_layer(), Set_pixel(), T_FLIC_Header::size, T_FLIC_Header::speed, T_IO_Context::Type, T_FLIC_Header::type, T_FLIC_Header::width, and T_Page::Width.
void Test_MOTO | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for Thomson file.
References T_IO_Context::File_directory, File_error, File_exists(), File_length_file(), T_IO_Context::File_name, Filepath_append_to_dir(), MOTO_Check_binary_file(), and NULL.
void Load_MOTO | ( | T_IO_Context * | context | ) |
Load a picture for Thomson TO8/TO8D/TO9/TO9+/MO6.
One of the supported format is the one produced by TGA2Teo :
The mode is detected thanks to the number of color in the palette :
As it is not possible to disriminate bitmap16 and 40col, opening the "P" file sets bitmap16, opening the "C" file sets 40col.
This function also supports .MAP files (with optional TO-SNAP extension) and our own "autoloading" BIN files. See http://pulkomandy.tk/projects/GrafX2/wiki/Develop/FileFormats/MOTO for a detailled description.
References T_Config::Clear_palette, T_IO_Context::Comment, COMMENT_SIZE, Config, T_IO_Context::File_directory, File_error, File_length_file(), T_IO_Context::File_name, Filepath_append_to_dir(), FORMAT_MOTO, GFX2_DEBUG, GFX2_ERROR, GFX2_Log(), GFX2_malloc, IMAGE_MODE_THOMSON, mode, MOTO_Check_binary_file(), MOTO_gamma_correct_MOTO_to_RGB(), MOTO_MODE_40col, MOTO_MODE_80col, MOTO_MODE_bm16, MOTO_MODE_bm4, MOTO_set_MO5_palette(), MOTO_set_TO7_palette(), NULL, Open_file_read(), T_IO_Context::Palette, PIXEL_SIMPLE, PIXEL_TALL, PIXEL_WIDE, Pre_load(), Read_byte(), Read_bytes(), Read_word_be(), Set_image_mode(), and Set_pixel().
void Save_MOTO | ( | T_IO_Context * | context | ) |
Save a picture in MAP or BIN Thomson MO/TO file format.
File format details : http://pulkomandy.tk/projects/GrafX2/wiki/Develop/FileFormats/MOTO
In the future we could support other resolution for .MAP format. And even in .BIN format, we could store less lines.
The 40col encoding algorithm is optimized for further vertical RLE packing. The "attibute" byte is kept as constant as possible between adjacent blocks.
For MO5 we use a different 40col algorithm to make sure the last pixel of a GPL and the first the next are both FORME or both FOND, else we get an ugly glitch on the EFGJ033 Gate Array MO5!
References T_IO_Context::Comment, DECB_BIN_Add_Chunk(), DECB_BIN_Add_End(), File_error, format, Get_pixel(), GFX2_DEBUG, GFX2_ERROR, GFX2_Log(), GFX2_malloc, T_IO_Context::Height, MACHINE_MO5, MACHINE_MO6, MACHINE_TO7, MACHINE_TO770, MACHINE_TO8, mode, MOTO_gamma_correct_RGB_to_MOTO(), MOTO_MAP_pack(), MOTO_MODE_40col, MOTO_MODE_80col, MOTO_MODE_bm16, MOTO_MODE_bm4, NULL, Open_file_write(), T_IO_Context::Palette, Program_version, Save_MOTO_window(), SVN_revision, Warning_message(), Warning_with_format(), and T_IO_Context::Width.
void Test_HGR | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for an Apple II HGR or DHGR raw file.
References File_error, and File_length_file().
void Load_HGR | ( | T_IO_Context * | context | ) |
Load HGR (280x192) or DHGR (560x192) Apple II pictures.
Creates 2 layers :
emulate "chat mauve" DHGR mixed mode. see http://boutillon.free.fr/Underground/Anim_Et_Graph/Extasie_Chat_Mauve_Reloaded/Extasie_Chat_Mauve_Reloaded.html
HGR emulation following the behaviour of a "Le Chat Mauve" RVB adapter for the Apple //c. Within the bit stream, the color of the middle pixel is :
111 \
Color depends on the selected palette for the current byte and the position of the pixel (odd or even).
110 }- white
011 /
010 \ _ color
101 /
000 \
001 }- black
100 /
References T_Config::Clear_palette, Config, CONTEXT_MAIN_IMAGE, DHGR_set_palette(), File_error, File_length_file(), FORMAT_HGR, GFX2_DEBUG, GFX2_LogHexDump(), GFX2_malloc, HGR_set_palette(), IMAGE_MODE_DHGR, IMAGE_MODE_HGR, NULL, Open_file_read(), T_IO_Context::Palette, PIXEL_SIMPLE, PIXEL_TALL, Pre_load(), Read_bytes(), Set_image_mode(), Set_loading_layer(), Set_pixel(), and T_IO_Context::Type.
void Save_HGR | ( | T_IO_Context * | context | ) |
Save HGR (280x192) or DHGR (560x192) Apple II pictures.
The data saved is the "monochrome" data from layer 1
References File_error, Get_pixel(), T_IO_Context::Height, NULL, Open_file_write(), Set_saving_layer(), Warning_message(), T_IO_Context::Width, and Write_bytes().
void Test_TIFF | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
test for a valid TIFF
References File_error, and Read_bytes().
void Load_TIFF | ( | T_IO_Context * | context | ) |
Load TIFF from file.
References T_IO_Context::File_directory, File_error, File_length(), File_length_file(), T_IO_Context::File_name, Filepath_append_to_dir(), Load_TIFF_Sub(), NULL, Open_file_read(), and TIFF_Init().
void Save_TIFF | ( | T_IO_Context * | context | ) |
Save TIFF.
References T_IO_Context::File_directory, File_error, T_IO_Context::File_name, T_IO_Context::File_name_unicode, Filepath_append_to_dir(), NULL, Save_TIFF_Sub(), and TIFF_Init().
void Load_TIFF_from_memory | ( | T_IO_Context * | context, |
const void * | buffer, | ||
unsigned long | size | ||
) |
Load TIFF from memory.
References memory_buffer::alloc_size, memory_buffer::buffer, Load_TIFF_Sub(), lTIFF_close(), lTIFF_map(), lTIFF_read(), lTIFF_seek(), lTIFF_size(), lTIFF_unmap(), lTIFF_write(), NULL, memory_buffer::offset, memory_buffer::size, and TIFF_Init().
Referenced by Load_ClipBoard_Image().
void Save_TIFF_to_memory | ( | T_IO_Context * | context, |
void ** | buffer, | ||
unsigned long * | size | ||
) |
Save TIFF to memory.
References memory_buffer::alloc_size, memory_buffer::buffer, lTIFF_close(), lTIFF_map(), lTIFF_read(), lTIFF_seek(), lTIFF_size(), lTIFF_unmap(), lTIFF_write(), NULL, memory_buffer::offset, Save_TIFF_Sub(), memory_buffer::size, and TIFF_Init().
Referenced by Save_ClipBoard_Image().
void Test_GRB | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for a HP-48 Grob file.
References File_error, File_length_file(), GFX2_DEBUG, GFX2_Log(), Read_bytes(), and Read_HP48Address().
void Load_GRB | ( | T_IO_Context * | context | ) |
void Test_MSX | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
References Check_MSX_BSAVE_format(), File_error, GFX2_DEBUG, and GFX2_Log().
void Load_MSX | ( | T_IO_Context * | context | ) |
Load a MSX Screen 2 picture.
TMS9918 Mode II VRAM layout :
References Check_MSX_BSAVE_format(), T_Config::Clear_palette, Config, File_error, File_length_file(), FORMAT_MSX, GFX2_DEBUG, GFX2_Log(), MSX_set_palette(), Open_file_read(), T_IO_Context::Palette, PIXEL_SIMPLE, Pre_load(), Read_bytes(), Set_loading_layer(), Set_pixel(), and T_IO_Context::Transparent_color.
void Save_MSX | ( | T_IO_Context * | context | ) |
Save MSX .SC2 file.
Uses the BSAVE/BLOAD file format. equivalent to BSAVE "FILE.SC2",&H0,&H37FF,S
The MSX pictures are 256x192 pixels with a 15 colors fixed palette. Color #0 is transparent.
References File_error, Get_pixel(), GFX2_Log(), GFX2_WARNING, NULL, Open_file_write(), Write_byte(), Write_bytes(), and Write_word_le().
void Test_2GS | ( | T_IO_Context * | context, |
FILE * | file | ||
) |
Test for an Apple 2 GS picture file.
References File_error, File_length_file(), Read_bytes(), and Read_dword_le().
void Load_2GS | ( | T_IO_Context * | context | ) |
References T_Config::Clear_palette, T_IO_Context::Comment, COMMENT_SIZE, Config, File_error, File_length_file(), FORMAT_2GS, GFX2_DEBUG, GFX2_Log(), GFX2_LogHexDump(), GFX2_malloc, GFX2_WARNING, Load_2GS_Palette(), mode, NULL, Open_file_read(), T_IO_Context::Palette, PIXEL_SIMPLE, PIXEL_TALL, Pre_load(), Read_byte(), Read_bytes(), Read_dword_le(), Read_word_le(), and WRITE2GS_PIXELS.
void Save_2GS | ( | T_IO_Context * | context | ) |
References line_data::color_count, File_error, Get_pixel(), GFX2_DEBUG, GFX2_Log(), GFX2_malloc, T_IO_Context::Height, NULL, Open_file_write(), PackBytes_pack_add(), PackBytes_pack_flush(), PackBytes_pack_init(), T_IO_Context::Palette, line_data::palette_index, Save_2GS_Palette_Entry(), line_data::used_colors, T_IO_Context::Width, Write_byte(), Write_bytes(), Write_dword_le(), and Write_word_le().