This function gets a pointer to the beginning of pixel data for a raster in the given image.
Declaration:
Copy Code | |
---|---|
AT_ERRCOUNT ACCUAPI IG_image_DIB_raster_pntr_get( HIGEAR hIGear, AT_PIXPOS row, AT_VOID ** lplpRaster ); |
Arguments:
hIGear | HIGEAR handle of image. |
row | Row in image for which to retrieve raster pointer. |
lplpRaster | Returned pointer to the 1st pixel in the raster. |
Return Value:
Returns 0 if successful. Otherwise, returns the number of ImageGear errors that occurred during this function call.Supported Raster Image Formats:
All pixel formats supported by ImageGear Professional.
Sample:
Filters
Example:
Copy Code | |
---|---|
AT_ERRCOUNT nErrcount; // Number of errors on stack HIGEAR hIGear; // Handle of image LPAT_VOID lpRst; // Pointer to a raster // Load image file "picture.bmp" from working directory nErrcount = IG_load_file("picture.bmp", &hIGear); if(nErrcount == 0) { nErrcount = IG_image_DIB_raster_pntr_get(hIGear, 0, &lpRst); // ... // Destroy the image IG_image_delete(hIGear); } |
Remarks:
Rasters are stored from top to bottom, are DWORD-padded, use 8, 16, or 32 bits to store channel values, and have alpha/extra channels included in-line with the color channels. For example, an RGB image with an alpha channel would be stored as: RGBA RGBA RGBA ...
If the image is 1bpp b/w, it is stored in a compressed run ends format. See IG_runs_row_get/IG_runs_row_set for a description of this format. It is recommended to use these functions to access run ends data, but you can use IG_image_DIB_raster_pntr_get() with the following restrictions:
- You can only read data. It is not safe to write data.
- You can only access the raster to which you've retrieved a pointer.
Note:
Although ImageGear currently stores uncompressed (non-run ends) rasters continously, we do not recommend that you rely on this, as the internal storage format may change in the future. Use IG_image_DIB_raster_pntr_get to access each raster separately. |