KallistiOS  ##version##
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Functions
pcx.h File Reference

Small PCX Loader. More...

#include <sys/cdefs.h>
#include <arch/types.h>

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. More...
 
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. More...
 

Detailed Description

Small PCX Loader.

This module provides a few functions used for loading PCX files. These funcions 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.

Author
Dan Potter

Function Documentation

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.

Parameters
fnThe file to load.
w_outBuffer to return the width of the image in.
h_outBuffer to return the height of the image in.
pic_outBuffer to store image data in.
Returns
0 on succes, < 0 on failure.
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.

Parameters
fnThe file to load.
w_outBuffer to return the width of the image in.
h_outBuffer to return the height of the image in.
pic_outBuffer to store image data in. This should be width * height bytes in size.
pal_outBuffer to store the palette data in. This should be allocated to hold 256 uint16_t values.
Returns
0 on succes, < 0 on failure.