KallistiOS git master
Independent SDK for the Sega Dreamcast
|
Small PCX Loader. More...
Go to the source code of this file.
Functions | |
int | pcx_load_flat (const char *fn, int *w_out, int *h_out, void *pic_out) |
Load a PCX file into a buffer as flat 15-bit BGR data. | |
int | pcx_load_palette (const char *fn, int *w_out, int *h_out, void *pic_out, void *pal_out) |
Load a PCX file into a buffer as paletted data. | |
Small PCX Loader.
This module provides a few functions used for loading PCX files. These functions were mainly for use on the GBA port of KallistiOS (which has been removed from the tree), although they can be used pretty much anywhere. That said, libpcx is generally more useful than these functions for use on the Dreamcast.
int pcx_load_flat | ( | const char * | fn, |
int * | w_out, | ||
int * | h_out, | ||
void * | pic_out ) |
Load a PCX file into a buffer as flat 15-bit BGR data.
This function loads the specified PCX file into the buffer provided, decoding the image to 15-bit BGR pixels. The width and height of the buffer should match that of the image itself.
fn | The file to load. |
w_out | Buffer to return the width of the image in. |
h_out | Buffer to return the height of the image in. |
pic_out | Buffer to store image data in. |
int pcx_load_palette | ( | const char * | fn, |
int * | w_out, | ||
int * | h_out, | ||
void * | pic_out, | ||
void * | pal_out ) |
Load a PCX file into a buffer as paletted data.
This function is similar to the pcx_load_flat() function, but instead of decoding the image into a flat buffer, it decodes the image into a paletted format. The image itself will be 8-bit paletted pixels, and the palette is in a 15-bit BGR format. The width and height of the buffer should match that of the image itself.
fn | The file to load. |
w_out | Buffer to return the width of the image in. |
h_out | Buffer to return the height of the image in. |
pic_out | Buffer to store image data in. This should be width * height bytes in size. |
pal_out | Buffer to store the palette data in. This should be allocated to hold 256 uint16_t values. |