Important: The information in this document is obsolete and should not be used for new development.
NCMBeginMatching
Sets up a high-level ColorSync matching session, using the specified source and destination profiles, that acknowledges QuickDraw operations.
pascal CMError NCMBeginMatching ( CMProfileRef src, CMProfileRef dst, CMMatchRef *myRef);
src- A profile reference (page 3-63) for the source profile for the matching session. To indicate the ColorSync system profile, specify a
NULLvalue.dst- A profile reference for the destination profile for the matching session. To indicate the ColorSync system profile, specify a
NULLvalue.myRef- A pointer to a matching session. On output, it specifies the high-level matching session that was set up.
- function result
- A result code of type CMError. See "Result Codes" (page 3-174) for a list of ColorSync-specific result codes.
DISCUSSION
TheNCMBeginMatchingfunction sets up a high-level matching session using QuickDraw, telling the ColorSync Manager to match all colors drawn to the current graphics device using the specified source and destination profiles.The
NCMBeginMatchingfunction returns a reference to the color-matching session. You must later pass this reference to theCMEndMatchingfunction, described next, to conclude the session.The source and destination profiles define how the match is to occur. Passing
NULLfor either the source or destination profile is equivalent to passing the system profile. If the current device is a screen device, matching to all screen devices occurs.The
NCMBeginMatchingandCMEndMatchingfunctions can be nested. In such cases, the ColorSync Manager first matches to the most recently added profiles first. Therefore, if you want to use theNCMBeginMatching-CMEndMatchingpair to perform a page preview--which typically entails color matching from a source device (scanner) to a destination device (printer) to a preview device (display)-- you would first callNCMBeginMatchingwith the printer-to-display profiles, and then callNCMBeginMatchingwith the scanner-to-printer profiles. The ColorSync Manager then matches all drawing from the scanner to the printer and then back to the display. The print preview process entails multiprofile transformations. The ColorSync Manager low-level functions (which include the use of concatenated profiles well suited to print preview processing) offer an easier and faster way to do this.
Even if you call the
- Note
- If you call
NCMBeginMatchingbefore drawing to the screen's graphics device (as opposed to an offscreen device), you must callCMEndMatchingto finish a matching session and before callingWaitNextEventor any other routine (such as Window Manager routines) that could draw to the screen. Failing to do so will cause unwanted matching to occur. Furthermore, if a device has color matching enabled, you cannot call theCopyBitsprocedure to copy from it to itself unless the source and destination rectangles are the same.![]()
NCMBeginMatchingfunction before calling the QuickDrawDrawPicturefunction, the ColorSync picture comments such ascmEnableMatchingandcmDisableMatchingare not acknowledged. For the ColorSync Manager to recognize these comments and allow their use, you must call theNCMDrawMatchedPicturefunction for color matching using picture comments.This function causes matching for the specified devices rather than for the current color graphics port.
SEE ALSO
The high-level color-matching functionNCMBeginMatchingthat uses QuickDraw performs color matching in a manner acceptable to most applications. However, if your application needs a finer level of control over color matching, it can use the low-level matching functions described in "Matching Colors Using Low-Level Functions Without QuickDraw" (page 3-107).For background information on graphics devices, see Inside Macintosh: Imaging With QuickDraw.