CGColorConversionInfoCreateFromList
Creates a conversion between an arbitrary number of specified color spaces.
Declaration
extern CGColorConversionInfoRef CGColorConversionInfoCreateFromList(CFDictionaryRef options, CGColorSpaceRef , CGColorConversionInfoTransformType , CGColorRenderingIntent , ...);Parameters
- options
A dictionary containing options for color space conversion. See CGColorConversionInfo.
- colorSpace
The first color space in the conversion.
- transformType
The role of the first color space to the conversion process. See CGColorConversionInfoTransformType.
- renderingIntent
The rendering intent to use with the first color space. See CGColorRenderingIntent.
- …
A
NULL-terminated list of additionalcolorSpace, transformType, renderingIntenttriplets.
Returns
A color conversion object, or nil if no conversion between the specified color spaces is allowed.
Discussion
To call this function you must pass a triplet of color space, transform type, and rendering intent for each color space in the chain of conversions. For example, the following code is equivalent to calling init(src:dst:):
// convert from `src` to `dst` space with default intent
CGColorConversionInfoCreateFromList(NULL,
src, kCGColorConversionTransformFromSpace, kCGRenderingIntentDefault,
dst, kCGColorConversionTransformToSpace, kCGRenderingIntentDefault,
NULL);To extend this example to convert through an intermediate color space, insert another space/type/intent triplet between the src and dst lines, using the CGColorConversionInfoTransformType.transformApplySpace type.
The listed color spaces must be calibrated color spaces (that is, not device-specific or indexed color spaces), and the list must contain at least two color spaces (that is, two triplets of space, type, and intent).
You can use a color conversion object to create MPSImageConversion filters that perform GPU-accelerated color space conversion.