QuakeForge  0.7.2.210-815cf
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
pcx.c File Reference

Functions

pcx_tEncodePCX (byte *data, int width, int height, int rowbytes, byte *palette, qboolean flip, int *length)
 Convert paletted image data to PCX format. More...
 
tex_tLoadPCX (QFile *f, qboolean convert, byte *pal)
 Load a texture from a PCX file. More...
 

Function Documentation

pcx_t* EncodePCX ( byte data,
int  width,
int  height,
int  rowbytes,
byte palette,
qboolean  flip,
int length 
)

Convert paletted image data to PCX format.

Parameters
dataA pointer to the buffer containing the source image
widthThe width, in pixels, of the source image
heightThe height, in pixels, of the source image
rowbytesThe number of bytes in a row of an image (usually the same as the width)
paletteThe palette in use for the texture.
flipIf true, flip the order of lines output.
[out]lengthThe length of the encoded PCX data.
Returns
A pointer to the newly-coded PCX data.
Warning
Uses Hunk_TempAlloc() to allocate the output PCX content.
tex_t* LoadPCX ( QFile f,
qboolean  convert,
byte pal 
)

Load a texture from a PCX file.

Parameters
fThe file to read the texture from
convertIf true, the texture is converted to RGB on load
palThe palette to apply during conversion
Returns
A pointer to the texture.
Warning
Uses Hunk_TempAlloc() to allocate the texture.