ImageGear for C and C++ on Windows v19.10 - Updated
IG_colorspace_conversion_create_from_matrix
API Reference Guide > Core Component API Reference > Core Component Functions Reference > Color Space Conversion Functions > IG_colorspace_conversion_create_from_matrix

Converts image to new color space using a conversion matrix.

Declaration:

 
Copy Code
AT_ERRCOUNT ACCUAPI IG_colorspace_conversion_create_from_matrix(
        enumIGColorSpaceIDs sourceSpace,
        const AT_INT* sourceChannelDepths,
        AT_INT sourceChannelCount,
        enumIGColorSpaceIDs resultSpace,
        const AT_INT* resultChannelDepths,
        AT_INT resultChannelCount,
        HIGDoubleMatrix conversionMatrix,       
        LPCAT_COLORSPACE_CONVERSION_OPTIONS options,
        HIGCSCONVERTER* hCSConverter
);

Arguments:

Name Type Description
sourceSpace enumIGColorSpaceIDs Source color space.
sourceChannelDepths const AT_INT* Array of channel depths for source color space.
sourceChannelCount AT_INT Number of channels in source color space.
resultSpace enumIGColorSpaceIDs Color space to which to convert.
resultChannelDepths const AT_INT* Array of channel depths in resulting color space.
resultChannelCount AT_INT Number of channels in resulting color space.
conversionMatrix AT_INT Conversion matrix.
options LPCAT_COLORSPACE_CONVERSION_OPTIONS Reserved for future use.
hCSConverter HIGCSCONVERTER* Returns the handle of color space converter.

Return Value:

Returns the number of ImageGear errors that occurred during this function call.

Supported Raster Image Formats:

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

Remarks:

Destination pixels are calculated as Dst = M * Src, where M is conversion matrix. Number of channels after conversion will be equal to first dimension of the conversionMatrix. Second dimension of conversionMatrix should be equal to number of channels in the source image.