Specifications

Image Creation and Access
4-45
4
Working in the Windows DIB Environment
The Image Processing Library provides functions to convert images to and
from the Windows* device-independent bitmap (DIB). Table 4-2 shows
that the IplImage format can represent more features than the DIB image
format. However, the DIB palette images and 8-bit- and 16-bit-per-pixel
absolute color DIB images have no equivalent in the Image Processing
Library.
The DIB palette images must be first converted to the Image Processing
Library’s absolute color images; 8-bit- and 16-bit-per-pixel DIB images
have to be unpacked into the library’s 8-bit-, 16-bit- or 32-bit-per-channel
images.
Any 24-bit absolute color DIB image can be directly converted to the
Image Processing Library format. You just need to create an
IplImage
header corresponding to the DIB attributes. The DIB image data can be
pointed to by the header or it can be duplicated.
There are the following restrictions for the DIB conversion functions:
You can use
IplImage structures with unsigned data only.
The DIB and IPL images should be the same size. The following
functions can perform conversion to and from the DIB format, with
additional useful capabilities:
iplTranslateDIB() Performs a simple translation of a DIB image to
an
IplImage as described above. Also converts a
DIB palette image to the Image Processing
Library’s absolute color image.
While this is the most efficient way of converting
a DIB image, it is not the most efficient format
for the library functions to manipulate because
the DIB image data is doubleword-aligned, not
quadword-aligned.