Setting Palettes

Video capture drivers can allow clients to specify a logical color palette and, optionally, an RGB555-format translation table. Two messages, DVM_PALETTE and DVM_PALETTERGB555, are defined.

The DVM_PALETTE message allows a client to specify a logical palette or to obtain the current palette from the driver. When a client specifies a logical palette, the driver typically creates a translation table by using the CreatePalette and GetNearestPaletteIndex functions described in the Win32 SDK, as illustrated in the sample video capture drivers. By sending a DVM_PALETTERGB555 message, a client can specify both a palette and an RGB555 translation table.

Drivers use the translation tables when converting frame buffer data into DIBs. (The palette location corresponding to an RGB color is found by using an RRRRRGGGGGBBBBB binary value as an index into the translation table, where the five most significant bits of each color component are used to create the index).

Drivers typically create a default palette when processing the DRV_OPEN message.

For more information about color palettes, see the Win32 SDK.