ImageGear for C and C++ on Linux v18.8 - Updated
LPFNIG_RASTER_SET
API Reference Guide > Core Component API Reference > Core Component Callback Functions Reference > LPFNIG_RASTER_SET

This function is called by ImageGear to provide to your application each raster as it is obtained from the file.

Declaration:

 
Copy Code
typedef AT_ERRCOUNT (ACCUAPI LPFNIG_RASTER_SET) (
        LPVOID lpPrivate, 
        const LPAT_PIXEL lpRast, 
        AT_PIXPOS cyPos, 
        DWORD cRasterSize 
);

Arguments:

Name Type Description
lpPrivate LPVOID Far pointer to private data area.
lpRast const LPAT_PIXEL Far pointer to first byte of raster that ImageGear is providing on this call.
cyPos AT_PIXPOS The raster's Y position in the image (0 = top line of image).
dwRasterSize DWORD Number of bytes in the raster.

Return Value:

Return an error count.

Supported Raster Image Formats:

All pixel formats supported by ImageGear for C and C++.

Example:

 
Copy Code
AT_ERRCOUNT ACCUAPI MyRasterSet (LPVOID lpPrivate, LPAT_PIXEL lpRast, AT_PIXPOS lYpos,
DWORD dwBytes )
{
/* Can use the above information to create a raster or rasters in image bitmap of DIB that
was created by LPFNIG_DIB_CREATE callback.     */
 ...
return IG_error_check();
}

Remarks:

This is one of the two types of callback function supplied in calls to IG_load_FD_CB() or IG_load_mem_CB() functions. The line's position in the image is identified by cyPos. The lines may not be in order.

lpRast is a pointer to the start of the raster, and dwRasterSize is the number of bytes in the line. You should not attempt to change the data at lpRast. In general, your application will use this data (along with its knowledge of the width of the image it is creating, any compression scheme, etc.) to create the appropriate raster for the image bitmap of the DIB your application is creating.

See also callback type LPFNIG_DIB_CREATE.

You should check the ImageGear error count (AT_ERRCOUNT) after each raster is read. If you need to terminate the load, you can place an error on the stack yourself, using IG_error_set(). See the description for that function.