Important: The information in this document is obsolete and should not be used for new development.
MyCMMGetPS2ColorSpace
Handles thekCMMGetPS2ColorSpace
request by obtaining or deriving the color space element data from the source profile.A CMM may respond to the
kCMMGetPS2ColorSpace
request code, but it is not required to do so. The ColorSync Manager sends this request code to your CMM on behalf of an application that called theCMGetPS2ColorSpace
function. The ColorSync Manager dispatches this request to the Component Manager, which calls your CMM to service the request. A CMM typically responds to thekCMMGetPS2ColorSpace
request code by calling a CMM-defined function (for example,MyCMMGetPS2ColorSpace
) to handle the request.The MyCMMGetPS2ColorSpace function is a color management module-defined subroutine.
pascal CMError MyCMMGetPS2ColorSpace( ComponentInstance CMSession, CMProfileRef srcProf, unsigned long flags, CMFlattenUPP proc, void *refCon);
CMsession
- A handle to your CMM's storage for the instance of your component associated with the calling application or device driver.
srcProf
- A profile reference to the source profile from which you must obtain or derive the color space element data.
flags
- Reserved for future use.
proc
- A pointer to a
MyColorSyncDataTransfer
function supplied by the calling application or device driver. YourMyCMMGetPS2ColorSpace
function calls this function repeatedly as necessary until you have passed all the source profile's color space element data to this function.refCon
- A reference constant, containing data specified by the calling application or device driver, that your
MyCMMGetPS2ColorSpace
function must pass to theMyColorSyncDataTransfer
function.- function result
- A result code of type CMError. See "Result Codes" (page 3-172) for a list of ColorSync-specific result codes.
DISCUSSION
Only for special cases should a custom CMM need to support this request code. If your CMM supports this function, yourMyCMMGetPS2ColorSpace
function must obtain or derive the color space element data from the source profile whose reference is passed to your function in thesrcProf
parameter.The color space data may be assigned to the PostScript Level 2 color space array (
ps2CSATag
) tag in the source profile. The byte stream containing the color space element data that your function passes to theMyColorSyncDataTransfer
function is used as the operand to the PostScriptsetColorSpace
operator.Your function must allocate a
data
buffer in which to pass the color space element data to theMyColorSyncDataTransfer
function supplied by the calling application or driver. YourMyCMMGetPS2ColorSpace
function must call theMyColorSyncDataTransfer
function repeatedly until you have passed all the data to it. Here is the prototype for theMyColorSyncDataTransfer
function pointed to by theproc
parameter:
pascal OSErr MyColorSyncDataTransfer( long command, long *size, void *data, void *refCon);YourMyCMMGetPS2ColorSpace
function communicates with theMyColorSyncDataTransfer
function, using a command parameter to identify the operation to perform. Your function should call theMyColorSyncDataTransfer
function first with theopenWriteSpool
command to direct theMyColorSyncDataTransfer
function to begin the process of writing the profile color space element data you pass it in thedata
buffer. Next, you should call theMyColorSyncDataTransfer
function with thewriteSpool
command. After theMyColorSyncDataTransfer
function returns in thesize
parameter the amount of data it actually wrote, you should call theMyColorSyncDataTransfer
function again with thewriteSpool
command, repeating this process as often as necessary until all the color space data is transferred. After the data is transferred, you should call theMyColorSyncDataTransfer
function with thecloseSpool
command.When your function calls the
MyColorSyncDataTransfer
function, it passes in thedata
buffer the profile data to transfer to theMyColorSyncDataTransfer
function and the size in bytes of the buffered data in thesize
parameter. TheMyColorSyncDataTransfer
function may not always write all the data you pass it in thedata
buffer. Therefore, on return theMyColorSyncDataTransfer
function command passes back in thesize
parameter the number of bytes it actually wrote. YourMyCMMGetPS2ColorSpace
function keeps track of the number of bytes of remaining color space element data.Each time your
MyCMMGetPS2ColorSpace
function calls theMyColorSyncDataTransfer
function, you pass it the reference constant passed to your function in the reference constant parameter.SEE ALSO
For information about PostScript operations, see the PostScript Language Manual, second edition.