www.FOURCC.org - Video Codecs and Pixel Formats

BI_BITFIELDS rgb pixel format

ADVERTISEMENTS

To allow for arbitrarily packed RGB samples, BI_BITFIELDS specifies a mask field for each of the red, green and blue pixel components. These masks indicate the bit positions occupied by each colour component in a pixel. In general, the masks are passed to a driver or video API using means other than a basic BITMAPINFOHEADER (such as using the appropriate fields in a DirectDraw DDPIXELFORMAT structure) but I have heard that it is valid to append the masks to the end of the BITMAPINFOHEADER in much the same way that a palette is appended for palettised formats.

For example, 16 bit RGB 5:6:5 can be described using BI_BITFIELDS and the following bitmasks:

Red 0xF800 (5 bits of red)
Green 0x07E0 (6 bits of green)
Blue 0x001F (5 bits of blue)

In this case, if used with a BITMAPINFOHEADER, the bitmasks are u_int16s (16 bit) since the biBitFields field is set to 16. For a 32bpp version, the bitmasks are each u_int32s.

www.fourcc.org ©2011 Silicon.dk ApS