Specifications

Image Creation and Access
4-47
4
TranslateDIB
Translates a DIB image
into the corresponding
IplImage
.
iplImage* iplTranslateDIB(BITMAPINFOHEADER*
dib
,
BOOL*
cloneData
);
dib
The DIB image.
cloneData
An output flag (Boolean): if false, indicates that
the image data pointer in the
IplImage will point
to the DIB image data; if true, indicates that the
data was copied.
Discussion
The function iplTranslateDIB() translates a DIB image to the
IplImage format; see Example 4-8. The IplImage attributes
corresponding to the DIB image are automatically chosen (see Table 4-2),
so no explicit control of the conversion is provided. A DIB palette image
will be converted to an absolute color
IplImage with a bit depth of 8 bits
per channel, and the image data will be copied, returning
cloneData
=true.
A 24-bit-per-pixel RGB DIB image will be converted to an 8-bit-per-
channel RGB
IplImage.
A 32-bit-per-pixel DIB RGBA image will be converted to an 8-bit-per-
channel RGBA
IplImage with an alpha channel.
An 8-bit-per-pixel or 16-bit-per-pixel DIB absolute color RGB image will
be converted (by unpacking) into an 8-bit-per-channel RGB
IplImage.
The image data will be copied, returning
cloneData
=true.
A 1-bit-per-pixel or 8-bit-per-pixel DIB gray scale image with a standard
gray palette will be converted to a 1-bit-per-channel or 8-bit-per-channel
gray-scale IplImage, respectively.