CMApplication.pas 63 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961
  1. {
  2. File: CMApplication.p
  3. Contains: Color Matching Interfaces
  4. Version: Technology: ColorSync 3.0
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1992-2002 by Apple Computer, Inc., all rights reserved.
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit CMApplication;
  22. interface
  23. {$setc UNIVERSAL_INTERFACES_VERSION := $0342}
  24. {$setc GAP_INTERFACES_VERSION := $0200}
  25. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  26. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  27. {$endc}
  28. {$ifc defined CPUPOWERPC and defined CPUI386}
  29. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  30. {$endc}
  31. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  32. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  33. {$endc}
  34. {$ifc not defined __ppc__ and defined CPUPOWERPC}
  35. {$setc __ppc__ := 1}
  36. {$elsec}
  37. {$setc __ppc__ := 0}
  38. {$endc}
  39. {$ifc not defined __i386__ and defined CPUI386}
  40. {$setc __i386__ := 1}
  41. {$elsec}
  42. {$setc __i386__ := 0}
  43. {$endc}
  44. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  45. {$error Conflicting definitions for __ppc__ and __i386__}
  46. {$endc}
  47. {$ifc defined __ppc__ and __ppc__}
  48. {$setc TARGET_CPU_PPC := TRUE}
  49. {$setc TARGET_CPU_X86 := FALSE}
  50. {$elifc defined __i386__ and __i386__}
  51. {$setc TARGET_CPU_PPC := FALSE}
  52. {$setc TARGET_CPU_X86 := TRUE}
  53. {$elsec}
  54. {$error Neither __ppc__ nor __i386__ is defined.}
  55. {$endc}
  56. {$setc TARGET_CPU_PPC_64 := FALSE}
  57. {$ifc defined FPC_BIG_ENDIAN}
  58. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  59. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  60. {$elifc defined FPC_LITTLE_ENDIAN}
  61. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  62. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  63. {$elsec}
  64. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  65. {$endc}
  66. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  67. {$setc CALL_NOT_IN_CARBON := FALSE}
  68. {$setc OLDROUTINENAMES := FALSE}
  69. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  70. {$setc OPAQUE_UPP_TYPES := TRUE}
  71. {$setc OTCARBONAPPLICATION := TRUE}
  72. {$setc OTKERNEL := FALSE}
  73. {$setc PM_USE_SESSION_APIS := TRUE}
  74. {$setc TARGET_API_MAC_CARBON := TRUE}
  75. {$setc TARGET_API_MAC_OS8 := FALSE}
  76. {$setc TARGET_API_MAC_OSX := TRUE}
  77. {$setc TARGET_CARBON := TRUE}
  78. {$setc TARGET_CPU_68K := FALSE}
  79. {$setc TARGET_CPU_MIPS := FALSE}
  80. {$setc TARGET_CPU_SPARC := FALSE}
  81. {$setc TARGET_OS_MAC := TRUE}
  82. {$setc TARGET_OS_UNIX := FALSE}
  83. {$setc TARGET_OS_WIN32 := FALSE}
  84. {$setc TARGET_RT_MAC_68881 := FALSE}
  85. {$setc TARGET_RT_MAC_CFM := FALSE}
  86. {$setc TARGET_RT_MAC_MACHO := TRUE}
  87. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  88. {$setc TYPE_BOOL := FALSE}
  89. {$setc TYPE_EXTENDED := FALSE}
  90. {$setc TYPE_LONGLONG := TRUE}
  91. uses MacTypes,CFBase,Files,CMICCProfile,MacErrors,CMTypes,CFString,CFDictionary,Quickdraw,Printing;
  92. {$setc _DECLARE_CS_QD_API_ := 1}
  93. {$ifc TARGET_API_MAC_OS8}
  94. {$endc} {TARGET_API_MAC_OS8}
  95. {$ALIGN MAC68K}
  96. const
  97. kDefaultCMMSignature = $6170706C (* 'appl' *);
  98. { Macintosh 68K trap word }
  99. cmTrap = $ABEE;
  100. { PicComment IDs }
  101. cmBeginProfile = 220;
  102. cmEndProfile = 221;
  103. cmEnableMatching = 222;
  104. cmDisableMatching = 223;
  105. cmComment = 224;
  106. { PicComment selectors for cmComment }
  107. cmBeginProfileSel = 0;
  108. cmContinueProfileSel = 1;
  109. cmEndProfileSel = 2;
  110. cmProfileIdentifierSel = 3;
  111. { Defines for version 1.0 CMProfileSearchRecord.fieldMask }
  112. cmMatchCMMType = $00000001;
  113. cmMatchApplProfileVersion = $00000002;
  114. cmMatchDataType = $00000004;
  115. cmMatchDeviceType = $00000008;
  116. cmMatchDeviceManufacturer = $00000010;
  117. cmMatchDeviceModel = $00000020;
  118. cmMatchDeviceAttributes = $00000040;
  119. cmMatchFlags = $00000080;
  120. cmMatchOptions = $00000100;
  121. cmMatchWhite = $00000200;
  122. cmMatchBlack = $00000400;
  123. { Defines for version 2.0 CMSearchRecord.searchMask }
  124. cmMatchAnyProfile = $00000000;
  125. cmMatchProfileCMMType = $00000001;
  126. cmMatchProfileClass = $00000002;
  127. cmMatchDataColorSpace = $00000004;
  128. cmMatchProfileConnectionSpace = $00000008;
  129. cmMatchManufacturer = $00000010;
  130. cmMatchModel = $00000020;
  131. cmMatchAttributes = $00000040;
  132. cmMatchProfileFlags = $00000080;
  133. { Flags for PostScript-related functions }
  134. cmPS7bit = 1;
  135. cmPS8bit = 2;
  136. { Flags for profile embedding functions }
  137. cmEmbedWholeProfile = $00000000;
  138. cmEmbedProfileIdentifier = $00000001;
  139. { Commands for CMFlattenUPP() }
  140. cmOpenReadSpool = 1;
  141. cmOpenWriteSpool = 2;
  142. cmReadSpool = 3;
  143. cmWriteSpool = 4;
  144. cmCloseSpool = 5;
  145. { Commands for CMAccessUPP() }
  146. cmOpenReadAccess = 1;
  147. cmOpenWriteAccess = 2;
  148. cmReadAccess = 3;
  149. cmWriteAccess = 4;
  150. cmCloseAccess = 5;
  151. cmCreateNewAccess = 6;
  152. cmAbortWriteAccess = 7;
  153. cmBeginAccess = 8;
  154. cmEndAccess = 9;
  155. { Use types for CMGet/SetDefaultProfileByUse() }
  156. cmInputUse = $696E7074 (* 'inpt' *);
  157. cmOutputUse = $6F757470 (* 'outp' *);
  158. cmDisplayUse = $64706C79 (* 'dply' *);
  159. cmProofUse = $70727566 (* 'pruf' *);
  160. { Union of 1.0 and 2.0 profile header variants }
  161. type
  162. CMAppleProfileHeaderPtr = ^CMAppleProfileHeader;
  163. CMAppleProfileHeader = record
  164. case SInt16 of
  165. 0: (
  166. cm1: CMHeader;
  167. );
  168. 1: (
  169. cm2: CM2Header;
  170. );
  171. end;
  172. { CWConcatColorWorld() definitions }
  173. CMConcatProfileSetPtr = ^CMConcatProfileSet;
  174. CMConcatProfileSet = record
  175. keyIndex: UInt16; { Zero-based }
  176. count: UInt16; { Min 1 }
  177. profileSet: array [0..0] of CMProfileRef; { Variable. Ordered from Source -> Dest }
  178. end;
  179. { NCWConcatColorWorld() definitions }
  180. NCMConcatProfileSpecPtr = ^NCMConcatProfileSpec;
  181. NCMConcatProfileSpec = record
  182. renderingIntent: UInt32; { renderingIntent override }
  183. transformTag: UInt32; { transform enumerations defined below }
  184. profile: CMProfileRef; { profile }
  185. end;
  186. NCMConcatProfileSetPtr = ^NCMConcatProfileSet;
  187. NCMConcatProfileSet = record
  188. cmm: OSType; { e.g. 'KCMS', 'appl', ... uniquely ids the cmm, or 0000 }
  189. flags: UInt32; { specify quality, lookup only, no gamut checking ... }
  190. flagsMask: UInt32; { which bits of 'flags' to use to override profile }
  191. profileCount: UInt32; { how many ProfileSpecs in the following set }
  192. profileSpecs: array [0..0] of NCMConcatProfileSpec; { Variable. Ordered from Source -> Dest }
  193. end;
  194. const
  195. kNoTransform = 0; { Not used }
  196. kUseAtoB = 1; { Use 'A2B*' tag from this profile or equivalent }
  197. kUseBtoA = 2; { Use 'B2A*' tag from this profile or equivalent }
  198. kUseBtoB = 3; { Use 'pre*' tag from this profile or equivalent }
  199. { For typical device profiles the following synonyms may be useful }
  200. kDeviceToPCS = 1; { Device Dependent to Device Independent }
  201. kPCSToDevice = 2; { Device Independent to Device Dependent }
  202. kPCSToPCS = 3; { Independent, through device's gamut }
  203. kUseProfileIntent = $FFFFFFFF; { For renderingIntent in NCMConcatProfileSpec }
  204. { ColorSync color data types }
  205. type
  206. CMRGBColorPtr = ^CMRGBColor;
  207. CMRGBColor = record
  208. red: UInt16; { 0..65535 }
  209. green: UInt16;
  210. blue: UInt16;
  211. end;
  212. CMCMYKColorPtr = ^CMCMYKColor;
  213. CMCMYKColor = record
  214. cyan: UInt16; { 0..65535 }
  215. magenta: UInt16;
  216. yellow: UInt16;
  217. black: UInt16;
  218. end;
  219. CMCMYColorPtr = ^CMCMYColor;
  220. CMCMYColor = record
  221. cyan: UInt16; { 0..65535 }
  222. magenta: UInt16;
  223. yellow: UInt16;
  224. end;
  225. CMHLSColorPtr = ^CMHLSColor;
  226. CMHLSColor = record
  227. hue: UInt16; { 0..65535. Fraction of circle. Red at 0 }
  228. lightness: UInt16; { 0..65535 }
  229. saturation: UInt16; { 0..65535 }
  230. end;
  231. CMHSVColorPtr = ^CMHSVColor;
  232. CMHSVColor = record
  233. hue: UInt16; { 0..65535. Fraction of circle. Red at 0 }
  234. saturation: UInt16; { 0..65535 }
  235. value: UInt16; { 0..65535 }
  236. end;
  237. CMLabColorPtr = ^CMLabColor;
  238. CMLabColor = record
  239. L: UInt16; { 0..65535 maps to 0..100 }
  240. a: UInt16; { 0..65535 maps to -128..127.996 }
  241. b: UInt16; { 0..65535 maps to -128..127.996 }
  242. end;
  243. CMLuvColorPtr = ^CMLuvColor;
  244. CMLuvColor = record
  245. L: UInt16; { 0..65535 maps to 0..100 }
  246. u: UInt16; { 0..65535 maps to -128..127.996 }
  247. v: UInt16; { 0..65535 maps to -128..127.996 }
  248. end;
  249. CMYxyColorPtr = ^CMYxyColor;
  250. CMYxyColor = record
  251. capY: UInt16; { 0..65535 maps to 0..1 }
  252. x: UInt16; { 0..65535 maps to 0..1 }
  253. y: UInt16; { 0..65535 maps to 0..1 }
  254. end;
  255. CMGrayColorPtr = ^CMGrayColor;
  256. CMGrayColor = record
  257. gray: UInt16; { 0..65535 }
  258. end;
  259. CMMultichannel5ColorPtr = ^CMMultichannel5Color;
  260. CMMultichannel5Color = record
  261. components: packed array [0..4] of UInt8; { 0..255 }
  262. pad: UInt8; {pad byte so record size equals Apple gcc struct size}
  263. end;
  264. CMMultichannel6ColorPtr = ^CMMultichannel6Color;
  265. CMMultichannel6Color = record
  266. components: packed array [0..5] of UInt8; { 0..255 }
  267. end;
  268. CMMultichannel7ColorPtr = ^CMMultichannel7Color;
  269. CMMultichannel7Color = record
  270. components: packed array [0..6] of UInt8; { 0..255 }
  271. pad: UInt8; {pad byte so record size equals Apple gcc struct size}
  272. end;
  273. CMMultichannel8ColorPtr = ^CMMultichannel8Color;
  274. CMMultichannel8Color = record
  275. components: packed array [0..7] of UInt8; { 0..255 }
  276. end;
  277. CMNamedColorPtr = ^CMNamedColor;
  278. CMNamedColor = record
  279. namedColorIndex: UInt32; { 0..a lot }
  280. end;
  281. CMColorPtr = ^CMColor;
  282. CMColor = record
  283. case SInt16 of
  284. 0: (
  285. rgb: CMRGBColor;
  286. );
  287. 1: (
  288. hsv: CMHSVColor;
  289. );
  290. 2: (
  291. hls: CMHLSColor;
  292. );
  293. 3: (
  294. XYZ: CMXYZColor;
  295. );
  296. 4: (
  297. Lab: CMLabColor;
  298. );
  299. 5: (
  300. Luv: CMLuvColor;
  301. );
  302. 6: (
  303. Yxy: CMYxyColor;
  304. );
  305. 7: (
  306. cmyk: CMCMYKColor;
  307. );
  308. 8: (
  309. cmy: CMCMYColor;
  310. );
  311. 9: (
  312. gray: CMGrayColor;
  313. );
  314. 10: (
  315. mc5: CMMultichannel5Color;
  316. );
  317. 11: (
  318. mc6: CMMultichannel6Color;
  319. );
  320. 12: (
  321. mc7: CMMultichannel7Color;
  322. );
  323. 13: (
  324. mc8: CMMultichannel8Color;
  325. );
  326. 14: (
  327. namedColor: CMNamedColor;
  328. );
  329. end;
  330. { GetIndexedProfile() search definition }
  331. CMProfileSearchRecordPtr = ^CMProfileSearchRecord;
  332. CMProfileSearchRecord = record
  333. header: CMHeader;
  334. fieldMask: UInt32;
  335. reserved: array [0..1] of UInt32;
  336. end;
  337. CMProfileSearchRecordHandle = ^CMProfileSearchRecordPtr;
  338. { CMNewProfileSearch() search definition }
  339. CMSearchRecordPtr = ^CMSearchRecord;
  340. CMSearchRecord = record
  341. CMMType: OSType;
  342. profileClass: OSType;
  343. dataColorSpace: OSType;
  344. profileConnectionSpace: OSType;
  345. deviceManufacturer: UInt32;
  346. deviceModel: UInt32;
  347. deviceAttributes: array [0..1] of UInt32;
  348. profileFlags: UInt32;
  349. searchMask: UInt32;
  350. filter: CMProfileFilterUPP;
  351. end;
  352. { CMMIterateUPP() structure }
  353. CMMInfoPtr = ^CMMInfo;
  354. CMMInfo = record
  355. dataSize: UInt32; { Size of this structure - compatibility }
  356. CMMType: OSType; { Signature, e.g. 'appl', 'HDM ' or 'KCMS' }
  357. CMMMfr: OSType; { Vendor, e.g. 'appl' }
  358. CMMVersion: UInt32; { CMM version number }
  359. ASCIIName: packed array [0..31] of UInt8; { pascal string - name }
  360. ASCIIDesc: packed array [0..255] of UInt8; { pascal string - description or copyright }
  361. UniCodeNameCount: UniCharCount; { count of UniChars in following array }
  362. UniCodeName: array [0..31] of UniChar; { the name in UniCode chars }
  363. UniCodeDescCount: UniCharCount; { count of UniChars in following array }
  364. UniCodeDesc: array [0..255] of UniChar; { the description in UniCode chars }
  365. end;
  366. { GetCWInfo() structures }
  367. CMMInfoRecordPtr = ^CMMInfoRecord;
  368. CMMInfoRecord = record
  369. CMMType: OSType;
  370. CMMVersion: SInt32;
  371. end;
  372. CMCWInfoRecordPtr = ^CMCWInfoRecord;
  373. CMCWInfoRecord = record
  374. cmmCount: UInt32;
  375. cmmInfo: array [0..1] of CMMInfoRecord;
  376. end;
  377. { profile identifier structures }
  378. CMProfileIdentifierPtr = ^CMProfileIdentifier;
  379. CMProfileIdentifier = record
  380. profileHeader: CM2Header;
  381. calibrationDate: CMDateTime;
  382. ASCIIProfileDescriptionLen: UInt32;
  383. ASCIIProfileDescription: SInt8; { variable length }
  384. end;
  385. { colorspace masks }
  386. const
  387. cmColorSpaceSpaceMask = $0000003F;
  388. cmColorSpacePremulAlphaMask = $00000040;
  389. cmColorSpaceAlphaMask = $00000080;
  390. cmColorSpaceSpaceAndAlphaMask = $000000FF;
  391. cmColorSpacePackingMask = $0000FF00;
  392. cmColorSpaceEncodingMask = $000F0000;
  393. cmColorSpaceReservedMask = $FFF00000;
  394. { packing formats }
  395. cmNoColorPacking = $0000;
  396. cmWord5ColorPacking = $0500;
  397. cmWord565ColorPacking = $0600;
  398. cmLong8ColorPacking = $0800;
  399. cmLong10ColorPacking = $0A00;
  400. cmAlphaFirstPacking = $1000;
  401. cmOneBitDirectPacking = $0B00;
  402. cmAlphaLastPacking = $0000;
  403. cm8_8ColorPacking = $2800;
  404. cm16_8ColorPacking = $2000;
  405. cm24_8ColorPacking = $2100;
  406. cm32_8ColorPacking = $0800;
  407. cm40_8ColorPacking = $2200;
  408. cm48_8ColorPacking = $2300;
  409. cm56_8ColorPacking = $2400;
  410. cm64_8ColorPacking = $2500;
  411. cm32_16ColorPacking = $2600;
  412. cm48_16ColorPacking = $2900;
  413. cm64_16ColorPacking = $2A00;
  414. cm32_32ColorPacking = $2700;
  415. cmLittleEndianPacking = $4000;
  416. cmReverseChannelPacking = $8000;
  417. { channel encoding format }
  418. cmSRGB16ChannelEncoding = $00010000; { used for sRGB64 encoding ( ±3.12 format) }
  419. { general colorspaces }
  420. cmNoSpace = $0000;
  421. cmRGBSpace = $0001;
  422. cmCMYKSpace = $0002;
  423. cmHSVSpace = $0003;
  424. cmHLSSpace = $0004;
  425. cmYXYSpace = $0005;
  426. cmXYZSpace = $0006;
  427. cmLUVSpace = $0007;
  428. cmLABSpace = $0008;
  429. cmReservedSpace1 = $0009;
  430. cmGraySpace = $000A;
  431. cmReservedSpace2 = $000B;
  432. cmGamutResultSpace = $000C;
  433. cmNamedIndexedSpace = $0010;
  434. cmMCFiveSpace = $0011;
  435. cmMCSixSpace = $0012;
  436. cmMCSevenSpace = $0013;
  437. cmMCEightSpace = $0014;
  438. cmAlphaPmulSpace = $0040;
  439. cmAlphaSpace = $0080;
  440. cmRGBASpace = $0081;
  441. cmGrayASpace = $008A;
  442. cmRGBAPmulSpace = $00C1;
  443. cmGrayAPmulSpace = $00CA;
  444. { supported CMBitmapColorSpaces - Each of the following is a }
  445. { combination of a general colospace and a packing formats. }
  446. { Each can also be or'd with cmReverseChannelPacking. }
  447. cmGray8Space = $280A;
  448. cmGray16Space = $000A;
  449. cmGray16LSpace = $400A;
  450. cmGrayA16Space = $208A;
  451. cmGrayA32Space = $008A;
  452. cmGrayA32LSpace = $408A;
  453. cmGrayA16PmulSpace = $20CA;
  454. cmGrayA32PmulSpace = $00CA;
  455. cmGrayA32LPmulSpace = $40CA;
  456. cmRGB16Space = $0501;
  457. cmRGB16LSpace = $4501;
  458. cmRGB565Space = $0601;
  459. cmRGB565LSpace = $4601;
  460. cmRGB24Space = $2101;
  461. cmRGB32Space = $0801;
  462. cmRGB48Space = $2901;
  463. cmRGB48LSpace = $6901;
  464. cmARGB32Space = $1881;
  465. cmARGB64Space = $3A81;
  466. cmARGB64LSpace = $7A81;
  467. cmRGBA32Space = $0881;
  468. cmRGBA64Space = $2A81;
  469. cmRGBA64LSpace = $6A81;
  470. cmARGB32PmulSpace = $18C1;
  471. cmARGB64PmulSpace = $3AC1;
  472. cmARGB64LPmulSpace = $7AC1;
  473. cmRGBA32PmulSpace = $08C1;
  474. cmRGBA64PmulSpace = $2AC1;
  475. cmRGBA64LPmulSpace = $6AC1;
  476. cmCMYK32Space = $0802;
  477. cmCMYK64Space = $2A02;
  478. cmCMYK64LSpace = $6A02;
  479. cmHSV32Space = $0A03;
  480. cmHLS32Space = $0A04;
  481. cmYXY32Space = $0A05;
  482. cmXYZ24Space = $2106;
  483. cmXYZ32Space = $0A06;
  484. cmXYZ48Space = $2906;
  485. cmXYZ48LSpace = $6906;
  486. cmLUV32Space = $0A07;
  487. cmLAB24Space = $2108;
  488. cmLAB32Space = $0A08;
  489. cmLAB48Space = $2908;
  490. cmLAB48LSpace = $6908;
  491. cmGamutResult1Space = $0B0C;
  492. cmNamedIndexed32Space = $2710;
  493. cmNamedIndexed32LSpace = $6710;
  494. cmMCFive8Space = $2211;
  495. cmMCSix8Space = $2312;
  496. cmMCSeven8Space = $2413;
  497. cmMCEight8Space = $2514;
  498. type
  499. CMBitmapColorSpace = UInt32;
  500. CMBitmapPtr = ^CMBitmap;
  501. CMBitmap = record
  502. image: CStringPtr;
  503. width: SInt32;
  504. height: SInt32;
  505. rowBytes: SInt32;
  506. pixelSize: SInt32;
  507. space: CMBitmapColorSpace;
  508. user1: SInt32;
  509. user2: SInt32;
  510. end;
  511. { CMConvertXYZToXYZ() definitions }
  512. CMChromaticAdaptation = UInt32;
  513. const
  514. cmUseDefaultChromaticAdaptation = 0;
  515. cmLinearChromaticAdaptation = 1;
  516. cmVonKriesChromaticAdaptation = 2;
  517. cmBradfordChromaticAdaptation = 3;
  518. { Profile Locations }
  519. CS_MAX_PATH = 256;
  520. cmNoProfileBase = 0;
  521. cmFileBasedProfile = 1;
  522. cmHandleBasedProfile = 2;
  523. cmPtrBasedProfile = 3;
  524. cmProcedureBasedProfile = 4;
  525. cmPathBasedProfile = 5;
  526. cmBufferBasedProfile = 6;
  527. type
  528. CMFileLocationPtr = ^CMFileLocation;
  529. CMFileLocation = record
  530. spec: FSSpec;
  531. end;
  532. CMHandleLocationPtr = ^CMHandleLocation;
  533. CMHandleLocation = record
  534. h: Handle;
  535. end;
  536. CMPtrLocationPtr = ^CMPtrLocation;
  537. CMPtrLocation = record
  538. p: Ptr;
  539. end;
  540. CMProcedureLocationPtr = ^CMProcedureLocation;
  541. CMProcedureLocation = record
  542. proc: CMProfileAccessUPP;
  543. refCon: Ptr;
  544. end;
  545. CMPathLocationPtr = ^CMPathLocation;
  546. CMPathLocation = record
  547. path: packed array [0..255] of char;
  548. end;
  549. CMBufferLocationPtr = ^CMBufferLocation;
  550. CMBufferLocation = record
  551. buffer: Ptr;
  552. size: UInt32;
  553. end;
  554. CMProfLocPtr = ^CMProfLoc;
  555. CMProfLoc = record
  556. case SInt16 of
  557. 0: (
  558. fileLoc: CMFileLocation;
  559. );
  560. 1: (
  561. handleLoc: CMHandleLocation;
  562. );
  563. 2: (
  564. ptrLoc: CMPtrLocation;
  565. );
  566. 3: (
  567. procLoc: CMProcedureLocation;
  568. );
  569. 4: (
  570. pathLoc: CMPathLocation;
  571. );
  572. 5: (
  573. bufferLoc: CMBufferLocation;
  574. );
  575. end;
  576. CMProfileLocationPtr = ^CMProfileLocation;
  577. CMProfileLocation = record
  578. locType: SInt16;
  579. u: CMProfLoc;
  580. end;
  581. {$ifc TARGET_OS_MAC}
  582. const
  583. cmOriginalProfileLocationSize = 72;
  584. cmCurrentProfileLocationSize = 258;
  585. {$elsec}
  586. const
  587. cmOriginalProfileLocationSize = 258;
  588. cmCurrentProfileLocationSize = 258;
  589. {$endc} {TARGET_OS_MAC}
  590. { Typedef for Profile MD5 message digest }
  591. type
  592. CMProfileMD5 = packed array [0..15] of UInt8;
  593. CMProfileMD5Ptr = ^CMProfileMD5;
  594. { Struct and enums used for Profile iteration }
  595. const
  596. cmProfileIterateDataVersion1 = $00010000;
  597. cmProfileIterateDataVersion2 = $00020000; { Added makeAndModel }
  598. cmProfileIterateDataVersion3 = $00030000; { Added MD5 digest }
  599. type
  600. CMProfileIterateDataPtr = ^CMProfileIterateData;
  601. CMProfileIterateData = record
  602. dataVersion: UInt32; { cmProfileIterateDataVersion2 }
  603. header: CM2Header;
  604. code: ScriptCode;
  605. name: Str255;
  606. location: CMProfileLocation;
  607. uniCodeNameCount: UniCharCount;
  608. uniCodeName: UniCharPtr;
  609. asciiName: Ptr;
  610. makeAndModel: CMMakeAndModelPtr;
  611. digest: CMProfileMD5Ptr;
  612. end;
  613. { Caller-supplied callback function for Profile & CMM iteration }
  614. {$ifc TYPED_FUNCTION_POINTERS}
  615. CMProfileIterateProcPtr = function(var iterateData: CMProfileIterateData; refCon: UnivPtr): OSErr;
  616. {$elsec}
  617. CMProfileIterateProcPtr = ProcPtr;
  618. {$endc}
  619. {$ifc TYPED_FUNCTION_POINTERS}
  620. CMMIterateProcPtr = function(var iterateData: CMMInfo; refCon: UnivPtr): OSErr;
  621. {$elsec}
  622. CMMIterateProcPtr = ProcPtr;
  623. {$endc}
  624. {$ifc OPAQUE_UPP_TYPES}
  625. CMProfileIterateUPP = ^SInt32; { an opaque UPP }
  626. {$elsec}
  627. CMProfileIterateUPP = UniversalProcPtr;
  628. {$endc}
  629. {$ifc OPAQUE_UPP_TYPES}
  630. CMMIterateUPP = ^SInt32; { an opaque UPP }
  631. {$elsec}
  632. CMMIterateUPP = UniversalProcPtr;
  633. {$endc}
  634. const
  635. uppCMProfileIterateProcInfo = $000003E0;
  636. uppCMMIterateProcInfo = $000003E0;
  637. {
  638. * NewCMProfileIterateUPP()
  639. *
  640. * Availability:
  641. * Non-Carbon CFM: available as macro/inline
  642. * CarbonLib: in CarbonLib 1.0 and later
  643. * Mac OS X: in 3.0 and later
  644. }
  645. function NewCMProfileIterateUPP(userRoutine: CMProfileIterateProcPtr): CMProfileIterateUPP; external name '_NewCMProfileIterateUPP'; { old name was NewCMProfileIterateProc }
  646. {
  647. * NewCMMIterateUPP()
  648. *
  649. * Availability:
  650. * Non-Carbon CFM: available as macro/inline
  651. * CarbonLib: in CarbonLib 1.0 and later
  652. * Mac OS X: in 3.0 and later
  653. }
  654. function NewCMMIterateUPP(userRoutine: CMMIterateProcPtr): CMMIterateUPP; external name '_NewCMMIterateUPP'; { old name was NewCMMIterateProc }
  655. {
  656. * DisposeCMProfileIterateUPP()
  657. *
  658. * Availability:
  659. * Non-Carbon CFM: available as macro/inline
  660. * CarbonLib: in CarbonLib 1.0 and later
  661. * Mac OS X: in 3.0 and later
  662. }
  663. procedure DisposeCMProfileIterateUPP(userUPP: CMProfileIterateUPP); external name '_DisposeCMProfileIterateUPP';
  664. {
  665. * DisposeCMMIterateUPP()
  666. *
  667. * Availability:
  668. * Non-Carbon CFM: available as macro/inline
  669. * CarbonLib: in CarbonLib 1.0 and later
  670. * Mac OS X: in 3.0 and later
  671. }
  672. procedure DisposeCMMIterateUPP(userUPP: CMMIterateUPP); external name '_DisposeCMMIterateUPP';
  673. {
  674. * InvokeCMProfileIterateUPP()
  675. *
  676. * Availability:
  677. * Non-Carbon CFM: available as macro/inline
  678. * CarbonLib: in CarbonLib 1.0 and later
  679. * Mac OS X: in 3.0 and later
  680. }
  681. function InvokeCMProfileIterateUPP(var iterateData: CMProfileIterateData; refCon: UnivPtr; userRoutine: CMProfileIterateUPP): OSErr; external name '_InvokeCMProfileIterateUPP'; { old name was CallCMProfileIterateProc }
  682. {
  683. * InvokeCMMIterateUPP()
  684. *
  685. * Availability:
  686. * Non-Carbon CFM: available as macro/inline
  687. * CarbonLib: in CarbonLib 1.0 and later
  688. * Mac OS X: in 3.0 and later
  689. }
  690. function InvokeCMMIterateUPP(var iterateData: CMMInfo; refCon: UnivPtr; userRoutine: CMMIterateUPP): OSErr; external name '_InvokeCMMIterateUPP'; { old name was CallCMMIterateProc }
  691. { Profile file and element access }
  692. {
  693. * CMNewProfile()
  694. *
  695. * Availability:
  696. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  697. * CarbonLib: in CarbonLib 1.0 and later
  698. * Mac OS X: in 3.0 and later
  699. }
  700. function CMNewProfile(var prof: CMProfileRef; const (*var*) theProfile: CMProfileLocation): CMError; external name '_CMNewProfile';
  701. {
  702. * CMOpenProfile()
  703. *
  704. * Availability:
  705. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  706. * CarbonLib: in CarbonLib 1.0 and later
  707. * Mac OS X: in 3.0 and later
  708. }
  709. function CMOpenProfile(var prof: CMProfileRef; const (*var*) theProfile: CMProfileLocation): CMError; external name '_CMOpenProfile';
  710. {
  711. * CMCloseProfile()
  712. *
  713. * Availability:
  714. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  715. * CarbonLib: in CarbonLib 1.0 and later
  716. * Mac OS X: in 3.0 and later
  717. }
  718. function CMCloseProfile(prof: CMProfileRef): CMError; external name '_CMCloseProfile';
  719. {
  720. * CMUpdateProfile()
  721. *
  722. * Availability:
  723. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  724. * CarbonLib: in CarbonLib 1.0 and later
  725. * Mac OS X: in 3.0 and later
  726. }
  727. function CMUpdateProfile(prof: CMProfileRef): CMError; external name '_CMUpdateProfile';
  728. {
  729. * CMCopyProfile()
  730. *
  731. * Availability:
  732. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  733. * CarbonLib: in CarbonLib 1.0 and later
  734. * Mac OS X: in 3.0 and later
  735. }
  736. function CMCopyProfile(var targetProf: CMProfileRef; const (*var*) targetLocation: CMProfileLocation; srcProf: CMProfileRef): CMError; external name '_CMCopyProfile';
  737. {
  738. * CMValidateProfile()
  739. *
  740. * Availability:
  741. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  742. * CarbonLib: in CarbonLib 1.0 and later
  743. * Mac OS X: in 3.0 and later
  744. }
  745. function CMValidateProfile(prof: CMProfileRef; var valid: boolean; var preferredCMMnotfound: boolean): CMError; external name '_CMValidateProfile';
  746. {
  747. * CMGetProfileLocation()
  748. *
  749. * Availability:
  750. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  751. * CarbonLib: in CarbonLib 1.0 and later
  752. * Mac OS X: in 3.0 and later
  753. }
  754. function CMGetProfileLocation(prof: CMProfileRef; var theProfile: CMProfileLocation): CMError; external name '_CMGetProfileLocation';
  755. {
  756. * NCMGetProfileLocation()
  757. *
  758. * Availability:
  759. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  760. * CarbonLib: in CarbonLib 1.0 and later
  761. * Mac OS X: in 3.0 and later
  762. }
  763. function NCMGetProfileLocation(prof: CMProfileRef; var theProfile: CMProfileLocation; var locationSize: UInt32): CMError; external name '_NCMGetProfileLocation';
  764. {
  765. * CMFlattenProfile()
  766. *
  767. * Availability:
  768. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  769. * CarbonLib: in CarbonLib 1.0 and later
  770. * Mac OS X: in 3.0 and later
  771. }
  772. function CMFlattenProfile(prof: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UnivPtr; var preferredCMMnotfound: boolean): CMError; external name '_CMFlattenProfile';
  773. {$ifc TARGET_OS_MAC}
  774. {$ifc CALL_NOT_IN_CARBON}
  775. {
  776. * CMUnflattenProfile()
  777. *
  778. * Availability:
  779. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  780. * CarbonLib: not available
  781. * Mac OS X: not available
  782. }
  783. function CMUnflattenProfile(var resultFileSpec: FSSpec; proc: CMFlattenUPP; refCon: UnivPtr; var preferredCMMnotfound: boolean): CMError; external name '_CMUnflattenProfile';
  784. {$endc} {CALL_NOT_IN_CARBON}
  785. {$endc} {TARGET_OS_MAC}
  786. {
  787. * CMGetProfileHeader()
  788. *
  789. * Availability:
  790. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  791. * CarbonLib: in CarbonLib 1.0 and later
  792. * Mac OS X: in 3.0 and later
  793. }
  794. function CMGetProfileHeader(prof: CMProfileRef; var header: CMAppleProfileHeader): CMError; external name '_CMGetProfileHeader';
  795. {
  796. * CMSetProfileHeader()
  797. *
  798. * Availability:
  799. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  800. * CarbonLib: in CarbonLib 1.0 and later
  801. * Mac OS X: in 3.0 and later
  802. }
  803. function CMSetProfileHeader(prof: CMProfileRef; const (*var*) header: CMAppleProfileHeader): CMError; external name '_CMSetProfileHeader';
  804. {
  805. * CMProfileElementExists()
  806. *
  807. * Availability:
  808. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  809. * CarbonLib: in CarbonLib 1.0 and later
  810. * Mac OS X: in 3.0 and later
  811. }
  812. function CMProfileElementExists(prof: CMProfileRef; tag: OSType; var found: boolean): CMError; external name '_CMProfileElementExists';
  813. {
  814. * CMCountProfileElements()
  815. *
  816. * Availability:
  817. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  818. * CarbonLib: in CarbonLib 1.0 and later
  819. * Mac OS X: in 3.0 and later
  820. }
  821. function CMCountProfileElements(prof: CMProfileRef; var elementCount: UInt32): CMError; external name '_CMCountProfileElements';
  822. {
  823. * CMGetProfileElement()
  824. *
  825. * Availability:
  826. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  827. * CarbonLib: in CarbonLib 1.0 and later
  828. * Mac OS X: in 3.0 and later
  829. }
  830. function CMGetProfileElement(prof: CMProfileRef; tag: OSType; var elementSize: UInt32; elementData: UnivPtr): CMError; external name '_CMGetProfileElement';
  831. {
  832. * CMSetProfileElement()
  833. *
  834. * Availability:
  835. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  836. * CarbonLib: in CarbonLib 1.0 and later
  837. * Mac OS X: in 3.0 and later
  838. }
  839. function CMSetProfileElement(prof: CMProfileRef; tag: OSType; elementSize: UInt32; elementData: UnivPtr): CMError; external name '_CMSetProfileElement';
  840. {
  841. * CMSetProfileElementSize()
  842. *
  843. * Availability:
  844. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  845. * CarbonLib: in CarbonLib 1.0 and later
  846. * Mac OS X: in 3.0 and later
  847. }
  848. function CMSetProfileElementSize(prof: CMProfileRef; tag: OSType; elementSize: UInt32): CMError; external name '_CMSetProfileElementSize';
  849. {
  850. * CMSetProfileElementReference()
  851. *
  852. * Availability:
  853. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  854. * CarbonLib: in CarbonLib 1.0 and later
  855. * Mac OS X: in 3.0 and later
  856. }
  857. function CMSetProfileElementReference(prof: CMProfileRef; elementTag: OSType; referenceTag: OSType): CMError; external name '_CMSetProfileElementReference';
  858. {
  859. * CMGetPartialProfileElement()
  860. *
  861. * Availability:
  862. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  863. * CarbonLib: in CarbonLib 1.0 and later
  864. * Mac OS X: in 3.0 and later
  865. }
  866. function CMGetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: UInt32; var byteCount: UInt32; elementData: UnivPtr): CMError; external name '_CMGetPartialProfileElement';
  867. {
  868. * CMSetPartialProfileElement()
  869. *
  870. * Availability:
  871. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  872. * CarbonLib: in CarbonLib 1.0 and later
  873. * Mac OS X: in 3.0 and later
  874. }
  875. function CMSetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: UInt32; byteCount: UInt32; elementData: UnivPtr): CMError; external name '_CMSetPartialProfileElement';
  876. {
  877. * CMGetIndProfileElementInfo()
  878. *
  879. * Availability:
  880. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  881. * CarbonLib: in CarbonLib 1.0 and later
  882. * Mac OS X: in 3.0 and later
  883. }
  884. function CMGetIndProfileElementInfo(prof: CMProfileRef; index: UInt32; var tag: OSType; var elementSize: UInt32; var refs: boolean): CMError; external name '_CMGetIndProfileElementInfo';
  885. {
  886. * CMGetIndProfileElement()
  887. *
  888. * Availability:
  889. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  890. * CarbonLib: in CarbonLib 1.0 and later
  891. * Mac OS X: in 3.0 and later
  892. }
  893. function CMGetIndProfileElement(prof: CMProfileRef; index: UInt32; var elementSize: UInt32; elementData: UnivPtr): CMError; external name '_CMGetIndProfileElement';
  894. {
  895. * CMRemoveProfileElement()
  896. *
  897. * Availability:
  898. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  899. * CarbonLib: in CarbonLib 1.0 and later
  900. * Mac OS X: in 3.0 and later
  901. }
  902. function CMRemoveProfileElement(prof: CMProfileRef; tag: OSType): CMError; external name '_CMRemoveProfileElement';
  903. {
  904. * CMGetScriptProfileDescription()
  905. *
  906. * Availability:
  907. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  908. * CarbonLib: in CarbonLib 1.0 and later
  909. * Mac OS X: in 3.0 and later
  910. }
  911. function CMGetScriptProfileDescription(prof: CMProfileRef; var name: Str255; var code: ScriptCode): CMError; external name '_CMGetScriptProfileDescription';
  912. {
  913. * CMGetProfileDescriptions()
  914. *
  915. * Availability:
  916. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  917. * CarbonLib: in CarbonLib 1.0 and later
  918. * Mac OS X: in 3.0 and later
  919. }
  920. function CMGetProfileDescriptions(prof: CMProfileRef; aName: CStringPtr; var aCount: UInt32; var mName: Str255; var mCode: ScriptCode; var uName: UniChar; var uCount: UniCharCount): CMError; external name '_CMGetProfileDescriptions';
  921. {
  922. * CMSetProfileDescriptions()
  923. *
  924. * Availability:
  925. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  926. * CarbonLib: in CarbonLib 1.0 and later
  927. * Mac OS X: in 3.0 and later
  928. }
  929. function CMSetProfileDescriptions(prof: CMProfileRef; aName: ConstCStringPtr; aCount: UInt32; const (*var*) mName: Str255; mCode: ScriptCode; uName: ConstUniCharPtr; uCount: UniCharCount): CMError; external name '_CMSetProfileDescriptions';
  930. {
  931. * CMCopyProfileLocalizedStringDictionary()
  932. *
  933. * Availability:
  934. * Non-Carbon CFM: in ColorSyncLib 3.1 and later
  935. * CarbonLib: not available
  936. * Mac OS X: in 3.1 and later
  937. }
  938. function CMCopyProfileLocalizedStringDictionary(prof: CMProfileRef; tag: OSType; var theDict: CFDictionaryRef): CMError; external name '_CMCopyProfileLocalizedStringDictionary';
  939. {
  940. * CMSetProfileLocalizedStringDictionary()
  941. *
  942. * Availability:
  943. * Non-Carbon CFM: in ColorSyncLib 3.1 and later
  944. * CarbonLib: not available
  945. * Mac OS X: in 3.1 and later
  946. }
  947. function CMSetProfileLocalizedStringDictionary(prof: CMProfileRef; tag: OSType; theDict: CFDictionaryRef): CMError; external name '_CMSetProfileLocalizedStringDictionary';
  948. {
  949. * CMCopyProfileLocalizedString()
  950. *
  951. * Availability:
  952. * Non-Carbon CFM: in ColorSyncLib 3.1 and later
  953. * CarbonLib: not available
  954. * Mac OS X: in 3.1 and later
  955. }
  956. function CMCopyProfileLocalizedString(prof: CMProfileRef; tag: OSType; reqLocale: CFStringRef; var locale: CFStringRef; var str: CFStringRef): CMError; external name '_CMCopyProfileLocalizedString';
  957. {
  958. * CMCloneProfileRef()
  959. *
  960. * Availability:
  961. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  962. * CarbonLib: in CarbonLib 1.0 and later
  963. * Mac OS X: in 3.0 and later
  964. }
  965. function CMCloneProfileRef(prof: CMProfileRef): CMError; external name '_CMCloneProfileRef';
  966. {
  967. * CMGetProfileRefCount()
  968. *
  969. * Availability:
  970. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  971. * CarbonLib: in CarbonLib 1.0 and later
  972. * Mac OS X: in 3.0 and later
  973. }
  974. function CMGetProfileRefCount(prof: CMProfileRef; var count: SInt32): CMError; external name '_CMGetProfileRefCount';
  975. {
  976. * CMProfileModified()
  977. *
  978. * Availability:
  979. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  980. * CarbonLib: in CarbonLib 1.0 and later
  981. * Mac OS X: in 3.0 and later
  982. }
  983. function CMProfileModified(prof: CMProfileRef; var modified: boolean): CMError; external name '_CMProfileModified';
  984. {
  985. * CMGetProfileMD5()
  986. *
  987. * Availability:
  988. * Non-Carbon CFM: not available
  989. * CarbonLib: not available
  990. * Mac OS X: in 3.1 and later
  991. }
  992. function CMGetProfileMD5(prof: CMProfileRef; var digest: CMProfileMD5): CMError; external name '_CMGetProfileMD5';
  993. { named Color access functions }
  994. {
  995. * CMGetNamedColorInfo()
  996. *
  997. * Availability:
  998. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  999. * CarbonLib: in CarbonLib 1.0 and later
  1000. * Mac OS X: in 3.0 and later
  1001. }
  1002. function CMGetNamedColorInfo(prof: CMProfileRef; var deviceChannels: UInt32; var deviceColorSpace: OSType; var PCSColorSpace: OSType; var count: UInt32; prefix: StringPtr; suffix: StringPtr): CMError; external name '_CMGetNamedColorInfo';
  1003. {
  1004. * CMGetNamedColorValue()
  1005. *
  1006. * Availability:
  1007. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1008. * CarbonLib: in CarbonLib 1.0 and later
  1009. * Mac OS X: in 3.0 and later
  1010. }
  1011. function CMGetNamedColorValue(prof: CMProfileRef; name: StringPtr; var deviceColor: CMColor; var PCSColor: CMColor): CMError; external name '_CMGetNamedColorValue';
  1012. {
  1013. * CMGetIndNamedColorValue()
  1014. *
  1015. * Availability:
  1016. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1017. * CarbonLib: in CarbonLib 1.0 and later
  1018. * Mac OS X: in 3.0 and later
  1019. }
  1020. function CMGetIndNamedColorValue(prof: CMProfileRef; index: UInt32; var deviceColor: CMColor; var PCSColor: CMColor): CMError; external name '_CMGetIndNamedColorValue';
  1021. {
  1022. * CMGetNamedColorIndex()
  1023. *
  1024. * Availability:
  1025. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1026. * CarbonLib: in CarbonLib 1.0 and later
  1027. * Mac OS X: in 3.0 and later
  1028. }
  1029. function CMGetNamedColorIndex(prof: CMProfileRef; name: StringPtr; var index: UInt32): CMError; external name '_CMGetNamedColorIndex';
  1030. {
  1031. * CMGetNamedColorName()
  1032. *
  1033. * Availability:
  1034. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1035. * CarbonLib: in CarbonLib 1.0 and later
  1036. * Mac OS X: in 3.0 and later
  1037. }
  1038. function CMGetNamedColorName(prof: CMProfileRef; index: UInt32; name: StringPtr): CMError; external name '_CMGetNamedColorName';
  1039. { General-purpose matching functions }
  1040. {
  1041. * NCWNewColorWorld()
  1042. *
  1043. * Availability:
  1044. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1045. * CarbonLib: in CarbonLib 1.0 and later
  1046. * Mac OS X: in 3.0 and later
  1047. }
  1048. function NCWNewColorWorld(var cw: CMWorldRef; src: CMProfileRef; dst: CMProfileRef): CMError; external name '_NCWNewColorWorld';
  1049. {
  1050. * CWConcatColorWorld()
  1051. *
  1052. * Availability:
  1053. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1054. * CarbonLib: in CarbonLib 1.0 and later
  1055. * Mac OS X: in 3.0 and later
  1056. }
  1057. function CWConcatColorWorld(var cw: CMWorldRef; var profileSet: CMConcatProfileSet): CMError; external name '_CWConcatColorWorld';
  1058. {
  1059. * CWNewLinkProfile()
  1060. *
  1061. * Availability:
  1062. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1063. * CarbonLib: in CarbonLib 1.0 and later
  1064. * Mac OS X: in 3.0 and later
  1065. }
  1066. function CWNewLinkProfile(var prof: CMProfileRef; const (*var*) targetLocation: CMProfileLocation; var profileSet: CMConcatProfileSet): CMError; external name '_CWNewLinkProfile';
  1067. {
  1068. * NCWConcatColorWorld()
  1069. *
  1070. * Availability:
  1071. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1072. * CarbonLib: in CarbonLib 1.0 and later
  1073. * Mac OS X: in 3.0 and later
  1074. }
  1075. function NCWConcatColorWorld(var cw: CMWorldRef; var profileSet: NCMConcatProfileSet; proc: CMConcatCallBackUPP; refCon: UnivPtr): CMError; external name '_NCWConcatColorWorld';
  1076. {
  1077. * NCWNewLinkProfile()
  1078. *
  1079. * Availability:
  1080. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1081. * CarbonLib: in CarbonLib 1.0 and later
  1082. * Mac OS X: in 3.0 and later
  1083. }
  1084. function NCWNewLinkProfile(var prof: CMProfileRef; const (*var*) targetLocation: CMProfileLocation; var profileSet: NCMConcatProfileSet; proc: CMConcatCallBackUPP; refCon: UnivPtr): CMError; external name '_NCWNewLinkProfile';
  1085. {
  1086. * CWDisposeColorWorld()
  1087. *
  1088. * Availability:
  1089. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1090. * CarbonLib: in CarbonLib 1.0 and later
  1091. * Mac OS X: in 3.0 and later
  1092. }
  1093. procedure CWDisposeColorWorld(cw: CMWorldRef); external name '_CWDisposeColorWorld';
  1094. {
  1095. * CWMatchColors()
  1096. *
  1097. * Availability:
  1098. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1099. * CarbonLib: in CarbonLib 1.0 and later
  1100. * Mac OS X: in 3.0 and later
  1101. }
  1102. function CWMatchColors(cw: CMWorldRef; var myColors: CMColor; count: UInt32): CMError; external name '_CWMatchColors';
  1103. {
  1104. * CWCheckColors()
  1105. *
  1106. * Availability:
  1107. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1108. * CarbonLib: in CarbonLib 1.0 and later
  1109. * Mac OS X: in 3.0 and later
  1110. }
  1111. function CWCheckColors(cw: CMWorldRef; var myColors: CMColor; count: UInt32; var result: UInt32): CMError; external name '_CWCheckColors';
  1112. {
  1113. * CWMatchBitmap()
  1114. *
  1115. * Availability:
  1116. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1117. * CarbonLib: in CarbonLib 1.0 and later
  1118. * Mac OS X: in 3.0 and later
  1119. }
  1120. function CWMatchBitmap(cw: CMWorldRef; var bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UnivPtr; var matchedBitmap: CMBitmap): CMError; external name '_CWMatchBitmap';
  1121. {
  1122. * CWCheckBitmap()
  1123. *
  1124. * Availability:
  1125. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1126. * CarbonLib: in CarbonLib 1.0 and later
  1127. * Mac OS X: in 3.0 and later
  1128. }
  1129. function CWCheckBitmap(cw: CMWorldRef; const (*var*) bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UnivPtr; var resultBitmap: CMBitmap): CMError; external name '_CWCheckBitmap';
  1130. { Quickdraw-specific matching }
  1131. {$ifc TARGET_OS_MAC AND _DECLARE_CS_QD_API_}
  1132. {
  1133. * CWMatchPixMap()
  1134. *
  1135. * Availability:
  1136. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1137. * CarbonLib: in CarbonLib 1.0 and later
  1138. * Mac OS X: not available
  1139. }
  1140. function CWMatchPixMap(cw: CMWorldRef; var myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UnivPtr): CMError; external name '_CWMatchPixMap';
  1141. {
  1142. * CWCheckPixMap()
  1143. *
  1144. * Availability:
  1145. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1146. * CarbonLib: in CarbonLib 1.0 and later
  1147. * Mac OS X: not available
  1148. }
  1149. function CWCheckPixMap(cw: CMWorldRef; var myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UnivPtr; var resultBitMap: BitMap): CMError; external name '_CWCheckPixMap';
  1150. {
  1151. * NCMBeginMatching()
  1152. *
  1153. * Availability:
  1154. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1155. * CarbonLib: in CarbonLib 1.0 and later
  1156. * Mac OS X: not available
  1157. }
  1158. function NCMBeginMatching(src: CMProfileRef; dst: CMProfileRef; var myRef: CMMatchRef): CMError; external name '_NCMBeginMatching';
  1159. {
  1160. * CMEndMatching()
  1161. *
  1162. * Availability:
  1163. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1164. * CarbonLib: in CarbonLib 1.0 and later
  1165. * Mac OS X: not available
  1166. }
  1167. procedure CMEndMatching(myRef: CMMatchRef); external name '_CMEndMatching';
  1168. {
  1169. * NCMDrawMatchedPicture()
  1170. *
  1171. * Availability:
  1172. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1173. * CarbonLib: in CarbonLib 1.0 and later
  1174. * Mac OS X: not available
  1175. }
  1176. procedure NCMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileRef; var myRect: Rect); external name '_NCMDrawMatchedPicture';
  1177. {
  1178. * CMEnableMatchingComment()
  1179. *
  1180. * Availability:
  1181. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1182. * CarbonLib: in CarbonLib 1.0 and later
  1183. * Mac OS X: not available
  1184. }
  1185. procedure CMEnableMatchingComment(enableIt: boolean); external name '_CMEnableMatchingComment';
  1186. {
  1187. * NCMUseProfileComment()
  1188. *
  1189. * Availability:
  1190. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1191. * CarbonLib: in CarbonLib 1.0 and later
  1192. * Mac OS X: not available
  1193. }
  1194. function NCMUseProfileComment(prof: CMProfileRef; flags: UInt32): CMError; external name '_NCMUseProfileComment';
  1195. {$endc}
  1196. {$ifc TARGET_OS_WIN32}
  1197. {$ifc CALL_NOT_IN_CARBON}
  1198. {
  1199. * CWMatchHBITMAP()
  1200. *
  1201. * Availability:
  1202. * Non-Carbon CFM: not available
  1203. * CarbonLib: not available
  1204. * Mac OS X: not available
  1205. }
  1206. function CWMatchHBITMAP(cw: CMWorldRef; hBitmap_: HBITMAP; progressProc: CMBitmapCallBackUPP; refCon: UnivPtr): CMError; external name '_CWMatchHBITMAP';
  1207. {$endc} {CALL_NOT_IN_CARBON}
  1208. {$endc} {TARGET_OS_WIN32}
  1209. {
  1210. * CMCreateProfileIdentifier()
  1211. *
  1212. * Availability:
  1213. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1214. * CarbonLib: in CarbonLib 1.0 and later
  1215. * Mac OS X: in 3.0 and later
  1216. }
  1217. function CMCreateProfileIdentifier(prof: CMProfileRef; ident: CMProfileIdentifierPtr; var size: UInt32): CMError; external name '_CMCreateProfileIdentifier';
  1218. { System Profile access }
  1219. {
  1220. * CMGetSystemProfile()
  1221. *
  1222. * Availability:
  1223. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1224. * CarbonLib: in CarbonLib 1.0 and later
  1225. * Mac OS X: in 3.0 and later
  1226. }
  1227. function CMGetSystemProfile(var prof: CMProfileRef): CMError; external name '_CMGetSystemProfile';
  1228. {
  1229. * CMSetSystemProfile()
  1230. *
  1231. * Availability:
  1232. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1233. * CarbonLib: in CarbonLib 1.0 and later
  1234. * Mac OS X: in 3.0 and later
  1235. }
  1236. function CMSetSystemProfile(const (*var*) profileFileSpec: FSSpec): CMError; external name '_CMSetSystemProfile';
  1237. {
  1238. * NCMSetSystemProfile()
  1239. *
  1240. * Availability:
  1241. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1242. * CarbonLib: in CarbonLib 1.0 and later
  1243. * Mac OS X: in 3.0 and later
  1244. }
  1245. function NCMSetSystemProfile(const (*var*) profLoc: CMProfileLocation): CMError; external name '_NCMSetSystemProfile';
  1246. {
  1247. * CMGetDefaultProfileBySpace()
  1248. *
  1249. * Availability:
  1250. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1251. * CarbonLib: in CarbonLib 1.0 and later
  1252. * Mac OS X: in 3.0 and later
  1253. }
  1254. function CMGetDefaultProfileBySpace(dataColorSpace: OSType; var prof: CMProfileRef): CMError; external name '_CMGetDefaultProfileBySpace';
  1255. {
  1256. * CMSetDefaultProfileBySpace()
  1257. *
  1258. * Availability:
  1259. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1260. * CarbonLib: in CarbonLib 1.0 and later
  1261. * Mac OS X: in 3.0 and later
  1262. }
  1263. function CMSetDefaultProfileBySpace(dataColorSpace: OSType; prof: CMProfileRef): CMError; external name '_CMSetDefaultProfileBySpace';
  1264. {$ifc TARGET_OS_MAC}
  1265. {
  1266. * CMGetProfileByAVID()
  1267. *
  1268. * Availability:
  1269. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1270. * CarbonLib: in CarbonLib 1.0 and later
  1271. * Mac OS X: in 3.0 and later
  1272. }
  1273. function CMGetProfileByAVID(theID: CMDisplayIDType; var prof: CMProfileRef): CMError; external name '_CMGetProfileByAVID';
  1274. {
  1275. * CMSetProfileByAVID()
  1276. *
  1277. * Availability:
  1278. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1279. * CarbonLib: in CarbonLib 1.0 and later
  1280. * Mac OS X: in 3.0 and later
  1281. }
  1282. function CMSetProfileByAVID(theID: CMDisplayIDType; prof: CMProfileRef): CMError; external name '_CMSetProfileByAVID';
  1283. {
  1284. * CMGetGammaByAVID()
  1285. *
  1286. * Availability:
  1287. * Non-Carbon CFM: in ColorSyncLib 3.0 and later
  1288. * CarbonLib: in CarbonLib 1.0 and later
  1289. * Mac OS X: in 3.0 and later
  1290. }
  1291. function CMGetGammaByAVID(theID: CMDisplayIDType; var gamma: CMVideoCardGamma; var size: UInt32): CMError; external name '_CMGetGammaByAVID';
  1292. {
  1293. * CMSetGammaByAVID()
  1294. *
  1295. * Availability:
  1296. * Non-Carbon CFM: in ColorSyncLib 3.0 and later
  1297. * CarbonLib: in CarbonLib 1.0 and later
  1298. * Mac OS X: in 3.0 and later
  1299. }
  1300. function CMSetGammaByAVID(theID: CMDisplayIDType; var gamma: CMVideoCardGamma): CMError; external name '_CMSetGammaByAVID';
  1301. {$endc} {TARGET_OS_MAC}
  1302. { Profile access by Use }
  1303. {
  1304. * CMGetDefaultProfileByUse()
  1305. *
  1306. * Availability:
  1307. * Non-Carbon CFM: in ColorSyncLib 3.0 and later
  1308. * CarbonLib: in CarbonLib 1.0 and later
  1309. * Mac OS X: in 3.0 and later
  1310. }
  1311. function CMGetDefaultProfileByUse(use: OSType; var prof: CMProfileRef): CMError; external name '_CMGetDefaultProfileByUse';
  1312. {
  1313. * CMSetDefaultProfileByUse()
  1314. *
  1315. * Availability:
  1316. * Non-Carbon CFM: in ColorSyncLib 3.0 and later
  1317. * CarbonLib: in CarbonLib 1.0 and later
  1318. * Mac OS X: in 3.0 and later
  1319. }
  1320. function CMSetDefaultProfileByUse(use: OSType; prof: CMProfileRef): CMError; external name '_CMSetDefaultProfileByUse';
  1321. { Profile Management }
  1322. {
  1323. * CMNewProfileSearch()
  1324. *
  1325. * Availability:
  1326. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1327. * CarbonLib: in CarbonLib 1.0 and later
  1328. * Mac OS X: in 3.0 and later
  1329. }
  1330. function CMNewProfileSearch(var searchSpec: CMSearchRecord; refCon: UnivPtr; var count: UInt32; var searchResult: CMProfileSearchRef): CMError; external name '_CMNewProfileSearch';
  1331. {
  1332. * CMUpdateProfileSearch()
  1333. *
  1334. * Availability:
  1335. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1336. * CarbonLib: in CarbonLib 1.0 and later
  1337. * Mac OS X: in 3.0 and later
  1338. }
  1339. function CMUpdateProfileSearch(search: CMProfileSearchRef; refCon: UnivPtr; var count: UInt32): CMError; external name '_CMUpdateProfileSearch';
  1340. {
  1341. * CMDisposeProfileSearch()
  1342. *
  1343. * Availability:
  1344. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1345. * CarbonLib: in CarbonLib 1.0 and later
  1346. * Mac OS X: in 3.0 and later
  1347. }
  1348. procedure CMDisposeProfileSearch(search: CMProfileSearchRef); external name '_CMDisposeProfileSearch';
  1349. {
  1350. * CMSearchGetIndProfile()
  1351. *
  1352. * Availability:
  1353. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1354. * CarbonLib: in CarbonLib 1.0 and later
  1355. * Mac OS X: in 3.0 and later
  1356. }
  1357. function CMSearchGetIndProfile(search: CMProfileSearchRef; index: UInt32; var prof: CMProfileRef): CMError; external name '_CMSearchGetIndProfile';
  1358. {
  1359. * CMSearchGetIndProfileFileSpec()
  1360. *
  1361. * Availability:
  1362. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1363. * CarbonLib: in CarbonLib 1.0 and later
  1364. * Mac OS X: in 3.0 and later
  1365. }
  1366. function CMSearchGetIndProfileFileSpec(search: CMProfileSearchRef; index: UInt32; var profileFile: FSSpec): CMError; external name '_CMSearchGetIndProfileFileSpec';
  1367. {
  1368. * CMProfileIdentifierFolderSearch()
  1369. *
  1370. * Availability:
  1371. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1372. * CarbonLib: in CarbonLib 1.0 and later
  1373. * Mac OS X: in 3.0 and later
  1374. }
  1375. function CMProfileIdentifierFolderSearch(ident: CMProfileIdentifierPtr; var matchedCount: UInt32; var searchResult: CMProfileSearchRef): CMError; external name '_CMProfileIdentifierFolderSearch';
  1376. {
  1377. * CMProfileIdentifierListSearch()
  1378. *
  1379. * Availability:
  1380. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1381. * CarbonLib: in CarbonLib 1.0 and later
  1382. * Mac OS X: in 3.0 and later
  1383. }
  1384. function CMProfileIdentifierListSearch(ident: CMProfileIdentifierPtr; var profileList: CMProfileRef; listSize: UInt32; var matchedCount: UInt32; var matchedList: CMProfileRef): CMError; external name '_CMProfileIdentifierListSearch';
  1385. {
  1386. * CMIterateColorSyncFolder()
  1387. *
  1388. * Availability:
  1389. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1390. * CarbonLib: in CarbonLib 1.0 and later
  1391. * Mac OS X: in 3.0 and later
  1392. }
  1393. function CMIterateColorSyncFolder(proc: CMProfileIterateUPP; var seed: UInt32; var count: UInt32; refCon: UnivPtr): CMError; external name '_CMIterateColorSyncFolder';
  1394. {
  1395. * NCMUnflattenProfile()
  1396. *
  1397. * Availability:
  1398. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1399. * CarbonLib: in CarbonLib 1.0 and later
  1400. * Mac OS X: in 3.0 and later
  1401. }
  1402. function NCMUnflattenProfile(var targetLocation: CMProfileLocation; proc: CMFlattenUPP; refCon: UnivPtr; var preferredCMMnotfound: boolean): CMError; external name '_NCMUnflattenProfile';
  1403. { Utilities }
  1404. {$ifc TARGET_OS_MAC}
  1405. {
  1406. * CMGetColorSyncFolderSpec()
  1407. *
  1408. * Availability:
  1409. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1410. * CarbonLib: in CarbonLib 1.0 and later
  1411. * Mac OS X: in 3.0 and later
  1412. }
  1413. function CMGetColorSyncFolderSpec(vRefNum: SInt16; createFolder: boolean; var foundVRefNum: SInt16; var foundDirID: SInt32): CMError; external name '_CMGetColorSyncFolderSpec';
  1414. {$endc} {TARGET_OS_MAC}
  1415. {$ifc TARGET_OS_WIN32 OR TARGET_OS_UNIX}
  1416. {$ifc CALL_NOT_IN_CARBON}
  1417. {
  1418. * CMGetColorSyncFolderPath()
  1419. *
  1420. * Availability:
  1421. * Non-Carbon CFM: not available
  1422. * CarbonLib: not available
  1423. * Mac OS X: not available
  1424. }
  1425. function CMGetColorSyncFolderPath(createFolder: boolean; lpBuffer: CStringPtr; uSize: UInt32): CMError; external name '_CMGetColorSyncFolderPath';
  1426. {$endc} {CALL_NOT_IN_CARBON}
  1427. {$endc}
  1428. {
  1429. * CMGetCWInfo()
  1430. *
  1431. * Availability:
  1432. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1433. * CarbonLib: in CarbonLib 1.0 and later
  1434. * Mac OS X: in 3.0 and later
  1435. }
  1436. function CMGetCWInfo(cw: CMWorldRef; var info: CMCWInfoRecord): CMError; external name '_CMGetCWInfo';
  1437. {$ifc TARGET_API_MAC_OS8}
  1438. {$ifc CALL_NOT_IN_CARBON}
  1439. {
  1440. * CMConvertProfile2to1()
  1441. *
  1442. * Availability:
  1443. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1444. * CarbonLib: not available
  1445. * Mac OS X: not available
  1446. }
  1447. function CMConvertProfile2to1(profv2: CMProfileRef; var profv1: CMProfileHandle): CMError; external name '_CMConvertProfile2to1';
  1448. {$endc} {CALL_NOT_IN_CARBON}
  1449. {$endc} {TARGET_API_MAC_OS8}
  1450. {
  1451. * CMGetPreferredCMM()
  1452. *
  1453. * Availability:
  1454. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1455. * CarbonLib: in CarbonLib 1.0 and later
  1456. * Mac OS X: in 3.0 and later
  1457. }
  1458. function CMGetPreferredCMM(var cmmType: OSType; var preferredCMMnotfound: boolean): CMError; external name '_CMGetPreferredCMM';
  1459. {
  1460. * CMIterateCMMInfo()
  1461. *
  1462. * Availability:
  1463. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1464. * CarbonLib: in CarbonLib 1.0 and later
  1465. * Mac OS X: in 3.0 and later
  1466. }
  1467. function CMIterateCMMInfo(proc: CMMIterateUPP; var count: UInt32; refCon: UnivPtr): CMError; external name '_CMIterateCMMInfo';
  1468. {
  1469. * CMGetColorSyncVersion()
  1470. *
  1471. * Availability:
  1472. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1473. * CarbonLib: in CarbonLib 1.0 and later
  1474. * Mac OS X: in 3.0 and later
  1475. }
  1476. function CMGetColorSyncVersion(var version: UInt32): CMError; external name '_CMGetColorSyncVersion';
  1477. {
  1478. * CMLaunchControlPanel()
  1479. *
  1480. * Availability:
  1481. * Non-Carbon CFM: in ColorSyncLib 3.0 and later
  1482. * CarbonLib: in CarbonLib 1.0 and later
  1483. * Mac OS X: in 3.0 and later
  1484. }
  1485. function CMLaunchControlPanel(flags: UInt32): CMError; external name '_CMLaunchControlPanel';
  1486. { ColorSpace conversion functions }
  1487. {
  1488. * CMConvertXYZToLab()
  1489. *
  1490. * Availability:
  1491. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1492. * CarbonLib: in CarbonLib 1.0 and later
  1493. * Mac OS X: in 3.0 and later
  1494. }
  1495. function CMConvertXYZToLab(const (*var*) src: CMColor; const (*var*) white: CMXYZColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertXYZToLab';
  1496. {
  1497. * CMConvertLabToXYZ()
  1498. *
  1499. * Availability:
  1500. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1501. * CarbonLib: in CarbonLib 1.0 and later
  1502. * Mac OS X: in 3.0 and later
  1503. }
  1504. function CMConvertLabToXYZ(const (*var*) src: CMColor; const (*var*) white: CMXYZColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertLabToXYZ';
  1505. {
  1506. * CMConvertXYZToLuv()
  1507. *
  1508. * Availability:
  1509. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1510. * CarbonLib: in CarbonLib 1.0 and later
  1511. * Mac OS X: in 3.0 and later
  1512. }
  1513. function CMConvertXYZToLuv(const (*var*) src: CMColor; const (*var*) white: CMXYZColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertXYZToLuv';
  1514. {
  1515. * CMConvertLuvToXYZ()
  1516. *
  1517. * Availability:
  1518. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1519. * CarbonLib: in CarbonLib 1.0 and later
  1520. * Mac OS X: in 3.0 and later
  1521. }
  1522. function CMConvertLuvToXYZ(const (*var*) src: CMColor; const (*var*) white: CMXYZColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertLuvToXYZ';
  1523. {
  1524. * CMConvertXYZToYxy()
  1525. *
  1526. * Availability:
  1527. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1528. * CarbonLib: in CarbonLib 1.0 and later
  1529. * Mac OS X: in 3.0 and later
  1530. }
  1531. function CMConvertXYZToYxy(const (*var*) src: CMColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertXYZToYxy';
  1532. {
  1533. * CMConvertYxyToXYZ()
  1534. *
  1535. * Availability:
  1536. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1537. * CarbonLib: in CarbonLib 1.0 and later
  1538. * Mac OS X: in 3.0 and later
  1539. }
  1540. function CMConvertYxyToXYZ(const (*var*) src: CMColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertYxyToXYZ';
  1541. {
  1542. * CMConvertRGBToHLS()
  1543. *
  1544. * Availability:
  1545. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1546. * CarbonLib: in CarbonLib 1.0 and later
  1547. * Mac OS X: in 3.0 and later
  1548. }
  1549. function CMConvertRGBToHLS(const (*var*) src: CMColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertRGBToHLS';
  1550. {
  1551. * CMConvertHLSToRGB()
  1552. *
  1553. * Availability:
  1554. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1555. * CarbonLib: in CarbonLib 1.0 and later
  1556. * Mac OS X: in 3.0 and later
  1557. }
  1558. function CMConvertHLSToRGB(const (*var*) src: CMColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertHLSToRGB';
  1559. {
  1560. * CMConvertRGBToHSV()
  1561. *
  1562. * Availability:
  1563. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1564. * CarbonLib: in CarbonLib 1.0 and later
  1565. * Mac OS X: in 3.0 and later
  1566. }
  1567. function CMConvertRGBToHSV(const (*var*) src: CMColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertRGBToHSV';
  1568. {
  1569. * CMConvertHSVToRGB()
  1570. *
  1571. * Availability:
  1572. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1573. * CarbonLib: in CarbonLib 1.0 and later
  1574. * Mac OS X: in 3.0 and later
  1575. }
  1576. function CMConvertHSVToRGB(const (*var*) src: CMColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertHSVToRGB';
  1577. {
  1578. * CMConvertRGBToGray()
  1579. *
  1580. * Availability:
  1581. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1582. * CarbonLib: in CarbonLib 1.0 and later
  1583. * Mac OS X: in 3.0 and later
  1584. }
  1585. function CMConvertRGBToGray(const (*var*) src: CMColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertRGBToGray';
  1586. {
  1587. * CMConvertXYZToFixedXYZ()
  1588. *
  1589. * Availability:
  1590. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1591. * CarbonLib: in CarbonLib 1.0 and later
  1592. * Mac OS X: in 3.0 and later
  1593. }
  1594. function CMConvertXYZToFixedXYZ(const (*var*) src: CMXYZColor; var dst: CMFixedXYZColor; count: UInt32): CMError; external name '_CMConvertXYZToFixedXYZ';
  1595. {
  1596. * CMConvertFixedXYZToXYZ()
  1597. *
  1598. * Availability:
  1599. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1600. * CarbonLib: in CarbonLib 1.0 and later
  1601. * Mac OS X: in 3.0 and later
  1602. }
  1603. function CMConvertFixedXYZToXYZ(const (*var*) src: CMFixedXYZColor; var dst: CMXYZColor; count: UInt32): CMError; external name '_CMConvertFixedXYZToXYZ';
  1604. {
  1605. * CMConvertXYZToXYZ()
  1606. *
  1607. * Availability:
  1608. * Non-Carbon CFM: not available
  1609. * CarbonLib: not available
  1610. * Mac OS X: in 3.1 and later
  1611. }
  1612. function CMConvertXYZToXYZ(const (*var*) src: CMColor; const (*var*) srcIlluminant: CMXYZColor; var dst: CMColor; const (*var*) dstIlluminant: CMXYZColor; method: CMChromaticAdaptation; count: UInt32): CMError; external name '_CMConvertXYZToXYZ';
  1613. { PS-related }
  1614. {
  1615. * CMGetPS2ColorSpace()
  1616. *
  1617. * Availability:
  1618. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1619. * CarbonLib: in CarbonLib 1.0 and later
  1620. * Mac OS X: in 3.0 and later
  1621. }
  1622. function CMGetPS2ColorSpace(srcProf: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UnivPtr; var preferredCMMnotfound: boolean): CMError; external name '_CMGetPS2ColorSpace';
  1623. {
  1624. * CMGetPS2ColorRenderingIntent()
  1625. *
  1626. * Availability:
  1627. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1628. * CarbonLib: in CarbonLib 1.0 and later
  1629. * Mac OS X: in 3.0 and later
  1630. }
  1631. function CMGetPS2ColorRenderingIntent(srcProf: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UnivPtr; var preferredCMMnotfound: boolean): CMError; external name '_CMGetPS2ColorRenderingIntent';
  1632. {
  1633. * CMGetPS2ColorRendering()
  1634. *
  1635. * Availability:
  1636. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1637. * CarbonLib: in CarbonLib 1.0 and later
  1638. * Mac OS X: in 3.0 and later
  1639. }
  1640. function CMGetPS2ColorRendering(srcProf: CMProfileRef; dstProf: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UnivPtr; var preferredCMMnotfound: boolean): CMError; external name '_CMGetPS2ColorRendering';
  1641. {
  1642. * CMGetPS2ColorRenderingVMSize()
  1643. *
  1644. * Availability:
  1645. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1646. * CarbonLib: in CarbonLib 1.0 and later
  1647. * Mac OS X: in 3.0 and later
  1648. }
  1649. function CMGetPS2ColorRenderingVMSize(srcProf: CMProfileRef; dstProf: CMProfileRef; var vmSize: UInt32; var preferredCMMnotfound: boolean): CMError; external name '_CMGetPS2ColorRenderingVMSize';
  1650. { ColorSync 1.0 functions which have parallel 2.0 counterparts }
  1651. {$ifc TARGET_API_MAC_OS8}
  1652. {$ifc CALL_NOT_IN_CARBON}
  1653. {
  1654. * CWNewColorWorld()
  1655. *
  1656. * Availability:
  1657. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1658. * CarbonLib: not available
  1659. * Mac OS X: not available
  1660. }
  1661. function CWNewColorWorld(var cw: CMWorldRef; src: CMProfileHandle; dst: CMProfileHandle): CMError; external name '_CWNewColorWorld';
  1662. {
  1663. * ConcatenateProfiles()
  1664. *
  1665. * Availability:
  1666. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1667. * CarbonLib: not available
  1668. * Mac OS X: not available
  1669. }
  1670. function ConcatenateProfiles(thru: CMProfileHandle; dst: CMProfileHandle; var newDst: CMProfileHandle): CMError; external name '_ConcatenateProfiles';
  1671. {
  1672. * CMBeginMatching()
  1673. *
  1674. * Availability:
  1675. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1676. * CarbonLib: not available
  1677. * Mac OS X: not available
  1678. }
  1679. function CMBeginMatching(src: CMProfileHandle; dst: CMProfileHandle; var myRef: CMMatchRef): CMError; external name '_CMBeginMatching';
  1680. {
  1681. * CMDrawMatchedPicture()
  1682. *
  1683. * Availability:
  1684. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1685. * CarbonLib: not available
  1686. * Mac OS X: not available
  1687. }
  1688. procedure CMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileHandle; var myRect: Rect); external name '_CMDrawMatchedPicture';
  1689. {
  1690. * CMUseProfileComment()
  1691. *
  1692. * Availability:
  1693. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1694. * CarbonLib: not available
  1695. * Mac OS X: not available
  1696. }
  1697. function CMUseProfileComment(profile: CMProfileHandle): CMError; external name '_CMUseProfileComment';
  1698. {
  1699. * CMGetProfileName()
  1700. *
  1701. * Availability:
  1702. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1703. * CarbonLib: not available
  1704. * Mac OS X: not available
  1705. }
  1706. procedure CMGetProfileName(myProfile: CMProfileHandle; var IStringResult: CMIString); external name '_CMGetProfileName';
  1707. {
  1708. * CMGetProfileAdditionalDataOffset()
  1709. *
  1710. * Availability:
  1711. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1712. * CarbonLib: not available
  1713. * Mac OS X: not available
  1714. }
  1715. function CMGetProfileAdditionalDataOffset(myProfile: CMProfileHandle): SInt32; external name '_CMGetProfileAdditionalDataOffset';
  1716. { ProfileResponder definitions }
  1717. {$endc} {CALL_NOT_IN_CARBON}
  1718. const
  1719. cmSystemDevice = $73797320 (* 'sys ' *);
  1720. cmGDevice = $67646576 (* 'gdev' *);
  1721. { ProfileResponder functions }
  1722. {$ifc CALL_NOT_IN_CARBON}
  1723. {
  1724. * GetProfile()
  1725. *
  1726. * Availability:
  1727. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1728. * CarbonLib: not available
  1729. * Mac OS X: not available
  1730. }
  1731. function GetProfile(deviceType: OSType; refNum: SInt32; aProfile: CMProfileHandle; var returnedProfile: CMProfileHandle): CMError; external name '_GetProfile';
  1732. {
  1733. * SetProfile()
  1734. *
  1735. * Availability:
  1736. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1737. * CarbonLib: not available
  1738. * Mac OS X: not available
  1739. }
  1740. function SetProfile(deviceType: OSType; refNum: SInt32; newProfile: CMProfileHandle): CMError; external name '_SetProfile';
  1741. {
  1742. * SetProfileDescription()
  1743. *
  1744. * Availability:
  1745. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1746. * CarbonLib: not available
  1747. * Mac OS X: not available
  1748. }
  1749. function SetProfileDescription(deviceType: OSType; refNum: SInt32; deviceData: SInt32; hProfile: CMProfileHandle): CMError; external name '_SetProfileDescription';
  1750. {
  1751. * GetIndexedProfile()
  1752. *
  1753. * Availability:
  1754. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1755. * CarbonLib: not available
  1756. * Mac OS X: not available
  1757. }
  1758. function GetIndexedProfile(deviceType: OSType; refNum: SInt32; search: CMProfileSearchRecordHandle; var returnProfile: CMProfileHandle; var index: SInt32): CMError; external name '_GetIndexedProfile';
  1759. {
  1760. * DeleteDeviceProfile()
  1761. *
  1762. * Availability:
  1763. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1764. * CarbonLib: not available
  1765. * Mac OS X: not available
  1766. }
  1767. function DeleteDeviceProfile(deviceType: OSType; refNum: SInt32; deleteMe: CMProfileHandle): CMError; external name '_DeleteDeviceProfile';
  1768. {$endc} {CALL_NOT_IN_CARBON}
  1769. {$ifc OLDROUTINENAMES}
  1770. { old constants }
  1771. type
  1772. CMFlattenProc = CMFlattenProcPtr;
  1773. CMBitmapCallBackProc = CMBitmapCallBackProcPtr;
  1774. CMProfileFilterProc = CMProfileFilterProcPtr;
  1775. const
  1776. qdSystemDevice = $73797320 (* 'sys ' *);
  1777. qdGDevice = $67646576 (* 'gdev' *);
  1778. kMatchCMMType = $00000001;
  1779. kMatchApplProfileVersion = $00000002;
  1780. kMatchDataType = $00000004;
  1781. kMatchDeviceType = $00000008;
  1782. kMatchDeviceManufacturer = $00000010;
  1783. kMatchDeviceModel = $00000020;
  1784. kMatchDeviceAttributes = $00000040;
  1785. kMatchFlags = $00000080;
  1786. kMatchOptions = $00000100;
  1787. kMatchWhite = $00000200;
  1788. kMatchBlack = $00000400;
  1789. { old types }
  1790. type
  1791. CMYKColor = CMCMYKColor;
  1792. CMYKColorPtr = ^CMYKColor;
  1793. CWorld = CMWorldRef;
  1794. CMGamutResult = ^SInt32;
  1795. { old functions }
  1796. {$endc} {OLDROUTINENAMES}
  1797. { Deprecated stuff }
  1798. { PrGeneral parameter blocks }
  1799. const
  1800. enableColorMatchingOp = 12;
  1801. registerProfileOp = 13;
  1802. type
  1803. TEnableColorMatchingBlkPtr = ^TEnableColorMatchingBlk;
  1804. TEnableColorMatchingBlk = record
  1805. iOpCode: SInt16;
  1806. iError: SInt16;
  1807. lReserved: SInt32;
  1808. hPrint: THPrint;
  1809. fEnableIt: boolean;
  1810. filler: SInt8;
  1811. end;
  1812. TRegisterProfileBlkPtr = ^TRegisterProfileBlk;
  1813. TRegisterProfileBlk = record
  1814. iOpCode: SInt16;
  1815. iError: SInt16;
  1816. lReserved: SInt32;
  1817. hPrint: THPrint;
  1818. fRegisterIt: boolean;
  1819. filler: SInt8;
  1820. end;
  1821. {$endc} {TARGET_API_MAC_OS8}
  1822. {$ALIGN MAC68K}
  1823. end.