![]() |
PATH![]() |
![]() ![]() |
This section describes the ColorSync functions, new in version 2.5, that you use to get and set default profiles for RGB, CMYK, Lab, and XYZ color spaces. Note that a user can set the default profile for the RGB and CMYK color spaces with the ColorSync control panel, as described in Setting Default Profiles .
CMGetDefaultProfileBySpace
gets the default profile for the specified color space;
new in ColorSync 2.5
.CMSetDefaultProfileBySpace
sets the default profile for the specified color space;
new in ColorSync 2.5
.
pascal CMError CMGetDefaultProfileBySpace(
OSType dataColorSpace,
CMProfileRef * prof);
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 doesn't 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.
pascal CMError CMSetDefaultProfileBySpace (
OSType dataColorSpace,
CMProfileRef prof);
The CMSetDefaultProfileBySpace 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. CMSetDefaultProfileBySpace returns a value of paramErr if you pass a color space constant it doesn't currently support.
Note that a user can also use the ColorSync control panel to specify a default profile for the RGB and CMYK color spaces, as described in Setting Default Profiles .