ImageGear for C and C++ on Linux v18.10 - Updated
IG_DIB_info_create
API Reference Guide > Core Component API Reference > Core Component Functions Reference > DIB Functions > IG_DIB_info_create

This function creates a new DIB info object and initializes it to the given values.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_DIB_info_create(
        HIGDIBINFO* lphDIB, 
        AT_DIMENSION width, 
        AT_DIMENSION height, 
        enumIGColorSpaceIDs colorspace,
        AT_INT channelCount, 
        AT_INT* channelDepths
);

Arguments:

Name Type Description
lphDIB HIGDIBINFO* Pointer to where created DIB info's handle will be stored.
width AT_DIMENSION Width of image in pixels.
height AT_DIMENSION Height of image in pixels.
colorspace enumIGColorSpaceIDs Color space of image.
channelCount AT_INT Number of channels in image.
channelDepths AT_INT* Array of channel depths.

Return Value:

Returns the number of ImageGear errors that occurred during this function call. If there are no errors, the return value is IGE_SUCCESS.

Supported Raster Image Formats:

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

Example:

 
Copy Code
/* Create a DIB info object describing a 48-bit RGB image */
AT_ERRCOUNT nErrcount;   /* Number of errors on stack */
HIGDIBINFO hDIBInfo;             /* DIB info handle */
AT_INT depths[3] = {16, 16, 16}; /* Array of channel depths */
nErrcount = IG_DIB_info_create(&hDIBInfo, 320, 240, IG_COLOR_SPACE_ID_RGB, 3, depths);
/* ... */
nErrcount = IG_DIB_info_delete(hDIBInfo);

Remarks:

The DIB info object must be deleted with IG_DIB_info_delete when it is finished being used.

This function does not allocate pixel data storage.