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

This function returns the bit depth of the channel specified by the Index parameter.

Declaration:

 
Copy Code
AT_INT ACCUAPI IG_DIB_channel_depth_get(
        HIGDIBINFO hDIB, 
        AT_INT Index
);

Arguments:

Name Type Description
hDIB HIGDIBINFO DIB info handle.
Index AT_INT Index of channel of which to return bit depth.

Return Value:

Returns specified channel's bit depth.

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 depth;           /* Returned depth of first channel */
nErrcount = IG_image_DIB_info_get(hImage, &hDIBInfo);
depth = IG_DIB_channel_depth_get(hDIBInfo, 0);

Remarks:

For example, if you had a typical 24-bit RGB image with three 8-bit channels, you could specify 0, 1, or 2 for the index and the return value would be 8.