Home |
Windowing Interface Terminology Palettes and Colors |
Palettes and ColorsWhen running with a video configuration of 16 colors or less, RTPEG-32 always defines a fixed system palette that is programmed into the video controller palette registers. PegImageConvert supports advanced dithering techniques allowing you to make the best possible use of the limited number of colors when displaying high color images. For 256 color systems, RTPEG-32 operates with a pre-defined fixed palette, or you may optionally generate and use a custom palette. The default system palette is defined such that the first 16 colors in this palette are identical to the fixed 16-color palette of VGA systems. The next 216 entries in the system palette are equally spaced color values covering the spectrum of RGB values from black (0, 0, 0) to white (256, 256, 256). The remaining 24 palette entries are reserved for future use. For systems with more than 256 colors, direct color mapping is used. The color values used by an application are written directly into the video memory. The actual color to appear on the screen depends on how a pixel value is mapped to RGB values. For example, 16-bit color systems frequently use a 5:6:5 mapping (the upper 5 bits are red, the next 6 bits are green, and the low bits are blue). 24-bit and 32-bit color both use the 8:8:8 true color mapping. 32-bit color modes usually do not use the upper 8 bits of a pixel (0:8:8:8 color mapping). Include file Peg.hpp defines a few predefined color values which will produce the same colors on any system with 16 or more colors:
|