init(iccBasedNComponents:range:profile:alternate:)
Creates a device-independent color space that is defined according to the ICC color profile specification.
Declaration
init?(iccBasedNComponents nComponents: Int, range: UnsafePointer<CGFloat>?, profile: CGDataProvider, alternate: CGColorSpace?)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 thekthe color component, the valid range is range[2*k] ≤ c[k] ≤range[2*k+1]. - profile:
A data provider that supplies the ICC profile.
- alternate:
An alternate color space to use in case the ICC profile is not supported. The alternate color space must have
nComponentscolor components. You must supply an alternate color space. If this parameter isNULL, then the function returnsNULL.
Return Value
A new ICC-based color space object, or NULL if unsuccessful. In Objective-C, you’re responsible for releasing this object by calling CGColorSpaceRelease.
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 Color Spaces
init(calibratedGrayWhitePoint:blackPoint:gamma:)init(calibratedRGBWhitePoint:blackPoint:gamma:matrix:)init(indexedBaseSpace:last:colorTable:)init(labWhitePoint:blackPoint:range:)init(patternBaseSpace:)init(name:)init(platformColorSpaceRef:)init(iccData:)init(propertyListPlist:)CGColorSpaceCreateDeviceRGB()CGColorSpaceCreateDeviceCMYK()CGColorSpaceCreateDeviceGray()init(iccProfileData:)