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
NULL
value.dst
- A profile reference for the destination profile for the matching session. To indicate the ColorSync system profile, specify a
NULL
value.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
TheNCMBeginMatching
function 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
NCMBeginMatching
function returns a reference to the color-matching session. You must later pass this reference to theCMEndMatching
function, described next, to conclude the session.The source and destination profiles define how the match is to occur. Passing
NULL
for 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
NCMBeginMatching
andCMEndMatching
functions 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
-CMEndMatching
pair 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 callNCMBeginMatching
with the printer-to-display profiles, and then callNCMBeginMatching
with 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
NCMBeginMatching
before drawing to the screen's graphics device (as opposed to an offscreen device), you must callCMEndMatching
to finish a matching session and before callingWaitNextEvent
or 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 theCopyBits
procedure to copy from it to itself unless the source and destination rectangles are the same.NCMBeginMatching
function before calling the QuickDrawDrawPicture
function, the ColorSync picture comments such ascmEnableMatching
andcmDisableMatching
are not acknowledged. For the ColorSync Manager to recognize these comments and allow their use, you must call theNCMDrawMatchedPicture
function 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 functionNCMBeginMatching
that 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.