ADC Home > Reference Library > Technical Q&As > Legacy Documents > Graphics & Imaging >

Legacy Documentclose button

Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.

Current information on this Reference Library topic can be found here:

Setting the preferred CMM programatically?


Q: I would like to be able to check the current state of the ColorSync preferred CMM, save it, set it to a different CMM, perform some color matching functions, then restore the old state. Is this possible? In other words, is there a CMSetPreferredCMM function to go along with CMGetPreferredCMM?

A: There is no public API to set the preferred CMM because giving developers the ability to bypass/change the user preference (set in the ColorSync control panel) defeats the purpose of the user setting. Just as there are developers who want to set the preferred CMM, there are also users who want to set the CMM. ColorSync decided to favor the user's right to choose over the developer's.

That being said, if a developer uses the NCWConcatColorWorld function (see <http://developer.apple.com/technotes/tn/tn1160.html> ) it is possible to use the NCMConcatProfileSet structure to specify the CMM (and quality and rendering intent) to be used to make the CMWorldRef. With this API it is possible for the developer's choice to override the user's choice. The only catch is the chosen CMM must support the kNCMMConcatInit component selector on Mac OS 9 or the NCMMConcatInit CFBundle symbol on Mac OS X.

Here's some additional details regarding the flags and flagsMask fields of the NCMConcatProfileSet structure. In the past, if an application wanted to control the quality and rendering intent for a match it would need to modify the various flag bits of the profiles before creating the ColorWorld. Now this can be done more easily with the NCMConcatProfileSpec structure.

For example, if you would like to force best quality mode, specify the flags and flagsMask as follows:



    flags = cmBestMode << 16;
    flagsMask = cmQualityMask;


If you would like to force normal quality mode, specify the flags and flagsMask as follows:



    flags = cmNormalMode << 16;
    flagsMask = cmQualityMask;


If you would like to force draft quality mode, specify the flags and flagsMask as follows:



    flags = cmDraftMode << 16;
    flagsMask = cmQualityMask;


If you don't need to perform gamut checking (CWCheckPixMap, CWCheckBitmap, etc.) you can more quickly build the ColorWorld by specifying:



    flags = cmGamutCheckingMask;
    flagsMask = cmGamutCheckingMask;


Setting the gamut checking flag will reduce the time and memory needed to build the ColorWorld.


[Oct 24 2001]


Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.