Function

CGColorSpaceCreateICCBased

Creates a device-independent color space that is defined according to the ICC color profile specification.

Declaration

CGColorSpaceRef CGColorSpaceCreateICCBased(size_t nComponents, const CGFloat *range, CGDataProviderRef profile, CGColorSpaceRef alternate);

Parameters

nComponents

The number of color components in the color space defined by the ICC profile data. This must match the number of components actually in the ICC profile and must equal 1, 3, or 4.

range

An array of numbers that specify the minimum and maximum valid values of the corresponding color components. The size of the array is two times the number of components. If c[k] is the kthe color component, the valid range is range[2*k] ≤ c[k] ≤ range[2*k+1].

profile

A data provider that supplies the ICC profile.

alternateSpace

An alternate color space to use in case the ICC profile is not supported. The alternate color space must have nComponents color components. You must supply an alternate color space. If this parameter is NULL, then the function returns NULL.

Return Value

A new ICC-based color space object. You are responsible for releasing this object by calling CGColorSpaceRelease. If unsuccessful, returns NULL.

Discussion

This function creates an ICC-based color space from an ICC color profile, as defined by the International Color Consortium. ICC profiles define the reproducible color gamut (the range of colors supported by a device) and other characteristics of a particular output device, providing a way to accurately transform the color space of one device to the color space of another. The ICC profile is usually provided by the manufacturer of the device. Additionally, some color monitors and printers contain electronically embedded ICC profile information, as do some bitmap formats such as TIFF. Colors in a device-independent color space should appear the same when displayed on different devices, to the extent that the capabilities of the device allow.

You may want to use this function for a color space that requires a detailed gamma, such as the piecewise transfer function used in sRGB or ITU-R BT.709, because this function can accurately represent these gamma curves.

See Also

Creating Device-Independent Color Spaces

CGColorSpaceCreateCalibratedGray

Creates a calibrated grayscale color space.

CGColorSpaceCreateCalibratedRGB

Creates a calibrated RGB color space.

CGColorSpaceCreateWithICCProfile

Creates an ICC-based color space using the ICC profile contained in the specified data.

Deprecated
CGColorSpaceCreateLab

Creates a device-independent color space that is relative to human color perception, according to the CIE L*a*b* standard.