This function creates conversion engine based on the source and the result color space attributes.
Declaration:
Copy Code | |
---|---|
AT_ERRCOUNT ACCUAPI IG_colorspace_conversion_create( enumIGColorSpaceIDs sourceSpace, const AT_RGBQUAD* sourceSpaceAttribs, const AT_INT* sourceChannelDepths, AT_INT sourceChannelCount, enumIGColorSpaceIDs resultSpace, const AT_INT* resultChannelDepths, AT_INT resultChannelCount, LPCAT_COLORSPACE_CONVERSION_OPTIONS options, HIGCSCONVERTER* hCSConverter ); |
Arguments:
sourceSpace | Color space from which to convert. See enumIGColorSpaceIDs. |
sourceSpaceAttribs | Source color space attributes. |
sourceChannelDepths | Array of channel depths for source color space. |
sourceChannelCount | Number of channels in source color space. |
resultSpace | Color space to which to convert. See enumIGColorSpaceIDs. |
resultChannelDepths | Array of channel depths in resulting color space. |
resultChannelCount | Number of channels in resulting color space. |
options | Conversion options. |
hCSConverter | Handle of color space converter. |
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 Professional.
Sample:
None
Example:
Copy Code | |
---|---|
/* Use the color space converter to convert an image from CMYK 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 depthsCMYK[] = { 8, 8, 8, 8 }; /* CMYK channel depths */ AT_INT depthsRGB[] = { 8, 8, 8 }; /* RGB channel depths */ nErrcount = IG_colorspace_conversion_create( IG_COLOR_SPACE_ID_CMYK, NULL, depthsCMYK, 4, IG_COLOR_SPACE_ID_RGB, depthsRGB, 3, NULL, &hCSConv); nErrcount = IG_colorspace_conversion_apply_to_image( hCSConv, hImage); nErrcount = IG_colorspace_conversion_destroy(hCSConv); |
Remarks:
NULL is an acceptable value for resultChannelDepths. In this case the result channels will be constructed using IG_colorspace_conversion_result_channels_build() routine. Options controls the conversion flow. You may pass NULL for Options if you don't want to specify any options.
For the detailed information about AT_COLORSPACE_CONVERSION_OPTIONS structure and the whole color conversion process please refer to the section Working with Color Space Conversion Engine.