ImageGear for C and C++ on Windows v19.1 - Updated
IG_DIB_channel_depths_get
API Reference Guide > Core Component API Reference > Core Component Functions Reference > DIB Functions > IG_DIB_channel_depths_get

This function copies channel bit depths to an array.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_DIB_channel_depths_get(
        HIGDIBINFO hDIB, 
        AT_INT ChannelCount,
        AT_INT* lpChannelDepths
);

Arguments:

Name Type Description
hDIB HIGDIBINFO DIB info handle.
ChannelCount AT_INT Number of channels for which to return depths.
lpChannelDepths AT_INT* Array to which to copy 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++.

Sample:

None

Example:

 
Copy Code
AT_ERRCOUNT nErrcount;  /* Number of errors on stack */
HIGDIBINFO hDIBInfo;    /* DIB info handle */
HIGEAR hImage;          /* HIGEAR handle of image */
AT_INT nChannels;       /* Number of channels in image */
LPAT_INT depths;        /* Array of channel depths */
nErrcount = IG_image_DIB_info_get(hImage, &hDIBInfo);
nChannels = IG_DIB_channel_count_get(hDIBInfo);
depths = (LPAT_INT) malloc(nChannels * sizeof(AT_INT));
nErrcount = IG_DIB_channel_depths_get(hDIBInfo, nChannels, depths);

Remarks:

You can use this function to find out the bit depths of each individual channel.