ImageGear for C and C++ on Windows v19.1 - Updated
IG_image_bits_per_channel_get
API Reference Guide > Core Component API Reference > Core Component Functions Reference > General Image Functions > IG_image_bits_per_channel_get

This function gets the number of bits allocated for each pixel channel in an image: 8, 16, or 32.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_image_bits_per_channel_get(
        HIGEAR hIGear, 
        AT_INT* lpBitsPerChannel 
);

Arguments:

Name Type Description
hIGear HIGEAR HIGEAR handle of image.
lpBitsPerChannel AT_INT* Returned number of allocated bits for each pixel channel.

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:

Pixel Access

Example:

 
Copy Code
AT_ERRCOUNT nErrcount;  /* Number of errors on stack */
HIGEAR hImage;          /* Handle of image */
AT_INT nBits;           /* Number of bits per channel */
nErrcount = IG_image_bits_per_channel_get(hImage, &nBits);

Remarks:

This is not the same as the bit depth of a channel. The number of bits used for a pixel channel may be less than the number of bits allocated.