Microsoft DirectX 8.1 (C++)

CImagePalette Class

The CImagePalette class is a specialized class for image renderers that must create and manage palettes. It can be used to create palette handles from a media format containing a VIDEOINFO structure in the format block. To maximize performance, the class attempts to create a palette that is an identity palette (that is, one that exactly matches the current system palette), and compares palettes before updating to ensure that palettes are changed only when actually required.

Protected Data Members

m_hPalette Palette handle owned by this object.
m_pBaseWindow Window in which to realize the palette.
m_pDrawImage Object that will perform the drawing.
m_pMediaFilter Media filter to send events to.

Member Functions

CImagePalette Constructs a CImagePalette object.
CopyPalette Copies the palette out of any YUV or true-color VIDEOINFOHEADER structure into a palettized VIDEOINFOHEADER structure.
MakeIdentityPalette Ensures the palette entries will become an identity palette.
MakePalette Retrieves the color palette from the specified video image.
PreparePalette Specifies an entry point for updating and creating palettes.
RemovePalette Releases any palette resources allocated.
ShouldUpdate Specifies an internal helper member function for updating palettes dynamically.