GrafX2 2.9.3227
The ultimate 256-color painting program
|
.BMP/.ICO/.CUR files from OS/2 or Windows More...
Data Structures | |
struct | T_BMP_Header |
BMP file header. More... | |
struct | T_ICO_ImageEntry |
Macros | |
#define | LOAD_BMP_PIXEL_FLAG_TOP_DOWN 0x01 |
rows are stored from the top to the bottom (standard for BMP is from bottom to the top) More... | |
#define | LOAD_BMP_PIXEL_FLAG_TRANSP_PLANE 0x02 |
We are decoding the AND-mask plane (transparency) of a .ICO file. More... | |
Functions | |
void | Test_BMP (T_IO_Context *context, FILE *file) |
Test for BMP format. More... | |
static byte | Bitmap_mask (dword pixel, dword mask, int bits, int shift) |
extract component value and properly shift it. More... | |
static void | Load_BMP_Palette (T_IO_Context *context, FILE *file, unsigned int nb_colors, int is_rgb24) |
Load the Palette for 1 to 8bpp BMP's. More... | |
static void | Load_BMP_Pixels (T_IO_Context *context, FILE *file, unsigned int compression, unsigned int nbbits, int flags, const dword *mask) |
void | Load_BMP (T_IO_Context *context) |
Load BMP file. More... | |
void | Save_BMP (T_IO_Context *context) |
Save BMP file. More... | |
void | Test_ICO (T_IO_Context *context, FILE *file) |
void | Load_ICO (T_IO_Context *context) |
void | Save_ICO (T_IO_Context *context) |
.BMP/.ICO/.CUR files from OS/2 or Windows
We support OS/2 files and windows BITMAPINFOHEADER, BITMAPV4HEADER, BITMAPV5HEADER files.
.ICO with PNG content are also supported
#define LOAD_BMP_PIXEL_FLAG_TOP_DOWN 0x01 |
rows are stored from the top to the bottom (standard for BMP is from bottom to the top)
#define LOAD_BMP_PIXEL_FLAG_TRANSP_PLANE 0x02 |
We are decoding the AND-mask plane (transparency) of a .ICO file.
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.
extract component value and properly shift it.
Referenced by Load_BMP_Pixels().
|
static |
Load the Palette for 1 to 8bpp BMP's.
References T_Config::Clear_palette, Config, File_error, MIN, T_IO_Context::Palette, and Read_bytes().
Referenced by Load_BMP(), and Load_ICO().
|
static |
References Bitmap_mask(), count_set_bits(), count_trailing_zeros(), File_error, flags, GFX2_Log(), GFX2_WARNING, T_IO_Context::Height, LOAD_BMP_PIXEL_FLAG_TOP_DOWN, LOAD_BMP_PIXEL_FLAG_TRANSP_PLANE, Load_PNG_Sub(), NULL, Read_byte(), Read_bytes(), Read_dword_le(), Read_word_le(), Set_pixel(), Set_pixel_24b(), T_IO_Context::Transparent_color, and T_IO_Context::Width.
Referenced by Load_BMP(), and Load_ICO().
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_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.