2.1.1.3 BitCount Enumeration
The BitCount Enumeration specifies the number of bits that define each pixel and the maximum number of colors in a device-independent bitmap (DIB).
typedef enum
{
BI_BITCOUNT_0 = 0x0000,
BI_BITCOUNT_1 = 0x0001,
BI_BITCOUNT_2 = 0x0004,
BI_BITCOUNT_3 = 0x0008,
BI_BITCOUNT_4 = 0x0010,
BI_BITCOUNT_5 = 0x0018,
BI_BITCOUNT_6 = 0x0020
} BitCount;
-
BI_BITCOUNT_0: The number of bits per pixel is undefined.
The image SHOULD be in either JPEG or PNG format. <6> Neither of these formats includes a color table, so this value specifies that no color table is present. See [JFIF] and [RFC2083] for more information concerning JPEG and PNG compression formats.
-
BI_BITCOUNT_1: The image is specified with two colors.
Each pixel in the bitmap is represented by a single bit. If the bit is clear, the pixel is displayed with the color of the first entry in the color table; if the bit is set, the pixel has the color of the second entry in the table.
-
BI_BITCOUNT_2: The image is specified with a maximum of 16 colors.
Each pixel in the bitmap is represented by a 4-bit index into the color table, and each byte contains 2 pixels.
-
BI_BITCOUNT_3: The image is specified with a maximum of 256 colors.
Each pixel in the bitmap is represented by an 8-bit index into the color table, and each byte contains 1 pixel.
-
BI_BITCOUNT_4: The image is specified with a maximum of 2^16 colors.
Each pixel in the bitmap is represented by a 16-bit value.
If the Compression field of the BitmapInfoHeader Object is BI_RGB, the Colors field of DIB is NULL. Each WORD in the bitmap array represents a single pixel. The relative intensities of red, green, and blue are represented with 5 bits for each color component. The value for blue is in the least significant 5 bits, followed by 5 bits each for green and red. The most significant bit is not used. The color table is used for optimizing colors on palette-based devices, and contains the number of entries specified by the ColorUsed field of the BitmapInfoHeader Object.
If the Compression field of the BitmapInfoHeader Object is BI_BITFIELDS, the Colors field contains three DWORD color masks that specify the red, green, and blue components, respectively, of each pixel. Each WORD in the bitmap array represents a single pixel.
When the Compression field is set to BI_BITFIELDS, bits set in each DWORD mask MUST be contiguous and SHOULD NOT overlap the bits of another mask.
BI_RGB and BI_BITFIELDS are defined in Compression Enumeration, section 2.1.1.7.
-
BI_BITCOUNT_5: The bitmap has a maximum of 2^24 colors, and the Colors field of DIB is NULL. Each 3-byte triplet in the bitmap array represents the relative intensities of blue, green, and red, respectively, for a pixel. The Colors color table is used for optimizing colors used on palette-based devices, and MUST contain the number of entries specified by the ColorUsed field of the BitmapInfoHeader Object.
-
BI_BITCOUNT_6: The bitmap has a maximum of 2^24 colors.
If the Compression field of the BitmapInfoHeader Object is set to BI_RGB, the Colors field of DIB is set to NULL. Each DWORD in the bitmap array represents the relative intensities of blue, green, and red, respectively, for a pixel. The high byte in each DWORD is not used. The Colors color table is used for optimizing colors used on palette-based devices, and MUST contain the number of entries specified by the ColorUsed field of the BitmapInfoHeader Object.
If the Compression field of the BitmapInfoHeader Object is set to BI_BITFIELDS, the Colors field contains three DWORD color masks that specify the red, green, and blue components, respectively, of each pixel. Each DWORD in the bitmap array represents a single pixel.
When the Compression field is set to BI_BITFIELDS, bits set in each DWORD mask must be contiguous and should not overlap the bits of another mask. All the bits in the pixel do not need to be used.
BI_RGB and BI_BITFIELDS are specified in Compression Enumeration, section 2.1.1.7.
A DIB is specified by a DeviceIndependentBitmap Object (section 2.2.2.9), and its header is a BitmapInfoHeader Object (section 2.2.2.3).