This function returns the image's color space.
Copy Code
|
|
---|---|
enumIGColorSpaceIDs ACCUAPI IG_DIB_colorspace_get( HIGDIBINFO hDIB ); |
Name | Type | Description |
---|---|---|
hDIB | HIGDIBINFO | DIB info handle. |
Returns a combination of values from enumIGColorSpaceIDs.
All pixel formats supported by ImageGear for C and C++.
Copy Code
|
|
---|---|
AT_ERRCOUNT nErrcount; /* Number of errors on stack */ HIGDIBINFO hDIBInfo; /* DIB info handle */ HIGEAR hImage; /* HIGEAR handle of image */ enumIGColorSpaceIDs colorspace; /* Color space of image */ AT_BOOL bIndexed; /* Is color space of image indexed? */ AT_BOOL bHasAlpha; /* Does image have an alpha channel? */ /* Find out if an image is indexed, and if it has alpha */ nErrcount = IG_image_DIB_info_get(hImage, &hDIBInfo); colorspace = IG_DIB_colorspace_get(hDIBInfo); bIndexed = (colorspace & IG_COLOR_SPACE_ID_ColorMask) == IG_COLOR_SPACE_ID_I; bHasAlpha = colorspace & IG_COLOR_SPACE_ID_A; |
This is a bitmask that indicates the color space as well as the presence of alpha, pre-multiplied alpha, and extra channels.
See the IG_util_colorspace_...() functions for more functions that retrieve information about color spaces, alpha, and extra channels.