csgfx/packrgb.h File Reference
Helper routines to pack csRGBcolor/csRGBpixel into RGB/RGBA byte arrays. More...
#include "cstypes.h"
#include "rgbpixel.h"
Go to the source code of this file.
Pixel packing | |
When using csRGBcolor or csRGBpixel, don't assume that sizeof(csRGBcolor) == 3, sizeof(csRGBpixel) == 4 or that those struct are stored as a packed RGB/RGBA byte array.
If you need such packed RGB/RGBA data (e.g. for use with external libraries) use the functions here to convert from csRGBcolor/csRGBpixel to RGB/RGBA and vice versa. If no copy of the data is needed, they are free on platforms where sizeof(csRGBcolor) == 3, sizeof(csRGBpixel) == 4 are true. In any other case copying/packing the data is handled appropriately. | |
uint8 * | csPackRGBcolorToRGB (const csRGBcolor *pixels, int numPixels) |
Pack an array of csRGBcolor into a RGB byte array. | |
void | csDiscardPackedRGB (const uint8 *rgb) |
Frees memory possibly allocated by csPackRGBcolorToRGB(). | |
const csRGBcolor * | csUnpackRGBtoRGBcolor (const uint8 *rgb, int numPixels) |
Unpack a RGB byte array into an array of csRGBcolor. | |
void | csDiscardUnpackedRGBcolor (const csRGBcolor *pixels) |
Frees memory possibly allocated by csUnpackRGBtoRGBcolor(). | |
const uint8 * | csPackRGBpixelToRGBA (const csRGBpixel *pixels, int numPixels) |
Pack an array of csRGBpixel into a RGBA byte array. | |
void | csDiscardPackedRGBA (const uint8 *rgba) |
Frees memory possibly allocated by csPackRGBpixelToRGBA(). | |
const csRGBpixel * | csUnpackRGBAtoRGBpixel (const uint8 *rgba, int numPixels) |
Unpack a RGBA byte array into an array of csRGBpixel. | |
csRGBpixel * | csCopyUnpackRGBAtoRGBpixel (const uint8 *rgba, int numPixels) |
Unpack a RGBA byte array into an array of csRGBpixel. | |
void | csDiscardUnpackedRGBpixel (const csRGBpixel *pixels) |
Frees memory possibly allocated by csUnpackRGBAtoRGBpixel(). | |
uint8 * | csPackRGBpixelToRGB (const csRGBpixel *pixels, int numPixels) |
Pack an array of csRGBpixel into a RGB byte array. | |
csRGBcolor * | csUnpackRGBAtoRGBcolor (const uint8 *rgba, int numPixels) |
Unpack a RGBA byte array into an array of csRGBcolor. |
Detailed Description
Helper routines to pack csRGBcolor/csRGBpixel into RGB/RGBA byte arrays.
Definition in file packrgb.h.
Generated for Crystal Space by doxygen 1.2.18