ImageGear for C and C++ on Windows v21.0 - Updated
API Reference Guide / Core Component API Reference / Core Component Functions Reference / Image DIB Functions / IG_image_DIB_raster_pntr_get
In This Topic
    IG_image_DIB_raster_pntr_get
    In This Topic

    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:

    Name Type Description
    hIGear HIGEAR HIGEAR handle of image.
    row AT_PIXPOS Row in image for which to retrieve raster pointer.
    lplpRaster AT_VOID** 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 for C and C++.

    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 on 32-bit platforms (QWORD-padded on 64-bit platforms), 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:

    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.