High Color Virtual Buffers

In high color virtual buffers, each pixel occupies two bytes of memory, making it possible to use 64K different colors simultaneously. The data stored in these two bytes directly determine the pixel color instead of serving as an index into a logical palette. High color virtual buffers are often designated 16bpp (16 bits per pixel).

The two bytes (16 bits) representing each pixel contain a red, green, and blue color component, encoded like this:

Bits 0-4

5-bit blue component

Bits 5-10

6-bit green component

Bits 11-15

5-bit red component

This means the red and blue components are between 0 and 31, while green components are between 0 and 63. In each case, increasing values produce more intense colors. An extra green bit is provided because the human eye is more sensitive to changes in the green spectrum. This encoding scheme is often called 5/6/5 encoding. Note that high color virtual buffers actually have fewer distinct colors than 256-color virtual buffers (which allow 256K colors), but of course high color virtual buffers let you use any or all of these colors at once, instead of just a 256-color subset.

We should mention that some DirectX implementations use a 5/5/5 encoding scheme for high color pixels. With 5/5/5 encoding, the two bytes representing each pixel contain three five-bit color components plus an unused bit, encoded like this:

Bits 0-4

5-bit blue component

Bits 5-9

5-bit green component

Bits 10-14

5-bit red component

Bit 15

unused

<< Prev

Next >>

Contents
Fastgraph Home Page

 

copyright 2001 Ted Gruber Software, Inc.