{ File: ColorSync/CMICCProfile.h Contains: ICC Profile Format Definitions Version: ColorSync-174.1~229 Copyright: © 1994-2006 by Apple Computer, Inc., all rights reserved. Bugs?: For bug reports, consult the following page on the World Wide Web: http://www.freepascal.org/bugs.html } { Pascal Translation Updated: Gale R Paeper, , 2007 } { Modified for use with Free Pascal Version 200 Please report any bugs to } {$mode macpas} {$packenum 1} {$macro on} {$inline on} {$CALLING MWPASCAL} unit CMICCProfile; interface {$setc UNIVERSAL_INTERFACES_VERSION := $0342} {$setc GAP_INTERFACES_VERSION := $0200} {$ifc not defined USE_CFSTR_CONSTANT_MACROS} {$setc USE_CFSTR_CONSTANT_MACROS := TRUE} {$endc} {$ifc defined CPUPOWERPC and defined CPUI386} {$error Conflicting initial definitions for CPUPOWERPC and CPUI386} {$endc} {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN} {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN} {$endc} {$ifc not defined __ppc__ and defined CPUPOWERPC} {$setc __ppc__ := 1} {$elsec} {$setc __ppc__ := 0} {$endc} {$ifc not defined __i386__ and defined CPUI386} {$setc __i386__ := 1} {$elsec} {$setc __i386__ := 0} {$endc} {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__} {$error Conflicting definitions for __ppc__ and __i386__} {$endc} {$ifc defined __ppc__ and __ppc__} {$setc TARGET_CPU_PPC := TRUE} {$setc TARGET_CPU_X86 := FALSE} {$elifc defined __i386__ and __i386__} {$setc TARGET_CPU_PPC := FALSE} {$setc TARGET_CPU_X86 := TRUE} {$elsec} {$error Neither __ppc__ nor __i386__ is defined.} {$endc} {$setc TARGET_CPU_PPC_64 := FALSE} {$ifc defined FPC_BIG_ENDIAN} {$setc TARGET_RT_BIG_ENDIAN := TRUE} {$setc TARGET_RT_LITTLE_ENDIAN := FALSE} {$elifc defined FPC_LITTLE_ENDIAN} {$setc TARGET_RT_BIG_ENDIAN := FALSE} {$setc TARGET_RT_LITTLE_ENDIAN := TRUE} {$elsec} {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.} {$endc} {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE} {$setc CALL_NOT_IN_CARBON := FALSE} {$setc OLDROUTINENAMES := FALSE} {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE} {$setc OPAQUE_UPP_TYPES := TRUE} {$setc OTCARBONAPPLICATION := TRUE} {$setc OTKERNEL := FALSE} {$setc PM_USE_SESSION_APIS := TRUE} {$setc TARGET_API_MAC_CARBON := TRUE} {$setc TARGET_API_MAC_OS8 := FALSE} {$setc TARGET_API_MAC_OSX := TRUE} {$setc TARGET_CARBON := TRUE} {$setc TARGET_CPU_68K := FALSE} {$setc TARGET_CPU_MIPS := FALSE} {$setc TARGET_CPU_SPARC := FALSE} {$setc TARGET_OS_MAC := TRUE} {$setc TARGET_OS_UNIX := FALSE} {$setc TARGET_OS_WIN32 := FALSE} {$setc TARGET_RT_MAC_68881 := FALSE} {$setc TARGET_RT_MAC_CFM := FALSE} {$setc TARGET_RT_MAC_MACHO := TRUE} {$setc TYPED_FUNCTION_POINTERS := TRUE} {$setc TYPE_BOOL := FALSE} {$setc TYPE_EXTENDED := FALSE} {$setc TYPE_LONGLONG := TRUE} uses MacTypes; {$ALIGN MAC68K} { ICC Profile version constants } const cmICCProfileVersion4 = $04000000; cmICCProfileVersion2 = $02000000; cmICCProfileVersion21 = $02100000; cmCS2ProfileVersion = $02000000; cmCS1ProfileVersion = $00000100; { ColorSync 1.0 profile version } { Current Major version number } cmProfileMajorVersionMask = $FF000000; cmCurrentProfileMajorVersion = $02000000; { magic cookie number for anonymous file ID } cmMagicNumber = $61637370 (* 'acsp' *); { ********************************************************************** } { ************** ColorSync 2.0 profile specification ******************* } { ********************************************************************** } { *** flags field *** } cmICCReservedFlagsMask = $0000FFFF; { these bits of the flags field are defined and reserved by ICC } cmEmbeddedMask = $00000001; { if bit 0 is 0 then not embedded profile, if 1 then embedded profile } cmEmbeddedUseMask = $00000002; { if bit 1 is 0 then ok to use anywhere, if 1 then ok to use as embedded profile only } cmBlackPointCompensationMask = $00000004; { if bit 1 is 0 then ok to use anywhere, if 1 then ok to use as embedded profile only } cmCMSReservedFlagsMask = $FFFF0000; { these bits of the flags field are defined and reserved by CMS vendor } cmQualityMask = $00030000; { if bits 16-17 is 0 then normal, if 1 then draft, if 2 then best } cmInterpolationMask = $00040000; { if bit 18 is 0 then interpolation, if 1 then lookup only } cmGamutCheckingMask = $00080000; { if bit 19 is 0 then create gamut checking info, if 1 then no gamut checking info } { copyright-protection flag options } cmEmbeddedProfile = 0; { 0 is not embedded profile, 1 is embedded profile } cmEmbeddedUse = 1; { 0 is to use anywhere, 1 is to use as embedded profile only } { speed and quality flag options } cmNormalMode = 0; { it uses the least significent two bits in the high word of flag } cmDraftMode = 1; { it should be evaulated like this: right shift 16 bits first, mask off the } cmBestMode = 2; { high 14 bits, and then compare with the enum to determine the option value } { black point compensation flag option } cmBlackPointCompensation = 1; { 0 do not apply Black Point Compensation, 1 apply } { *** deviceAttributes fields *** } { deviceAttributes[0] is defined by and reserved for device vendors } { deviceAttributes[1] is defined by and reserved for ICC } { The following bits of deviceAttributes[1] are currently defined } cmReflectiveTransparentMask = $00000001; { if bit 0 is 0 then reflective media, if 1 then transparency media } cmGlossyMatteMask = $00000002; { if bit 1 is 0 then glossy, if 1 then matte } { device/media attributes element values } cmReflective = 0; { if bit 0 is 0 then reflective media, if 1 then transparency media } cmGlossy = 1; { if bit 1 is 0 then glossy, if 1 then matte } { *** renderingIntent field *** } cmPerceptual = 0; { Photographic images } cmRelativeColorimetric = 1; { Logo Colors } cmSaturation = 2; { Business graphics } cmAbsoluteColorimetric = 3; { Logo Colors } { data type element values } cmAsciiData = 0; cmBinaryData = 1; { screen encodings } cmPrtrDefaultScreens = 0; { Use printer default screens. 0 is false, 1 is ture } cmLinesPer = 1; { 0 is LinesPerCm, 1 is LinesPerInch } { 2.0 tag type information } cmNumHeaderElements = 10; { public tags } cmAToB0Tag = $41324230 (* 'A2B0' *); cmAToB1Tag = $41324231 (* 'A2B1' *); cmAToB2Tag = $41324232 (* 'A2B2' *); cmBlueColorantTag = $6258595A (* 'bXYZ' *); cmBlueTRCTag = $62545243 (* 'bTRC' *); cmBToA0Tag = $42324130 (* 'B2A0' *); cmBToA1Tag = $42324131 (* 'B2A1' *); cmBToA2Tag = $42324132 (* 'B2A2' *); cmCalibrationDateTimeTag = $63616C74 (* 'calt' *); cmChromaticAdaptationTag = $63686164 (* 'chad' *); cmCharTargetTag = $74617267 (* 'targ' *); cmCopyrightTag = $63707274 (* 'cprt' *); cmDeviceMfgDescTag = $646D6E64 (* 'dmnd' *); cmDeviceModelDescTag = $646D6464 (* 'dmdd' *); cmGamutTag = $67616D74 (* 'gamt' *); cmGrayTRCTag = $6B545243 (* 'kTRC' *); cmGreenColorantTag = $6758595A (* 'gXYZ' *); cmGreenTRCTag = $67545243 (* 'gTRC' *); cmLuminanceTag = $6C756D69 (* 'lumi' *); cmMeasurementTag = $6D656173 (* 'meas' *); cmMediaBlackPointTag = $626B7074 (* 'bkpt' *); cmMediaWhitePointTag = $77747074 (* 'wtpt' *); cmNamedColorTag = $6E636F6C (* 'ncol' *); cmNamedColor2Tag = $6E636C32 (* 'ncl2' *); cmPreview0Tag = $70726530 (* 'pre0' *); cmPreview1Tag = $70726531 (* 'pre1' *); cmPreview2Tag = $70726532 (* 'pre2' *); cmProfileDescriptionTag = $64657363 (* 'desc' *); cmProfileSequenceDescTag = $70736571 (* 'pseq' *); cmPS2CRD0Tag = $70736430 (* 'psd0' *); cmPS2CRD1Tag = $70736431 (* 'psd1' *); cmPS2CRD2Tag = $70736432 (* 'psd2' *); cmPS2CRD3Tag = $70736433 (* 'psd3' *); cmPS2CSATag = $70733273 (* 'ps2s' *); cmPS2RenderingIntentTag = $70733269 (* 'ps2i' *); cmRedColorantTag = $7258595A (* 'rXYZ' *); cmRedTRCTag = $72545243 (* 'rTRC' *); cmScreeningDescTag = $73637264 (* 'scrd' *); cmScreeningTag = $7363726E (* 'scrn' *); cmTechnologyTag = $74656368 (* 'tech' *); cmUcrBgTag = $62666420 (* 'bfd ' *); cmViewingConditionsDescTag = $76756564 (* 'vued' *); cmViewingConditionsTag = $76696577 (* 'view' *); { custom tags } cmPS2CRDVMSizeTag = $7073766D (* 'psvm' *); cmVideoCardGammaTag = $76636774 (* 'vcgt' *); cmMakeAndModelTag = $6D6D6F64 (* 'mmod' *); cmProfileDescriptionMLTag = $6473636D (* 'dscm' *); cmNativeDisplayInfoTag = $6E64696E (* 'ndin' *); { public type signatures } cmSigCrdInfoType = $63726469 (* 'crdi' *); cmSigCurveType = $63757276 (* 'curv' *); cmSigDataType = $64617461 (* 'data' *); cmSigDateTimeType = $6474696D (* 'dtim' *); cmSigLut16Type = $6D667432 (* 'mft2' *); cmSigLut8Type = $6D667431 (* 'mft1' *); cmSigMeasurementType = $6D656173 (* 'meas' *); cmSigMultiFunctA2BType = $6D414220 (* 'mAB ' *); cmSigMultiFunctB2AType = $6D424120 (* 'mBA ' *); cmSigNamedColorType = $6E636F6C (* 'ncol' *); cmSigNamedColor2Type = $6E636C32 (* 'ncl2' *); cmSigParametricCurveType = $70617261 (* 'para' *); cmSigProfileDescriptionType = $64657363 (* 'desc' *); cmSigProfileSequenceDescType = $70736571 (* 'pseq' *); cmSigScreeningType = $7363726E (* 'scrn' *); cmSigS15Fixed16Type = $73663332 (* 'sf32' *); cmSigSignatureType = $73696720 (* 'sig ' *); cmSigTextType = $74657874 (* 'text' *); cmSigU16Fixed16Type = $75663332 (* 'uf32' *); cmSigU1Fixed15Type = $75663136 (* 'uf16' *); cmSigUInt8Type = $75693038 (* 'ui08' *); cmSigUInt16Type = $75693136 (* 'ui16' *); cmSigUInt32Type = $75693332 (* 'ui32' *); cmSigUInt64Type = $75693634 (* 'ui64' *); cmSigUcrBgType = $62666420 (* 'bfd ' *); cmSigUnicodeTextType = $75747874 (* 'utxt' *); cmSigViewingConditionsType = $76696577 (* 'view' *); cmSigXYZType = $58595A20 (* 'XYZ ' *); { custom type signatures } cmSigPS2CRDVMSizeType = $7073766D (* 'psvm' *); cmSigVideoCardGammaType = $76636774 (* 'vcgt' *); cmSigMakeAndModelType = $6D6D6F64 (* 'mmod' *); cmSigNativeDisplayInfoType = $6E64696E (* 'ndin' *); cmSigMultiLocalizedUniCodeType = $6D6C7563 (* 'mluc' *); { technology tag descriptions } cmTechnologyDigitalCamera = $6463616D (* 'dcam' *); cmTechnologyFilmScanner = $6673636E (* 'fscn' *); cmTechnologyReflectiveScanner = $7273636E (* 'rscn' *); cmTechnologyInkJetPrinter = $696A6574 (* 'ijet' *); cmTechnologyThermalWaxPrinter = $74776178 (* 'twax' *); cmTechnologyElectrophotographicPrinter = $6570686F (* 'epho' *); cmTechnologyElectrostaticPrinter = $65737461 (* 'esta' *); cmTechnologyDyeSublimationPrinter = $64737562 (* 'dsub' *); cmTechnologyPhotographicPaperPrinter = $7270686F (* 'rpho' *); cmTechnologyFilmWriter = $6670726E (* 'fprn' *); cmTechnologyVideoMonitor = $7669646D (* 'vidm' *); cmTechnologyVideoCamera = $76696463 (* 'vidc' *); cmTechnologyProjectionTelevision = $706A7476 (* 'pjtv' *); cmTechnologyCRTDisplay = $43525420 (* 'CRT ' *); cmTechnologyPMDisplay = $504D4420 (* 'PMD ' *); cmTechnologyAMDisplay = $414D4420 (* 'AMD ' *); cmTechnologyPhotoCD = $4B504344 (* 'KPCD' *); cmTechnologyPhotoImageSetter = $696D6773 (* 'imgs' *); cmTechnologyGravure = $67726176 (* 'grav' *); cmTechnologyOffsetLithography = $6F666673 (* 'offs' *); cmTechnologySilkscreen = $73696C6B (* 'silk' *); cmTechnologyFlexography = $666C6578 (* 'flex' *); { Measurement type encodings } { Measurement Flare } cmFlare0 = $00000000; cmFlare100 = $00000001; { Measurement Geometry } cmGeometryUnknown = $00000000; cmGeometry045or450 = $00000001; cmGeometry0dord0 = $00000002; { Standard Observer } cmStdobsUnknown = $00000000; cmStdobs1931TwoDegrees = $00000001; cmStdobs1964TenDegrees = $00000002; { Standard Illuminant } cmIlluminantUnknown = $00000000; cmIlluminantD50 = $00000001; cmIlluminantD65 = $00000002; cmIlluminantD93 = $00000003; cmIlluminantF2 = $00000004; cmIlluminantD55 = $00000005; cmIlluminantA = $00000006; cmIlluminantEquiPower = $00000007; cmIlluminantF8 = $00000008; { Spot Function Value } cmSpotFunctionUnknown = 0; cmSpotFunctionDefault = 1; cmSpotFunctionRound = 2; cmSpotFunctionDiamond = 3; cmSpotFunctionEllipse = 4; cmSpotFunctionLine = 5; cmSpotFunctionSquare = 6; cmSpotFunctionCross = 7; { Color Space Signatures } cmXYZData = $58595A20 (* 'XYZ ' *); cmLabData = $4C616220 (* 'Lab ' *); cmLuvData = $4C757620 (* 'Luv ' *); cmYCbCrData = $59436272 (* 'YCbr' *); cmYxyData = $59787920 (* 'Yxy ' *); cmRGBData = $52474220 (* 'RGB ' *); cmSRGBData = $73524742 (* 'sRGB' *); cmGrayData = $47524159 (* 'GRAY' *); cmHSVData = $48535620 (* 'HSV ' *); cmHLSData = $484C5320 (* 'HLS ' *); cmCMYKData = $434D594B (* 'CMYK' *); cmCMYData = $434D5920 (* 'CMY ' *); cmMCH5Data = $4D434835 (* 'MCH5' *); cmMCH6Data = $4D434836 (* 'MCH6' *); cmMCH7Data = $4D434837 (* 'MCH7' *); cmMCH8Data = $4D434838 (* 'MCH8' *); cm3CLRData = $33434C52 (* '3CLR' *); cm4CLRData = $34434C52 (* '4CLR' *); cm5CLRData = $35434C52 (* '5CLR' *); cm6CLRData = $36434C52 (* '6CLR' *); cm7CLRData = $37434C52 (* '7CLR' *); cm8CLRData = $38434C52 (* '8CLR' *); cm9CLRData = $39434C52 (* '9CLR' *); cm10CLRData = $41434C52 (* 'ACLR' *); cm11CLRData = $42434C52 (* 'BCLR' *); cm12CLRData = $43434C52 (* 'CCLR' *); cm13CLRData = $44434C52 (* 'DCLR' *); cm14CLRData = $45434C52 (* 'ECLR' *); cm15CLRData = $46434C52 (* 'FCLR' *); cmNamedData = $4E414D45 (* 'NAME' *); { profileClass enumerations } cmInputClass = $73636E72 (* 'scnr' *); cmDisplayClass = $6D6E7472 (* 'mntr' *); cmOutputClass = $70727472 (* 'prtr' *); cmLinkClass = $6C696E6B (* 'link' *); cmAbstractClass = $61627374 (* 'abst' *); cmColorSpaceClass = $73706163 (* 'spac' *); cmNamedColorClass = $6E6D636C (* 'nmcl' *); { platform enumerations } cmMacintosh = $4150504C (* 'APPL' *); cmMicrosoft = $4D534654 (* 'MSFT' *); cmSolaris = $53554E57 (* 'SUNW' *); cmSiliconGraphics = $53474920 (* 'SGI ' *); cmTaligent = $54474E54 (* 'TGNT' *); { parametric curve type enumerations } cmParametricType0 = 0; { Y = X^gamma } cmParametricType1 = 1; { Y = (aX+b)^gamma [X>=-b/a], Y = 0 [X<-b/a] } cmParametricType2 = 2; { Y = (aX+b)^gamma + c [X>=-b/a], Y = c [X<-b/a] } cmParametricType3 = 3; { Y = (aX+b)^gamma [X>=d], Y = cX [X=d], Y = cX+f [X 0.0 } redMin: Fixed; { must be > 0.0 and < 1.0 } redMax: Fixed; { must be > 0.0 and < 1.0 } greenGamma: Fixed; { must be > 0.0 } greenMin: Fixed; { must be > 0.0 and < 1.0 } greenMax: Fixed; { must be > 0.0 and < 1.0 } blueGamma: Fixed; { must be > 0.0 } blueMin: Fixed; { must be > 0.0 and < 1.0 } blueMax: Fixed; { must be > 0.0 and < 1.0 } end; CMVideoCardGammaPtr = ^CMVideoCardGamma; CMVideoCardGamma = record tagType: UInt32; case SInt16 of 0: ( table: CMVideoCardGammaTable; ); 1: ( formula: CMVideoCardGammaFormula; ); end; CMVideoCardGammaTypePtr = ^CMVideoCardGammaType; CMVideoCardGammaType = record typeDescriptor: OSType; { 'vcgt' = cmSigVideoCardGammaType } reserved: UInt32; { fill with 0x00 } gamma: CMVideoCardGamma; end; CMMakeAndModelPtr = ^CMMakeAndModel; CMMakeAndModel = record manufacturer: OSType; model: UInt32; serialNumber: UInt32; manufactureDate: UInt32; reserved1: UInt32; { fill with 0x00 } reserved2: UInt32; { fill with 0x00 } reserved3: UInt32; { fill with 0x00 } reserved4: UInt32; { fill with 0x00 } end; CMMakeAndModelTypePtr = ^CMMakeAndModelType; CMMakeAndModelType = record typeDescriptor: OSType; { 'mmod' = cmSigMakeAndModelType } reserved: UInt32; { fill with 0x00 } makeAndModel: CMMakeAndModel; end; CMMultiLocalizedUniCodeEntryRecPtr = ^CMMultiLocalizedUniCodeEntryRec; CMMultiLocalizedUniCodeEntryRec = record languageCode: packed array [0..1] of char; { language code from ISO-639 } regionCode: packed array [0..1] of char; { region code from ISO-3166 } textLength: UInt32; { the length in bytes of the string } textOffset: UInt32; { the offset from the start of tag in bytes } end; CMMultiLocalizedUniCodeTypePtr = ^CMMultiLocalizedUniCodeType; CMMultiLocalizedUniCodeType = record typeDescriptor: OSType; { 'mluc' = cmSigMultiLocalizedUniCodeType } reserved: UInt32; { fill with 0x00 } entryCount: UInt32; { 1-based number of name records that follow } entrySize: UInt32; { size in bytes of name records that follow } { variable-length data for storage of CMMultiLocalizedUniCodeEntryRec } { variable-length data for storage of Unicode strings } end; { ********************************************************************** } { ************** ColorSync 1.0 profile specification ******************* } { ********************************************************************** } const cmGrayResponse = 0; cmRedResponse = 1; cmGreenResponse = 2; cmBlueResponse = 3; cmCyanResponse = 4; cmMagentaResponse = 5; cmYellowResponse = 6; cmUcrResponse = 7; cmBgResponse = 8; cmOnePlusLastResponse = 9; { Device types } cmMonitorDevice = $6D6E7472 (* 'mntr' *); cmScannerDevice = $73636E72 (* 'scnr' *); cmPrinterDevice = $70727472 (* 'prtr' *); type CMIStringPtr = ^CMIString; CMIString = record theScript: ScriptCode; theString: Str63; end; { Profile options } const cmPerceptualMatch = $0000; { Default. For photographic images } cmColorimetricMatch = $0001; { Exact matching when possible } cmSaturationMatch = $0002; { For solid colors } { Profile flags } cmNativeMatchingPreferred = $00000001; { Default to native not preferred } cmTurnOffCache = $00000002; { Default to turn on CMM cache } type CMMatchOption = SInt32; CMMatchFlag = SInt32; CMHeaderPtr = ^CMHeader; CMHeader = record size: UInt32; CMMType: OSType; applProfileVersion: UInt32; dataType: OSType; deviceType: OSType; deviceManufacturer: OSType; deviceModel: UInt32; deviceAttributes: array [0..1] of UInt32; profileNameOffset: UInt32; customDataOffset: UInt32; flags: CMMatchFlag; options: CMMatchOption; white: CMXYZColor; black: CMXYZColor; end; CMProfileChromaticitiesPtr = ^CMProfileChromaticities; CMProfileChromaticities = record red: CMXYZColor; green: CMXYZColor; blue: CMXYZColor; cyan: CMXYZColor; magenta: CMXYZColor; yellow: CMXYZColor; end; CMProfileResponsePtr = ^CMProfileResponse; CMProfileResponse = record counts: array [0..8] of UInt16; data: array [0..0] of UInt16; { Variable size } end; CMProfilePtr = ^CMProfile; CMProfile = record header: CMHeader; profile: CMProfileChromaticities; response: CMProfileResponse; profileName: CMIString; customData: SInt8; { Variable size } end; CMProfileHandle = ^CMProfilePtr; {$ifc OLDROUTINENAMES} const kCMApplProfileVersion = $00000100; grayResponse = 0; redResponse = 1; greenResponse = 2; blueResponse = 3; cyanResponse = 4; magentaResponse = 5; yellowResponse = 6; ucrResponse = 7; bgResponse = 8; onePlusLastResponse = 9; rgbData = $52474220 (* 'RGB ' *); cmykData = $434D594B (* 'CMYK' *); grayData = $47524159 (* 'GRAY' *); xyzData = $58595A20 (* 'XYZ ' *); monitorDevice = $6D6E7472 (* 'mntr' *); scannerDevice = $73636E72 (* 'scnr' *); printerDevice = $70727472 (* 'prtr' *); type XYZComponent = UInt16; XYZColor = CMXYZColor; XYZColorPtr = ^XYZColor; CMResponseData = UInt16; IString = CMIString; IStringPtr = ^IString; CMResponseColor = SInt32; responseColor = CMResponseColor; {$endc} {OLDROUTINENAMES} {$ALIGN MAC68K} end.