PATHMac OS 8 and 9 Developer Documentation > Mutlimedia and Graphics > ColorSync Manager >

Managing Color With ColorSync


Identifying the Current System Profile

For the functions NCMBeginMatching, NCMUseProfileComment, and NCWNewColorWorld , your application can specify NULL to signify the system profile. For all other functions--for example, the CMGetProfileElement function, the CMValidateProfile function, and the CMCopyProfile function--for which you want to specify the system profile, you must give an explicit reference to the profile. You can use the CMGetSystemProfile function to obtain a reference to the system profile.

IMPORTANT

Starting with ColorSync version 2.5, the system profile is used primarily for backward compatibility, as described in Setting Default Profiles . As a result, you should not use the system profile as a source or destination profile if you can determine a specific profile to use instead. For example, you may want to call CMGetDefaultProfileBySpace to get the default profile for a specific color space or CMGetProfileByAVID to get a profile for a specific display.

Each profile, including the profile configured as the system profile, has a name associated with it. If your application needs to display the name of the system profile to the user, it can call CMGetSystemProfile, as shown in Listing 3-4 , to get the system profile, then call the CMGetScriptProfileDescription function to get the profile name and script code.

Listing 3-4 Identifying the current system profile

CMError MyPrintSystemProfileName (void)
{
    CMError         theErr;
    CMProfileRef    sysProf;
    Str255          profName;
    ScriptCode      profScript;
    theErr = CMGetSystemProfile(&sysProf);
    require(theErr == noErr, cleanup);

    theErr = CMGetScriptProfileDescription(sysProf, profName,
                                                &profScript);
    require(theErr == noErr, cleanup);
    // ... call Script Mgr to get correct font for script ...

    DrawString(profname);

// Do any necessary cleanup. In this case, just return.
cleanup:
    return theErr;
}

© 1988-1999 Apple Computer, Inc. — (Last Updated 20 Jan 99)