ImageGear for C and C++ on Windows v20.1 - Updated
IG_colorspace_conversion_apply_to_image
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Color Space Conversion Functions > IG_colorspace_conversion_apply_to_image

This function applies conversion to the entire image.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_colorspace_conversion_apply_to_image(
        HIGCSCONVERTER hCSConverter,
        HIGEAR hIGear
);

Arguments:

Name Type Description
hCSConverter HIGCSCONVERTER Handle of color space converter.
hIGear HIGEAR HIGEAR handle of image to which to apply conversion.

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:

None

Example:

 
Copy Code
/* Use the color space converter to convert an image 
   to 24-bit RGB, no alpha or extra channels */
AT_ERRCOUNT nErrcount;  /* Number of errors on stack */
HIGCSCONVERTER hCSConv; /* Color space converter handle */
HIGEAR hImage;          /* HIGEAR handle of image */
AT_INT depths[] = { 8, 8, 8 }; /* Result channel depths */
nErrcount = IG_colorspace_conversion_create_from_image(
    hImage, IG_COLOR_SPACE_ID_RGB, depths, 3, NULL, &hCSConv);
nErrcount = IG_colorspace_conversion_apply_to_image(
    hCSConv, hImage);
nErrcount = IG_colorspace_conversion_destroy(hCSConv);

Remarks:

Using this routine is similar to using IG_image_colorspace_convert() function, but using the color space conversion engine allows you to manage the bit depths of the result channels.

Is this page helpful?
Yes No
Thanks for your feedback.