GrafX2 2.9.3227
The ultimate 256-color painting program
|
Saving and loading different picture formats. More...
#include <string.h>
#include <png.h>
#include <stdlib.h>
#include <endian.h>
#include "gfx2log.h"
#include "errors.h"
#include "global.h"
#include "loadsave.h"
#include "loadsavefuncs.h"
#include "struct.h"
#include "io.h"
#include "pages.h"
#include "windows.h"
#include "unicode.h"
#include "fileformats.h"
#include "oldies.h"
#include "bitcount.h"
Data Structures | |
struct | T_INFO_Header |
struct | T_INFO_ImageHeader |
struct | T_BMP_Header |
BMP file header. More... | |
struct | T_ICO_ImageEntry |
struct | T_PCX_Header |
struct | T_SCx_Header |
SCx header data. More... | |
Macros | |
#define | MIN(a, b) ((a)<(b)?(a):(b)) |
#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... | |
#define | XPM_USABLE_CHARS (0x7f - 0x20 - 2) |
Functions | |
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... | |
void | Test_IMG (T_IO_Context *context, FILE *file) |
void | Load_IMG (T_IO_Context *context) |
void | Save_IMG (T_IO_Context *context) |
static int | Read_INFO_Header (FILE *file, T_INFO_Header *header) |
static int | Read_INFO_ImageHeader (FILE *file, T_INFO_ImageHeader *header) |
void | Test_INFO (T_IO_Context *context, FILE *file) |
static char * | Read_INFO_String (FILE *file) |
static byte * | Decode_NewIcons (const byte *p, int bits, unsigned int *len) |
void | Load_INFO (T_IO_Context *context) |
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) |
void | Test_PCX (T_IO_Context *context, FILE *file) |
static void | Draw_PCX_line (T_IO_Context *context, const byte *buffer, short y_pos, byte depth) |
static void | Set_CGA_Color (int i, T_Components *comp) |
void | Load_PCX (T_IO_Context *context) |
void | Save_PCX (T_IO_Context *context) |
void | Test_SCx (T_IO_Context *context, FILE *file) |
Test if a file is SCx format. More... | |
void | Load_SCx (T_IO_Context *context) |
Read a SCx file. More... | |
void | Save_SCx (T_IO_Context *context) |
Save a SCx file. More... | |
void | Save_XPM (T_IO_Context *context) |
Variables | |
T_PCX_Header | PCX_header |
Saving and loading different picture formats.
#define MIN | ( | a, | |
b | |||
) | ((a)<(b)?(a):(b)) |
#define XPM_USABLE_CHARS (0x7f - 0x20 - 2) |
|
static |
References T_INFO_Header::Activation, T_INFO_Header::CurrentX, T_INFO_Header::CurrentY, T_INFO_Header::DefaultTool, T_INFO_Header::DrawerData, T_INFO_Header::Flags, T_INFO_Header::GadgetID, T_INFO_Header::GadgetRender, T_INFO_Header::GadgetText, T_INFO_Header::GadgetType, T_INFO_Header::Height, T_INFO_Header::LeftEdge, T_INFO_Header::Magic, T_INFO_Header::MutualExclude, T_INFO_Header::NextGadget, T_INFO_Header::padding, Read_byte(), Read_dword_be(), Read_word_be(), T_INFO_Header::SelectRender, T_INFO_Header::SpecialInfo, T_INFO_Header::StackSize, T_INFO_Header::ToolTypes, T_INFO_Header::ToolWindow, T_INFO_Header::TopEdge, T_INFO_Header::Type, T_INFO_Header::UserData, T_INFO_Header::Version, and T_INFO_Header::Width.
Referenced by Load_INFO(), and Test_INFO().
|
static |
References T_INFO_ImageHeader::Depth, T_INFO_ImageHeader::Height, T_INFO_ImageHeader::ImageData, T_INFO_ImageHeader::LeftEdge, T_INFO_ImageHeader::NextImage, T_INFO_ImageHeader::PlaneOnOff, T_INFO_ImageHeader::PlanePick, Read_byte(), Read_dword_be(), Read_word_be(), T_INFO_ImageHeader::TopEdge, and T_INFO_ImageHeader::Width.
Referenced by Load_INFO().
|
static |
References NULL, Read_bytes(), and Read_dword_be().
Referenced by Load_INFO().
References GFX2_Log(), GFX2_WARNING, and NULL.
Referenced by Load_INFO().
|
static |
References Set_pixel(), and T_IO_Context::Width.
Referenced by Load_PCX().
|
static |
References T_Components::B, T_Components::G, and T_Components::R.
Referenced by Load_PCX().
T_PCX_Header PCX_header |
Referenced by Load_PCX(), Save_PCX(), and Test_PCX().