kCMMGetPS2ColorSpacerequest by obtaining or deriving the color space element data from the source profile.
A CMM may respond to the
kCMMGetPS2ColorSpacerequest 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 the
CMGetPS2ColorSpacefunction. The ColorSync Manager dispatches this request to the Component Manager, which calls your CMM to service the request. A CMM typically responds to the
kCMMGetPS2ColorSpacerequest 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);
- A handle to your CMM's storage for the instance of your component associated with the calling application or device driver.
- A profile reference to the source profile from which you must obtain or derive the color space element data.
- Reserved for future use.
- A pointer to a
MyColorSyncDataTransferfunction supplied by the calling application or device driver. Your
MyCMMGetPS2ColorSpacefunction calls this function repeatedly as necessary until you have passed all the source profile's color space element data to this function.
- A reference constant, containing data specified by the calling application or device driver, that your
MyCMMGetPS2ColorSpacefunction must pass to the
- function result
- A result code of type CMError. See "Result Codes" (page 3-172) for a list of ColorSync-specific result codes.
DISCUSSIONOnly for special cases should a custom CMM need to support this request code. If your CMM supports this function, your
MyCMMGetPS2ColorSpacefunction must obtain or derive the color space element data from the source profile whose reference is passed to your function in the
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 the
MyColorSyncDataTransferfunction is used as the operand to the PostScript
Your function must allocate a
databuffer in which to pass the color space element data to the
MyColorSyncDataTransferfunction supplied by the calling application or driver. Your
MyCMMGetPS2ColorSpacefunction must call the
MyColorSyncDataTransferfunction repeatedly until you have passed all the data to it. Here is the prototype for the
MyColorSyncDataTransferfunction pointed to by the
pascal OSErr MyColorSyncDataTransfer( long command, long *size, void *data, void *refCon);Your
MyCMMGetPS2ColorSpacefunction communicates with the
MyColorSyncDataTransferfunction, using a command parameter to identify the operation to perform. Your function should call the
MyColorSyncDataTransferfunction first with the
openWriteSpoolcommand to direct the
MyColorSyncDataTransferfunction to begin the process of writing the profile color space element data you pass it in the
databuffer. Next, you should call the
MyColorSyncDataTransferfunction with the
writeSpoolcommand. After the
MyColorSyncDataTransferfunction returns in the
sizeparameter the amount of data it actually wrote, you should call the
MyColorSyncDataTransferfunction again with the
writeSpoolcommand, repeating this process as often as necessary until all the color space data is transferred. After the data is transferred, you should call the
MyColorSyncDataTransferfunction with the
When your function calls the
MyColorSyncDataTransferfunction, it passes in the
databuffer the profile data to transfer to the
MyColorSyncDataTransferfunction and the size in bytes of the buffered data in the
MyColorSyncDataTransferfunction may not always write all the data you pass it in the
databuffer. Therefore, on return the
MyColorSyncDataTransferfunction command passes back in the
sizeparameter the number of bytes it actually wrote. Your
MyCMMGetPS2ColorSpacefunction keeps track of the number of bytes of remaining color space element data.
Each time your
MyCMMGetPS2ColorSpacefunction calls the
MyColorSyncDataTransferfunction, you pass it the reference constant passed to your function in the reference constant parameter.
SEE ALSOFor information about PostScript operations, see the PostScript Language Manual, second edition.