API Reference Guide > Core Component API Reference > Core Component Functions Reference > DIB Functions > IG_DIB_channel_count_get |
This function returns the number of channels in the image.
Copy Code
|
|
---|---|
AT_INT ACCUAPI IG_DIB_channel_count_get( HIGDIBINFO hDIB ); |
Name | Type | Description |
---|---|---|
hDIB | HIGDIBINFO | DIB info handle. |
Returns the number of channels in the image.
All pixel formats supported by ImageGear for C and C++.
None
Copy Code
|
|
---|---|
AT_ERRCOUNT nErrcount; /* Number of errors on stack */ HIGDIBINFO hDIBInfo; /* DIB info handle */ HIGEAR hImage; /* HIGEAR handle of image */ AT_INT nChannels; /* Returned number of channels */ nErrcount = IG_image_DIB_info_get(hImage, &hDIBInfo); nChannels = IG_DIB_channel_count_get(hDIBInfo); |
For example, a typical 24-bit RGB image has three 8-bit channels (red, green, blue) so this function will return 3. For a 24-bit RGB image with a single alpha channel, this function would return 4.