CMGetDefaultProfileBySpace
Gets the default profile for the specified color space.
Declaration
CMError CMGetDefaultProfileBySpace (
OSType dataColorSpace,
CMProfileRef *prof
);Parameters
- dataColorSpace:
A four-character identifier of type
OSType. You pass a color space signature that identifies the color space you wish to get the default profile for. The currently-supported values arecmRGBData,cmCMYKData,cmLabData, andcmXYZData. These constants are a subset of the constants described in 1560276 Color_space_signatures. If you supply a value that is not supported, theCMGetDefaultProfileBySpacefunction returns an error value ofparamErr. - prof:
A pointer to a profile reference. On return, the reference specifies the current profile for the color space specified by
dataColorSpace.CMGetDefaultProfileBySpacecurrently supports only file-based profiles.
Return Value
A CMError value. See Result Codes.
Overview
The CMGetDefaultProfileBySpace function currently supports the RGB, CMYK, Lab, and XYZ color spaces. The signature constants for these color spaces (shown above with the dataColorSpace parameter description) are described in Color Space Signatures. Support for additional color spaces may be provided in the future. CMGetDefaultProfileBySpace returns an error value of paramErr if you pass a color space constant it does not currently support.
The CMGetDefaultProfileBySpace function always attempts to return a file-based profile for a supported color space. For example, if the user has not specified a default profile in the ColorSync control panel for the specified color space, or if the profile is not found (the user may have deleted the profiles in the ColorSync Profiles folder or even the folder itself), CMGetDefaultProfileBySpace creates a profile, stores it on disk, and returns a reference to that profile. However, you should always check for an error return—for example, a user may have booted from a CD, so that CMGetDefaultProfileBySpace cannot save a profile file to disk.