|Date:||December 1, 2004 / year-entry #407|
|Summary:||Many bitmap-related structures in Windows have a field called "planes". For example the BITMAPINFOHEADER structure has a biPlanes member (which must be set to 1). The BITMAP structure has a field called bmPlanes. What's the deal with that field? The EGA video adapter supported 16 simultaneous colors. This was an enormous improvement over the CGA,...|
Many bitmap-related structures in Windows have a field called "planes". For example the
The EGA video adapter supported 16 simultaneous colors. This was an enormous improvement over the CGA, which supported only four colors. If you have 16 colors, then you need four bits per pixel. You would think that the encoding would be to have the each byte of video memory encode two pixels, one in the bottom four bits and one in the top four. But for technical reasons, the structure of video memory was not that simple.
Instead of putting the bits for a single pixel next to each other, the color channels were each split into their own monochrome bitmap. In other words, the pixels were sliced "the other way":
Suppose you wanted to display eight pixels, with colors
In the default 16-color palette, the colors were assigned so that bit 0 was the blue channel, bit 1 was the green channel, bit 2 was the red channel, and bit 3 was the intensity channel. With this interpretation, the four slices can be interpreted as the "intensity plane", the "red plane", the "green plane" and the "blue plane". For the last three planes, you can imagine that each one represents what you would see if only the corresponding electron gun were firing.
Since this was the native color format for EGA, there needed to be a way to express this color format in the
Thus was born the planar color format. For 16-color planar bitmaps, the number of planes is four and the number of bits per pixel is one.
<-- Back to Old New Thing Archive Index