ImageGear for C and C++ on Linux v19.10 - Updated
IG_util_colorspace_alpha_count_get
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Utility Functions > IG_util_colorspace_alpha_count_get

This function returns the number of alpha channels (0 or 1) in the specified color space.

Declaration:

 
Copy Code
AT_UINT ACCUAPI IG_util_colorspace_alpha_count_get(
        enumIGColorSpaceIDs colorSpace
);

Arguments:

Name Type Description
colorSpace enumIGColorSpaceIDs Color space ID.

Return Value:

The number of alpha channels.

Supported Raster Image Formats:

This function does not process image pixels.

Example:

 
Copy Code
enumIGColorSpaceIDs colorSpace = IG_COLOR_SPACE_ID_RGBA;
AT_UINT nAlpha;         /* Number of alpha channels */
nAlpha = IG_util_colorspace_alpha_count_get(colorSpace);
/* nAlpha is 1 */