## Display Device Driver Reference for OS/2

[prev][next][parent][TOC]

### XGA Support for Palette Management - Terminology

The following sections address the XGA implementation of Palette Management .

Palette Manager for XGA is only implemented for systems supporting eight bits per pel (256 colors). At four bits per pel (16 colors), there are insufficient colors to make a Palette Management implementation worthwhile. At 16 bits per pel (64K colors), there are sufficient colors available to an application without requiring Palette Management.

To clarify the following discussion, it is necessary to define exactly what is meant by the following terms: Hardware Palette, Physical Index, Logical Palette, Logical Index, and Default Palette.

Hardware Palette: the array of RGBs that the physical device is displaying . It is the exact RGB values that the hardware's digital-to-analog converter uses when displaying each pel on the screen.

Physical Index: a value stored in memory (either video memory (VRAM) or system memory) which represents a single pel. A physical index stored in VRAM is an index into the Hardware Palette. The color information for each pel on the display screen is referenced by a physical index. By using this index into the hardware palette, a driver obtains the exact RGB value for the pel. A physical index stored in a system memory bit map is an index into whatever color information is associated with the bit map. This color information is defined by a Logical or a Default Palette.

Logical Palette: an array of RGB and mapping index pairs created by the device driver when defining a palette (as a result of a GpiCreatePalette call). For each RGB in the Logical Palette, when the RGB is drawn to a direct DC, the corresponding mapping index is the Physical Index for the color (or nearest color) in the Hardware Palette. These indexes are generated when the Logical Palette is realized and are known collectively as the palette mapping. Note that a logical palette is not the same as a Logical Color Table.

Logical Index: an index into a Logical Palette. It is logical indexes that an application uses to address the colors within a Logical Palette that it has created.

Default Palette: an array of RGBs that specify the colors available for use by LCTs and LCT-based applications.