Game Development Reference
In-Depth Information
Figure 6.1 The improved rendering of a textured mesh.
data. All bitmap files have some kind of header that describes how the
pixel data are stored in the file, the bitmap width, height and colour depth
being the most important information. Colour depth describes how the
colour data are presented. A 'bmp' file comes in six formats: 1 bit per pixel,
so the bitmap contains simply a black and white picture; 4 bits per pixel,
so the bitmap can contain at most 16 colours; 8 bits per pixel, allowing 256
colours; 16 bits per pixel, sometimes called High Color; 24 bits per pixel,
allowing a choice of up to 16.7 million colours; and 32 bits per pixel, where
the extra 8 bits of information per pixel are used to store an alpha (mask)
in greyscale format. In this explanation we will look at loading a 24 bits per
pixel image.
Windows bitmaps come in two flavours, RGB and RLE. The latter type
uses a simple kind of compression, Run Length Encoding. Instead of
saving the colour for each pixel, the file saves the colour for the pixel and
how many consecutive pixels in a line use this colour. If you are using
bitmaps with large areas of flat colour then RLE files can be quite a lot
smaller than RGB files. For real-time 3D animation purposes RLE is not
Search Nedrilad ::

Custom Search