GrafX2 2.9.3227
The ultimate 256-color painting program
|
#include <stdio.h>
#include <stdlib.h>
#include "../loadsave.h"
#include "../global.h"
#include "../gfx2log.h"
Functions | |
void | Pre_load (T_IO_Context *context, short width, short height, long file_size, int format, enum PIXEL_RATIO ratio, byte bpp) |
Generic allocation and similar stuff, done at beginning of image load, as soon as size is known. More... | |
byte | Get_pixel (T_IO_Context *context, short x, short y) |
Query the color of a pixel (to save) More... | |
void | Pixel_in_layer (int layer, word x, word y, byte color) |
put a pixel in a specific layer of Main Page More... | |
void | Set_pixel (T_IO_Context *context, short x, short y, byte c) |
Set the color of a pixel (on load) More... | |
void | Set_pixel_24b (T_IO_Context *context, short x, short y, byte r, byte g, byte b) |
Set the color of a 24bit pixel (on load) More... | |
void | Fill_canvas (T_IO_Context *context, byte color) |
Fill the entire current layer/frame of an image being loaded with a color. More... | |
void | Set_saving_layer (T_IO_Context *context, int layer) |
Function to call when need to switch layers. More... | |
void | Set_loading_layer (T_IO_Context *context, int layer) |
Function to call when need to switch layers. More... | |
void | Set_image_mode (T_IO_Context *context, enum IMAGE_MODES mode) |
Function to set a specific image mode. More... | |
enum IMAGE_MODES | Get_image_mode (T_IO_Context *context) |
get the current image mode More... | |
void | Set_frame_duration (T_IO_Context *context, int duration) |
Function to call when loading an image's duration. More... | |
int | Get_frame_duration (T_IO_Context *context) |
Function to call to get an image's duration for saving. More... | |
int | Get_palette_RGB_scale (void) |
void Pre_load | ( | T_IO_Context * | context, |
short | width, | ||
short | height, | ||
long | file_size, | ||
int | format, | ||
enum PIXEL_RATIO | ratio, | ||
byte | bpp | ||
) |
Generic allocation and similar stuff, done at beginning of image load, as soon as size is known.
References CONTEXT_SURFACE, File_error, format, Free_GFX2_Surface(), T_IO_Context::Height, New_GFX2_Surface(), NULL, T_IO_Context::Pitch, T_GFX2_Surface::pixels, T_IO_Context::Surface, T_IO_Context::Target_address, T_IO_Context::Type, T_GFX2_Surface::w, and T_IO_Context::Width.
byte Get_pixel | ( | T_IO_Context * | context, |
short | x, | ||
short | y | ||
) |
Query the color of a pixel (to save)
References T_IO_Context::Height, T_IO_Context::Pitch, T_IO_Context::Target_address, and T_IO_Context::Width.
put a pixel in a specific layer of Main Page
void Set_pixel | ( | T_IO_Context * | context, |
short | x, | ||
short | y, | ||
byte | c | ||
) |
Set the color of a pixel (on load)
References CONTEXT_SURFACE, File_error, GFX2_ERROR, GFX2_Log(), GFX2_WARNING, T_GFX2_Surface::h, NULL, Set_GFX2_Surface_pixel(), T_IO_Context::Surface, T_IO_Context::Type, and T_GFX2_Surface::w.
void Set_pixel_24b | ( | T_IO_Context * | context, |
short | x, | ||
short | y, | ||
byte | r, | ||
byte | g, | ||
byte | b | ||
) |
Set the color of a 24bit pixel (on load)
Set the color of a 24bit pixel (on load)
void Fill_canvas | ( | T_IO_Context * | context, |
byte | color | ||
) |
Fill the entire current layer/frame of an image being loaded with a color.
void Set_saving_layer | ( | T_IO_Context * | context, |
int | layer | ||
) |
Function to call when need to switch layers.
void Set_loading_layer | ( | T_IO_Context * | context, |
int | layer | ||
) |
Function to call when need to switch layers.
void Set_image_mode | ( | T_IO_Context * | context, |
enum IMAGE_MODES | mode | ||
) |
Function to set a specific image mode.
References mode.
enum IMAGE_MODES Get_image_mode | ( | T_IO_Context * | context | ) |
get the current image mode
void Set_frame_duration | ( | T_IO_Context * | context, |
int | duration | ||
) |
Function to call when loading an image's duration.
int Get_frame_duration | ( | T_IO_Context * | context | ) |
Function to call to get an image's duration for saving.
int Get_palette_RGB_scale | ( | void | ) |