ImageGear for C and C++ on Linux v20.0 - Updated
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Pixel Functions > IG_pixel_bits_per_channel_get

This function returns the number of bits (8, 16, or 32) allocated for storing pixel data for a single channel in the given pixel object.


Copy Code
AT_DEPTH ACCUAPI IG_pixel_bits_per_channel_get(HIGPIXEL hPixel);


Name Type Description
hPixel HIGPIXEL Handle of pixel object.

Return Value:

Return value is the same for all channels and represents the maximal bit depth aligned to all bytes.

Supported Raster Image Formats:

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


Copy Code
AT_ERRCOUNT nErrcount;  /* Number of errors on stack */
HIGEAR hImage;          /* Handle of image */
HIGPIXEL hPix;          /* Handle of pixel */
AT_DEPTH bitsPerChan;   /* Number of bits per channel */
nErrcount = IG_load_file("test.jpg", &hImage);
nErrcount = IG_DIB_pix_get(hImage, 0, 0, &hPix);
bitsPerChan = IG_pixel_bits_per_channel_get(hPix);
Is this page helpful?
Yes No
Thanks for your feedback.