Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Advanced Color Imaging Reference /
Chapter 3 - ColorSync Manager Reference for Applications and Device Drivers / ColorSync Manager Functions
PostScript Color-Matching Support Functions /


CMGetPS2ColorRendering

Obtains the color rendering dictionary (CRD) element data usable as the parameter to the PostScript setColorRendering operator, which specifies the PostScript color rendering dictionary to use for the following graphics data.

pascal CMError CMGetPS2ColorRendering (
CMProfileRef srcProf, 
CMProfileRef dstProf,
unsigned long flags, 
CMFlattenUPP proc,
void *refCon,
Boolean *preferredCMMnotfound);
srcProf
A profile reference to a profile that supplies the rendering intent for the CRD.
dstProf
A profile reference to a profile from which to extract the CRD data.
flags
If the value of flags is equal to cmPS8bit, the generated PostScript will utilize 8-bit encoding whenever possible to achieve higher data compaction. If the value of flags is not equal to cmPS8bit, the generated data will be 7-bit safe, in either ASCII or ASCII base-85 encoding.
proc
A pointer to a callback flatten function to perform the data transfer. For information, see the MyColorSyncDataTransfer function (page 3-167).
refCon
A reference constant for application data passed as a parameter to calls to the MyColorSyncDataTransfer function.
preferredCMMnotfound
A pointer to a Boolean value indicating whether the preferred CMM was found. On output, has the value true if the CMM corresponding to profile was not available or if it was unable to perform the function and the default Apple CMM was used. Otherwise, has the value false.
function result
A result code of type CMError. See "Result Codes" (page 3-174) for a list of ColorSync-specific result codes.
DISCUSSION
The CMGetPS2ColorRendering function obtains CRD data from the profile specified by the dstProf parameter. To be valid, the parameter must specify an output profile with at most four components. The CMM uses the rendering intent from the profile specified by the srcProf parameter to determine which of the PostScript tags (ps2CR0Tag, ps2CR1Tag, ps2CR2Tag, or ps2CR3Tag) to use in creating the CRD. If none of these tags exists in the profile, the CMM creates the CRD from one of the multidimensional table tags (cmAToB0, cmAToB1, or cmAToB2), again chosen according to the rendering intent of the profile specified by the srcProf parameter.

This function is dispatched to the CMM component specified by the destination profile. If the designated CMM is not available or the CMM does not implement this function, the ColorSync Manager dispatches this function to the default Apple CMM.

The CMM obtains the PostScript data and passes it to your low-level data transfer procedure, specified by the proc parameter. The CMM converts the data into a PostScript stream and calls your procedure as many times as necessary to transfer the data to it. Typically, the low-level data transfer function returns this data to the calling application or device driver to pass to a PostScript printer.

SEE ALSO
Before your application or device driver sends the CRD to the printer, it can call the CMGetPS2ColorRenderingVMSize function (page 3-163) to determine the virtual memory size of the CRD.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 NOV 1996