Parent Topic: Graphics
/* -------------------------------------------------------------------- */
/* preferred format for pixmap packing */
/* -------------------------------------------------------------------- */
typedef struct
{
int nBytesPerPixel; /* total bytes per pixel */
int nDepth; /* usable bits per pixel */
int nScanlinePad; /* scanline quantum in bytes */
int nRedShift; /* bit shifting amount */
int nGreenShift;
int nBlueShift;
uchar abyRedComp[256]; /* color compression tables */
uchar abyGreenComp[256];
uchar abyBlueComp[256];
uchar abyGreyComp[256];
uchar abyMap8Index[256]; /* map to color table */
TBool bTopToBottom; /* vertical orientation */
TBool bUseCompress; /* use compression tables *
uchar* paby8to24;
} SGLPreferPixmap;
Note that bUseCompress TRUE with nBytesPerPixel values of 24 or 32 indicates that a DirectColor (in X Parlance) image is being composed. After composing the 32 bit value the abyRedComp[], abyGreenComp[] and abyBlueComp[] values ``luts'' should be applied, but the result placed back in the original location rather than being composed into an eight bit (PseudoColor) value.
The first 256 bytes are the red component values for each pseudocolor table entry. The next 256 bytes for blue and the last 256 byte for green. For example, to find out the RGB values for 56th color map entry (where the entries are numbered from 0 to 255), it would be red = paby8To24[55], green = paby8to24[55 + 256], and blue = paby8to24[55 + 512];The PackPreferPixmap() method on the SGLImage class should be used as the reference implementation of how to pack an image based on the SGLPreferPixmap information.
See Also: GetPreferPixmap(), PackPreferPixmap(), SGLImage Source, DrawImage()