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

Managing Color With ColorSync


Getting and Setting Monitor Profiles by AVID

This section describes the ColorSync functions, new in version 2.5, that you use to get and set a profile for each monitor. These routines work with the AVIDType data type, which is defined by the Display Manager and used to specify a device such as a monitor. Note that a user can set a profile for each display with the Monitors & Sound control panel, as described in Setting a Profile for Each Monitor . You can get more information about AVID values from the Display Manager SDK.


CMGetProfileByAVID

New in ColorSync 2.5

Gets the current profile for a monitor.

pascal CMError CMGetProfileByAVID (
                     AVIDType theAVID,
                     CMProfileRef *prof);
theAVID
A Display Manager ID value. You pass the ID value for the monitor for which to get the profile. You can get more information about AVID values from the Display Manager SDK.
prof
A pointer to a profile reference. On return, a reference to the current profile for the monitor specified by theAVID .
function result
A result code of type CMError . For possible values, see Result Codes for the ColorSync Manager .

DISCUSSION

If the Display Manager supports ColorSync, the CMGetProfileByAVID function calls on the Display Manager to get the profile for the specified display. This is the case if the version of the Display Manager is 2.2.5 or higher (if gestaltDisplayMgrAttr has the gestaltDisplayMgrColorSyncAware bit set).


CMSetProfileByAVID

New in ColorSync 2.5

Sets the profile for the specified monitor, optionally setting video card gamma.

pascal CMError CMSetProfileByAVID (
                     AVIDType theAVID,
                     CMProfileRef prof);
theAVID
A Display Manager ID value. You pass the ID value for the monitor for which to set the profile. You can get more information about AVID values from the Display Manager SDK.
prof
A profile reference. Before calling CMSetProfileByAVID , set the reference to identify the profile for the monitor specified by theAVID .
function result
A result code of type CMError . For possible values, see Result Codes for the ColorSync Manager .

DISCUSSION

If you specify a profile that contains the optional profile tag for video card gamma, CMSetProfileByAVID extracts the tag and sets the video card based on the tag data, as described in Video Card Gamma . This is the only ColorSync function that sets video card gamma. The tag constant cmVideoCardGammaTag is described with the constants in Video Card Gamma Constants .

When a user sets a display profile using the Monitors & Sound control panel, the system profile is set to the same profile, as described in Setting a Profile for Each Monitor . When you call CMSetProfileByAVID to set a profile for a monitor, you may also wish to make that profile the system profile. If so, you must call CMSetSystemProfile explicitly--calling CMSetProfileByAVID alone has no affect on the system profile.

Note that if the Display Manager supports ColorSync, the CMSetProfileByAVID function calls on the Display Manager to set the profile for the specified display. This is the case if the version of the Display Manager is 2.2.5 or higher (if gestaltDisplayMgrAttr has the gestaltDisplayMgrColorSyncAware bit set).


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