| Herd Software Development
|=
DaVinci Graphics Library
|==
DaVinci Documentation Home Search Order


RGBA graphics

Overview

RGBA DIBs contain an additional component to the RGB values for each pixel: an alpha channel that defines the transparency of that pixel.

Alpha channels are used for generating graphic effects when overlaying two bitmaps. For example, the "shadow" of an image can be drawn semi-opaque or "dimmed" on the base image using alpha channel information in an RGBA DIB.

DIB data format

The base structure of an RGBA DIB is based on BITMAPV4HEADER.. To identify a DIB as being in RGBA-Format, the field bV4AlphaMask 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. A pixel must therefore use an RGBQUAD structure, with alpha channel information stored in the rgbReserved field.

An alpha value of 000 means complete transparency, an alpha value of 255 means complete opaqueness.

Import/export

DaVinci Professional can import TIFF files in RGBA format by setting the IPDIBF_ALLOW_IMPORT_RGBA flag in the dwDIBFlags member of the DAVPARAMS structure when calling ipImportInd. The resulting DIB will be in RGBA format.

DIBs in RGBA format can be stored either as BMP files or as RGBA format TIFFs. Alpha channel information is lost when saving to any other format.

See also

Þ The BITMAPV4HEADER structure

Þ The DIBAlphaBlend function

Þ CMYK DIBs