Getting a Pointer to the DIB (the old way)
ImageGear versions prior to 14.5 used the standard Windows DIB format for internal storage of images. This format is made up of three components which are stored sequentially:
- Header. This is a BITMAPINFOHEADER / AT_DIB struct containing the following information about a DIB:
|
Copy Code
|
struct tagAT_DIB
{
AT_DWORD biSize;
AT_INT32 biWidth;
AT_INT32 biHeight;
AT_WORD biPlanes;
AT_WORD biBitCount;
AT_DWORD biCompression;
AT_DWORD biSizeImage;
AT_INT32 biXPelsPerMeter;
AT_INT32 biYPelsPerMeter;
AT_DWORD biClrUsed;
AT_DWORD biClrImportant;
};
typedef struct tagAT_DIB AT_DIB;
typedef struct tagAT_DIB FAR *LPAT_DIB;
|
The removed function IG_image_DIB_ptr_get retrieved a pointer to this struct.
- Palette. This is an array of RGBQUAD entries containing the colors that correspond to pixel values in an indexed image. The number of entries in this array is determined by the bit depth of the image (biBitCount). A palette is only stored for indexed images.
The function IG_image_DIB_palette_pntr_get retrieves a pointer to this array. This function still exists in ImageGear 14.5, but the DIB header and pixel data no longer surround the palette in memory.
- Pixel data. This is the pixel data that actually makes up the image. The image rows are stored bottom-up and each row is DWORD-aligned. In the case of a 24-bit RGB image, the pixels are stored in BGR channel order.
NOTE: The removed function IG_image_DIB_bitmap_pntr_get retrieved a pointer to this data. However, you can use
IG_image_DIB_raster_pntr_get to get a pointer to pixel data for a given raster. And, since rasters are stored sequentially in memory, you can get a pointer to the first raster (raster 0) and use it to access the entire image.