Herd Software Development
DaVinci Graphics Library
DaVinci Documentation
Microsoft's DIB data format underwent an update with Windows 4.0 and Windows 95. DIBs can now optionally use a BITMAPV4HEADER structure in place of a BITMAPINFOHEADER structure. The the new structure starts with the same fields as BITMAPINFOHEADER structure, and additional fields used by the new format follow these standard fields. All other structures (color palettes, bits) are located after this new, larger header. The biSize field ia used to specify whether a DIB is based on BITMAPINFOHEADER or BITMAPV4HEADER.
BiSize | Value | Compatibility |
Sizeof(BITMAPCOREHEADER) | 0x0c | DIB OS/2 1.3 compatible |
Sizeof(BITMAPINFOHEADER) | 0x28 | DIB Windows 3.1 compatible |
Sizeof(BITMAPV4HEADER) | 0x6c | Windows 95 / DIB NT 4.0 |
Sizeof(BITMAPV5HEADER) | Windows 98 / DIB NT 5.0 |
BITMAPINFOHEADER |
BITMAPV4HEADER |
typedef struct |
typedef struct |
The fields used by the BITMAPV4HEADER structure correspond to those of BITMAPINFOHEADER structure with the addition of a few supplementary fields as shown above.
DaVinci uses the BITMAPV4HEADER structure when it needs to work with DIBs in special formats which need to contain information which cannot be recorded in the BITMAPINFOHEADER structure:
The field bV4CSType, which takes the following (Color Space Type) values, can identify the DIB as CMYK, as follows:
Symbolic constant | Value | Meaning |
LCS_CALIBRATED_RGB | 0 | The DIB uses the normalized sRGB colour space defined by ICM |
LCS_DEVICE_RGB | 1 | The DIB uses the device dependent RGB colour space defined by a display device. This is the definition used by the older BITMAPINFOHEADER. |
LCS_DEVICE_CMYK | 2 | The DIB uses the device dependent CMYK colour space defined by a printer. |
Since the DIB is stored at 8 bits per CMYK component, bV4BitCount equivalent to biBitCount = 32.
To specify an RGBA DIB, the bV4AlphaMask field is set to a non-zero value. Since the DIB is stored with 8 bits per RGB and alpha component, bV4BitCount equivalent to biBitCount = 32.
RGBA DIBs are treated by Windows functions in the same way as other DIBs. The Alpha channel is being used by the DIBAlphaBlend function.
The BITMAPV4HEADER structure is defined for newer 32 bit compilers in the WINGDI.H header shipped with the compiler.
For 16-Bit Compilers this structure is not defined in WINDOWS.H, for that reason it was included into the header-file LEONARDO.H header shipped with DaVinci.