![]() |
PATH![]() |
![]() ![]() |
This section provides a quick-reference summary of the functions, data types, and constants that make up the ColorSync Manager programming interface.
pascal CMError CMOpenProfile (CMProfileRef *prof,
const CMProfileLocation *theProfile);
pascal CMError CMCloseProfile (CMProfileRef prof);
pascal CMError CMProfileModified (CMProfileRef prof,
Boolean *modified);
pascal CMError CMUpdateProfile (CMProfileRef prof);
pascal CMError CMNewProfile (CMProfileRef *prof,
const CMProfileLocation *theProfile);
pascal CMError CMCopyProfile (CMProfileRef *targetProf,
const CMProfileLocation *targetLocation,
CMProfileRef prof);
pascal CMError CMCloneProfileRef (CMProfileRef prof);
pascal CMError CMGetProfileRefCount (
CMProfileRef prof, long *count);
/* NCMGetProfileLocation is new in ColorSync 2.5 */
pascal CMError NCMGetProfileLocation (
CMProfileRef prof,
CMProfileLocation * profLoc,
unsigned long * locationSize);
/* CMGetProfileLocation is not recommended in ColorSync 2.5 */
pascal CMError CMGetProfileLocation (
CMProfileRef prof,
CMProfileLocation *theProfile);
pascal CMError CMValidateProfile (CMProfileRef prof,
Boolean *valid,
Boolean *preferredCMMnotfound);
/* Use of CMFlattenProfile is changed in ColorSync 2.5 */
pascal CMError CMFlattenProfile (CMProfileRef prof,
unsigned long flags,
CMFlattenUPP proc,
void *refCon,
Boolean *preferredCMMnotfound);
/* Use of CMUnflattenProfile is changed in ColorSync 2.5 */
pascal CMError CMUnflattenProfile(FSSpec *resultFileSpec,
CMFlattenUPP proc,
void *refCon,
Boolean *preferredCMMnotfound);
pascal CMError CMProfileElementExists (
CMProfileRef prof,
OSType tag,
Boolean *found);
pascal CMError CMCountProfileElements (
CMProfileRef prof,
unsigned long *elementCount);
pascal CMError CMGetProfileElement (
CMProfileRef prof,
OSType tag,
unsigned long *elementSize,
void *elementData);
pascal CMError CMGetProfileHeader (CMProfileRef prof,
CMAppleProfileHeader *header);
pascal CMError CMGetPartialProfileElement (
CMProfileRef prof,
OSType tag,
unsigned long offset,
unsigned long *byteCount,
void *elementData);
pascal CMError CMSetProfileElementSize (
CMProfileRef prof,
OSType tag,
unsigned long elementSize);
pascal CMError CMGetIndProfileElementInfo (
CMProfileRef prof,
unsigned long index,
OSType *tag,
unsigned long *elementSize,
Boolean *refs);
pascal CMError CMGetIndProfileElement (
CMProfileRef prof,
unsigned long index,
unsigned long *elementSize,
void *elementData);
pascal CMError CMSetPartialProfileElement (
CMProfileRef prof,
OSType tag,
unsigned long offset,
unsigned long byteCount,
void *elementData);
pascal CMError CMSetProfileElement (
CMProfileRef prof,
OSType tag,
unsigned long elementSize,
void *elementData);
pascal CMError CMSetProfileHeader(CMProfileRef prof,
const CMAppleProfileHeader *header);
pascal CMError CMSetProfileElementReference (
CMProfileRef prof,
OSType elementTag,
OSType referenceTag);
pascal CMError CMRemoveProfileElement (
CMProfileRef prof, OSType tag);
pascal CMError CMGetScriptProfileDescription (
CMProfileRef prof,
Str255 name,
ScriptCode *code);
pascal CMError CMGetNamedColorInfo (
CMProfileRef prof,
unsigned long *deviceChannels,
OSType *deviceColorSpace,
OSType *PCSColorSpace,
unsigned long *count,
StringPtr prefix,
StringPtr suffix);
pascal CMError CMGetNamedColorValue (
CMProfileRef prof,
StringPtr name,
CMColor *deviceColor,
CMColor *PCSColor)
pascal CMError CMGetIndNamedColorValue (
CMProfileRef prof,
unsigned long index,
CMColor *deviceColor,
CMColor *PCSColor);
pascal CMError CMGetNamedColorIndex (
CMProfileRef prof,
StringPtr name,
unsigned long *index);
pascal CMError CMGetNamedColorName (
CMProfileRef prof,
unsigned long index,
StringPtr name)
/* Use of NCWNewColorWorld is changed in ColorSync 2.5 */
pascal CMError NCWNewColorWorld(CMWorldRef *cw,
CMProfileRef src,
CMProfileRef dst);
/* Use of CWConcatColorWorld is changed in ColorSync 2.5 */
pascal CMError CWConcatColorWorld (CMWorldRef *cw,
CMConcatProfileSet *profileSet);
pascal CMError CWNewLinkProfile(CMProfileRef *prof,
const CMProfileLocation *targetLocation,
CMConcatProfileSet *profileSet);
/* Use of CMGetCWInfo is changed in ColorSync 2.5 */
pascal CMError CMGetCWInfo (CMWorldRef cw,
CMCWInfoRecord *info);
pascal void CWDisposeColorWorld (CMWorldRef cw);
pascal CMError CWMatchPixMap (CMWorldRef cw,
PixMap *myPixMap,
CMBitmapCallBackUPP progressProc,
void *refCon);
pascal CMError CWCheckPixMap (CMWorldRef cw,
PixMap *myPixMap,
CMBitmapCallBackUPP progressProc,
void *refCon,
BitMap *resultBitMap);
pascal CMError CWMatchBitmap (CMWorldRef cw,
CMBitMap *bitMap,
CMBitmapCallBackUPP progressProc,
void *refCon,
CMBitMap *matchedBitMap);
pascal CMError CWCheckBitmap (CMWorldRef cw,
const CMBitMap *bitMap,
CMBitmapCallBackUPP progressProc,
void *refCon,
CMBitMap *resultBitMap);
pascal CMError CWMatchColors (CMWorldRef cw,
CMColor *myColors,
unsigned long count);
pascal CMError CWCheckColors (CMWorldRef cw,
CMColor *myColors,
unsigned long count,
long *result);
/* Use of NCMBeginMatching is changed in ColorSync 2.5 */
pascal CMError NCMBeginMatching (CMProfileRef src,
CMProfileRef dst,
CMMatchRef *myRef);
/* Use of NCMDrawMatchedPicture is changed in ColorSync 2.5 */
pascal void NCMDrawMatchedPicture (PicHandle myPicture,
CMProfileRef dst,
Rect *myRect);
pascal CMError NCMUseProfileComment (
CMProfileRef prof,
unsigned long flags);
/* CMGetPreferredCMM is new in ColorSync 2.5 */
pascal CMError CMGetPreferredCMM (
OSType *cmmType,
Boolean *preferredCMMnotfound)
/* Use of CMGetSystemProfile
is changed in ColorSync 2.5 */
/* Use of CMSetSystemProfile
is changed in ColorSync 2.5 */
pascal CMError CMSetSystemProfile (const FSSpec *profileFileSpec);
/* CMGetDefaultProfileBySpace is new in ColorSync 2.5 */
pascal CMError CMGetDefaultProfileBySpace(
OSType dataColorSpace,
CMProfileRef * prof);
/* CMSetDefaultProfileBySpace is new in ColorSync 2.5 */
pascal CMError CMSetDefaultProfileBySpace (
OSType dataColorSpace,
CMProfileRef prof);
/* CMGetProfileByAVID is new in ColorSync 2.5 */
pascal CMError CMGetProfileByAVID (
AVIDType theAVID,
CMProfileRef *prof);
/* CMSetProfileByAVID is new in ColorSync 2.5 */
pascal CMError CMSetProfileByAVID (
AVIDType theAVID,
CMProfileRef prof);
pascal CMError CMGetColorSyncFolderSpec (
short vRefNum,
Boolean createFolder,
short *foundVRefNum, long *foundDirID);
/* CMIterateColorSyncFolder is new in ColorSync 2.5 */
pascal CMError CMIterateColorSyncFolder (
CMProfileIterateUPP proc,
unsigned long * seed,
unsigned long * count,
void * refCon);
/* The functions in this group are not recommended in ColorSync 2.5 */
pascal CMError CMNewProfileSearch (CMSearchRecord *searchSpec,
void *refCon,
unsigned long *count,
CMProfileSearchRef *searchResult);
pascal CMError CMUpdateProfileSearch (
CMProfileSearchRef search,
void *refCon,
unsigned long *count);
pascal void CMDisposeProfileSearch (
CMProfileSearchRef search);
pascal CMError CMSearchGetIndProfile (
CMProfileSearchRef search,
unsigned long index,
CMProfileRef *prof);
pascal CMError CMSearchGetIndProfileFileSpec (
CMProfileSearchRef search,
unsigned long index,
FSSpec *profileFile);
pascal CMError CMNewProfileSearch (CMSearchRecord *searchSpec,
void *refCon,
unsigned long *count,
CMProfileSearchRef *searchResult);
pascal CMError CMProfileIdentifierListSearch (
CMProfileIdentifierPtr ident,
CMProfileRef *profileList,
unsigned long listSize,
unsigned long *matchedCount,
CMProfileRef *matchedList);
pascal ComponentResult CMXYZToLab (ComponentInstance ci,
const CMColor *src,
const CMXYZColor *white,
CMColor *dst,
unsigned long count);
pascal ComponentResult CMLabToXYZ (ComponentInstance ci,
const CMColor *src,
const CMXYZColor *white,
CMColor *dst,
unsigned long count);
pascal ComponentResult CMXYZToLuv (ComponentInstance ci,
const CMColor *src,
const CMXYZColor *white,
CMColor *dst,
unsigned long count);
pascal ComponentResult CMLuvToXYZ (ComponentInstance ci,
const CMColor *src,
const CMXYZColor *white,
CMColor *dst,
unsigned long count);
pascal ComponentResult CMXYZToYxy (ComponentInstance ci,
const CMColor *src,
CMColor *dst,
unsigned long count);
pascal ComponentResult CMYxyToXYZ (ComponentInstance ci,
const CMColor *src,
CMColor *dst,
unsigned long count);
pascal ComponentResult CMXYZToFixedXYZ ( ComponentInstance ci,
const CMXYZColor *src,
CMFixedXYZColor *dst,
unsigned long count);
pascal ComponentResult CMFixedXYZToXYZ ( ComponentInstance ci,
const CMFixedXYZColor *src,
CMXYZColor *dst,
unsigned long count);
pascal ComponentResult CMRGBToHLS (ComponentInstance ci,
const CMColor *src,
CMColor *dst,
unsigned long count);
pascal ComponentResult CMHLSToRGB (ComponentInstance ci,
const CMColor *src,
CMColor *dst,
unsigned long count);
pascal ComponentResult CMRGBToHSV (ComponentInstance ci,
const CMColor *src,
CMColor *dst,
unsigned long count);
pascal ComponentResult CMHSVToRGB (ComponentInstance ci,
const CMColor *src,
CMColor *dst,
unsigned long count);
pascal ComponentResult CMRGBToGray ( ComponentInstance ci,
const CMColor *src,
CMColor *dst,
unsigned long count);
pascal CMError CMGetPS2ColorSpace (CMProfileRef srcProf,
unsigned long flags,
CMFlattenUPP proc,
void *refCon,
Boolean *preferredCMMnotfound);
pascal CMError CMGetPS2ColorRenderingIntent (
CMProfileRef srcProf,
unsigned long flags,
CMFlattenUPP proc,
void *refCon,
Boolean *preferredCMMnotfound);
pascal CMError CMGetPS2ColorRendering (
CMProfileRef srcProf,
CMProfileRef dstProf,
unsigned long flags,
CMFlattenUPP proc,
void *refCon,
Boolean *preferredCMMnotfound);
extern pascal CMError CMGetPS2ColorRenderingVMSize (
CMProfileRef srcProf,
CMProfileRef dstProf,
unsigned long *vmSize,
Boolean *preferredCMMnotfound);
pascal CMError CMConvertProfile2to1 (
CMProfileRef profv2,
CMProfileHandle *profv1);
/* MyProfileIterateProc is new in ColorSync 2.5 */
pascal OSErr MyProfileIterateProc (
CMProfileIterateData *iterateData,
void *refCon);
pascal OSErr MyColorSyncDataTransfer (
long command,
long *size,
void *data,
void *refCon);
pascal Boolean MyCMBitmapCallBackProc (
long progress,
void *refCon);
pascal Boolean MyCMProfileFilterProc (
CMProfileRef prof,
void *refCon);
/* date and time structure */
struct CMDateTime {
unsigned short year;
unsigned short month;
unsigned short dayOfTheMonth;
unsigned short hours;
unsigned short minutes;
unsigned short seconds;
};
/* ColorSync version 1.0 profile header */
struct CMHeader {
unsigned long size;
OSType CMMType;
unsigned long applProfileVersion;
OSType dataType;
OSType deviceType;
OSType deviceManufacturer;
unsigned long deviceModel;
unsigned long deviceAttributes[2];
unsigned long profileNameOffset;
unsigned long customDataOffset;
CMMatchFlag flags;
CMMatchOption options;
CMXYZColor white;
CMXYZColor black;
};
/* ColorSync Manager profile 2.x header structure */
struct CM2Header {
unsigned long size;
OSType CMMType;
unsigned long profileVersion;
OSType profileClass;
OSType dataColorSpace;
OSType profileConnectionSpace;
CMDateTime dateTime;
OSType CS2profileSignature;
OSType platform;
unsigned long flags;
OSType deviceManufacturer;
unsigned long deviceModel;
unsigned long deviceAttributes[2];
unsigned long renderingIntent;
CMFixedXYZColor white;
char reserved[48];
};
/* Apple profile header */
union CMAppleProfileHeader {
CMHeader cm1;
CM2Header cm2;
};
/* profile reference abstract data type */
typedef struct OpaqueCMProfileRef *CMProfileRef;
/* profile identifier structure */
struct CMProfileIdentifier {
CM2Header profileHeader;
CMDateTime calibrationDate;
unsigned long ASCIIProfileDescriptionLen;
char ASCIIProfileDescription[1]; /* variable length */
};
/* profile location union */
union CMProfLoc {
CMFileLocation fileLoc;
CMHandleLocation handleLoc;
CMPtrLocation ptrLoc;
CMProcedureLocation procLoc;
};
/* profile location structure */
struct CMProfileLocation{
short locType;
CMProfLoc u;
};
/* file specification for file-based profiles */
struct CMFileLocation {
FSSpec spec;
};
/* handle specification for memory-based profiles */
struct CMHandleLocation {
Handle h;
};
/* pointer specification for memory-based profiles */
struct CMPtrLocation {
Ptr p;
};
/* procedure specification for procedure access profiles */
struct CMProcedureLocation {
CMProfileAccessUPP proc;
void *refCon;
};
/* CMProfileIterateProcPtr and CMProfileIterateData are new in ColorSync 2.5 */
/* Cached profile searching */
pascal OSErr (*CMProfileIterateProcPtr )
(CMProfileIterateData *iterateData,
void *refCon);
struct CMProfileIterateData {
unsigned long dataVersion; /* cmProfileIterateDataVersion1 */
CM2Header header;
ScriptCode code;
Str255 name;
CMProfileLocation location;
};
typedef struct CMProfileIterateData CMProfileIterateData;
/* Non-cached profile searching */
struct CMSearchRecord {
OSType CMMType;
OSType profileClass;
OSType dataColorSpace;
OSType profileConnectionSpace;
unsigned long deviceManufacturer;
unsigned long deviceModel;
unsigned long deviceAttributes[2];
unsigned long profileFlags;
unsigned long searchMask;
CMProfileFilterUPP filter;
};
/* profile search result reference abstract data type */
struct OpaqueCMProfileSearchRef *CMProfileSearchRef;
/* XYZ color-component values */
typedef unsigned short CMXYZComponent;
/* XYZ color value */
struct CMXYZColor {
CMXYZComponent X;
CMXYZComponent Y;
CMXYZComponent Z;
};
/* fixed XYZ color value */
struct CMFixedXYZColor {
Fixed X;
Fixed Y;
Fixed Z;
};
/* L*a*b* color value */
struct CMLabColor {
unsigned short L;
unsigned short a;
unsigned short b;
};
/* L*u*v* color value */
struct CMLuvColor {
unsigned short L;
unsigned short u;
unsigned short v;
};
/* Yxy color value */
struct CMYxyColor {
unsigned short capY; /* 0..65535 maps to 0..1 */
unsigned short x; /* 0..65535 maps to 0..1 */
unsigned short y; /* 0..65535 maps to 0..1 */
};
/* RGB color value */
struct CMRGBColor {
unsigned short red;
unsigned short green;
unsigned short blue;
};
/* HLS color value */
struct CMHLSColor {
unsigned short hue;
unsigned short lightness;
unsigned short saturation;
};
/* HSV color value */
typedef struct CMHSVColor {
unsigned short hue;
unsigned short saturation;
unsigned short value;
};
/* CMYK color value */
struct CMCMYKColor {
unsigned short cyan;
unsigned short magenta;
unsigned short yellow;
unsigned short black;
};
/* CMY color value */
struct CMCMYColor {
unsigned short cyan;
unsigned short magenta;
unsigned short yellow;
};
/* HiFi color values */
struct CMMultichannel5Color {
unsigned char components[5];
};
struct CMMultichannel6Color {
unsigned char components[6];
};
struct CMMultichannel7Color {
unsigned char components[7];
};
struct CMMultichannel8Color {
unsigned char components[8];
};
/* gray color value */
struct CMGrayColor {
unsigned short gray;
};
/* named color value */
struct CMNamedColor {
unsigned long namedColorIndex; /* 0..a lot */
};
/* color union */
union CMColor {
CMRGBColor rgb;
CMHSVColor hsv;
CMHLSColor hls;
CMXYZColor XYZ;
CMLabColor Lab;
CMLuvColor Luv;
CMYxyColor Yxy;
CMCMYKColor cmyk;
CMCMYColor cmy;
CMGrayColor gray;
CMMultichannel5Color mc5;
CMMultichannel6Color mc6;
CMMultichannel7Color mc7;
CMMultichannel8Color mc8;
CMNamedColor namedColor;
};
/* ColorSync Manager bitmap */
struct CMBitmap {
char *image;
long width;
long height;
long rowBytes;
long pixelSize;
CMBitmapColorSpace space;
long user1;
long user2;
};
/* QuickDraw-specific color-matching session reference abstract data type */
struct OpaqueCMMatchRef *CMMatchRef;
/* color world information record */
struct CMCWInfoRecord {
unsigned long cmmCount;
CMMInfoRecord cmmInfo[2];
};
/* color world reference abstract data type */
struct OpaqueCMWorldRef *CMWorldRef;
/* concatenated profile set structure */
struct CMConcatProfileSet {
unsigned short keyIndex;
unsigned short count;
CMProfileRef profileSet[1];
};
/* color management module (CMM) information record structure */
struct CMMInfoRecord {
OSType CMMType;
long CMMVersion;
};
/* The video card gamma data types are new in ColorSync 2.5 */
/* video card gamma type */
struct CMVideoCardGammaType
{
OSType typeDescriptor;
unsigned long reserved;
CMVideoCardGamma gamma;
};
typedef struct CMVideoCardGammaType CMVideoCardGammaType;
/* video card gamma table */
struct CMVideoCardGammaTable
{
unsigned short channels;
unsigned short entryCount;
unsigned short entrySize;
char data[1];
};
typedef struct CMVideoCardGammaTable CMVideoCardGammaTable;
/* video card gamma formula */
struct CMVideoCardGammaFormula {
Fixed redGamma;
Fixed redMin;
Fixed redMax;
Fixed greenGamma;
Fixed greenMin;
Fixed greenMax;
Fixed blueGamma;
Fixed blueMin;
Fixed blueMax;
};
/* video card gamma */
struct CMVideoCardGamma
{
unsigned long tagType;
union
{
CMVideoCardGammaTable table;
CMVideoCardGammaFormula formula;
} u;
};
typedef struct CMVideoCardGamma CMVideoCardGamma;
/* color matching while printing */
struct TEnableColorMatchingBlk {
short iOpCode;
short iError;
long lReserved;
THPrint hPrint;
Boolean fEnableIt;
SInt8 filler;
};
/* PostScript color rendering dictionary (CRD) virtual memory size tag structure */
struct CMIntentCRDVMSize {
long rendering Intent;
unsigned long VMSize;
};
struct CMPS2CRDVMSizeType {
OSType typeDescriptor;
unsigned long reserved;
unsigned long count;
CMIntentCRDVMSize intentCRD[1];
};
/* constants for profile location type */
enum {
cmNoProfileBase = 0,
cmFileBasedProfile = 1,
cmHandleBasedProfile = 2,
cmPtrBasedProfile = 3,
cmProcedureBasedProfile = 4
};
/* commands for profile access procedure */
enum {
cmOpenReadAccess = 1,
cmOpenWriteAccess = 2,
cmReadAccess = 3,
cmWriteAccess = 4,
cmCloseAccess = 5,
cmCreateNewAccess = 6,
cmAbortWriteAccess = 7,
cmBeginAccess = 8,
cmEndAccess = 9
};
/* profile classes */
enum {
cmInputClass = 'scnr',
cmDisplayClass = 'mntr',
cmOutputClass = 'prtr',
cmLinkClass = 'link',
cmAbstractClass = 'abst',
cmColorSpaceClass = 'spac',
cmNamedColorClass = 'nmcl'
};
/* signature of ColorSync's default color management module (CMM) */
enum {
kDefaultCMMSignature = 'appl'
};
/* commands for calling the application-supplied MyColorSyncDataTransfer */
enum {
openReadSpool = 1,
openWriteSpool,
readSpool,
writeSpool,
closeSpool
};
/* PostScript data formats */
enum {
cmPS7bit = 1, /* data is 7-bit safe */
cmPS8bit = 2 /* data is 8-bit safe */
};
/* picture comment IDs for profiles and color matching */
enum {
cmBeginProfile = 220,
cmEndProfile = 221,
cmEnableMatching = 222,
cmDisableMatching = 223,
cmComment = 224
};
/* picture comment selectors for the cmComment ID */
enum {
cmBeginProfileSel = 0,
cmContinueProfileSel = 1,
cmEndProfileSel = 2,
cmProfileIdentifierSel = 3
};
/* color space signatures */
enum {
cmXYZData = 'XYZ ',
cmLabData = 'Lab ',
cmLuvData = 'Luv ',
cmYxyData = 'Yxy ',
cmRGBData = 'RGB ',
cmGrayData = 'GRAY',
cmHSVData = 'HSV ',
cmHLSData = 'HLS ',
cmCMYKData = 'CMYK',
cmCMYData = 'CMY ',
cmMCH5Data = 'MCH5',
cmMCH6Data = 'MCH6',
cmMCH7Data = 'MCH7',
cmMCH8Data = 'MCH8',
cmNamedData = 'NAME'
};
/* cm48_16ColorPacking and cm64_16ColorPacking were added in ColorSync version 2.5 */
/* color packing for color spaces */
enum {
cmNoColorPacking = 0x0000,
cmAlphaSpace = 0x0080,
cmWord5ColorPacking = 0x0500,
cmLong8ColorPacking = 0x0800,
cmLong10ColorPacking = 0x0a00,
cmAlphaFirstPacking = 0x1000,
cmOneBitDirectPacking = 0x0b00,
cmAlphaLastPacking = 0x0000,
cm24_8ColorPacking = 0x2100,
cm32_8ColorPacking = cmLong8ColorPacking,
cm40_8ColorPacking = 0x2200,
cm48_8ColorPacking = 0x2300,
cm56_8ColorPacking = 0x2400,
cm64_8ColorPacking = 0x2500,
cm32_16ColorPacking = 0x2600,
cm32_32ColorPacking = 0x2700,
cm48_16ColorPacking = 0x2900,
cm64_16ColorPacking = 0x2A00
};
/* cmRGBASpace and cmGrayASpace were moved to this enum from color space constants with
packing formats in ColorSync version 2.5 */
/* abstract color spaces */
enum {
cmNoSpace = 0,
cmRGBSpace = 1,
cmCMYKSpace = 2,
cmHSVSpace = 3,
cmHLSSpace = 4,
cmYXYSpace = 5,
cmXYZSpace = 6,
cmLUVSpace = 7,
cmLABSpace = 8,
cmReservedSpace1 = 9,
cmGraySpace = 10,
cmReservedSpace2 = 11,
cmGamutResultSpace = 12,
cmNamedIndexedSpace = 16,
cmMCFiveSpace = 17,
cmMCSixSpace = 18,
cmMCSevenSpace = 19,
cmMCEightSpace&