CMApplication.pas 77 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311
  1. {
  2. File: ColorSync/CMApplication.h
  3. Contains: Color Matching Interfaces
  4. Version: ColorSync-174.1~229
  5. Copyright: © 1992-2006 by Apple Computer, Inc., all rights reserved.
  6. Bugs?: For bug reports, consult the following page on
  7. the World Wide Web:
  8. http://www.freepascal.org/bugs.html
  9. }
  10. { Pascal Translation Updated: Gale R Paeper, <[email protected]>, 2007 }
  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,CFData,Files,CMICCProfile,MacErrors,CMTypes,CFString,CFDictionary,Quickdraw,Printing;
  92. {$setc _DECLARE_CS_QD_API_ := 0} { Mac OS X ColorSync QuickDraw API are located in QuickDraw.p[.pas] }
  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, 2.0, and 4.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. 2: (
  172. cm4: CM4Header;
  173. );
  174. end;
  175. { CWConcatColorWorld() definitions }
  176. CMConcatProfileSetPtr = ^CMConcatProfileSet;
  177. CMConcatProfileSet = record
  178. keyIndex: UInt16; { Zero-based }
  179. count: UInt16; { Min 1 }
  180. profileSet: array [0..0] of CMProfileRef; { Variable. Ordered from Source -> Dest }
  181. end;
  182. { NCWConcatColorWorld() definitions }
  183. NCMConcatProfileSpecPtr = ^NCMConcatProfileSpec;
  184. NCMConcatProfileSpec = record
  185. renderingIntent: UInt32; { renderingIntent override }
  186. transformTag: UInt32; { transform enumerations defined below }
  187. profile: CMProfileRef; { profile }
  188. end;
  189. NCMConcatProfileSetPtr = ^NCMConcatProfileSet;
  190. NCMConcatProfileSet = record
  191. cmm: OSType; { e.g. 'KCMS', 'appl', ... uniquely ids the cmm, or 0000 }
  192. flags: UInt32; { specify quality, lookup only, no gamut checking ... }
  193. flagsMask: UInt32; { which bits of 'flags' to use to override profile }
  194. profileCount: UInt32; { how many ProfileSpecs in the following set }
  195. profileSpecs: array [0..0] of NCMConcatProfileSpec; { Variable. Ordered from Source -> Dest }
  196. end;
  197. const
  198. kNoTransform = 0; { Not used }
  199. kUseAtoB = 1; { Use 'A2B*' tag from this profile or equivalent }
  200. kUseBtoA = 2; { Use 'B2A*' tag from this profile or equivalent }
  201. kUseBtoB = 3; { Use 'pre*' tag from this profile or equivalent }
  202. { For typical device profiles the following synonyms may be useful }
  203. kDeviceToPCS = 1; { Device Dependent to Device Independent }
  204. kPCSToDevice = 2; { Device Independent to Device Dependent }
  205. kPCSToPCS = 3; { Independent, through device's gamut }
  206. kUseProfileIntent = $FFFFFFFF; { For renderingIntent in NCMConcatProfileSpec }
  207. { ColorSync color data types }
  208. type
  209. CMRGBColorPtr = ^CMRGBColor;
  210. CMRGBColor = record
  211. red: UInt16; { 0..65535 }
  212. green: UInt16;
  213. blue: UInt16;
  214. end;
  215. CMCMYKColorPtr = ^CMCMYKColor;
  216. CMCMYKColor = record
  217. cyan: UInt16; { 0..65535 }
  218. magenta: UInt16;
  219. yellow: UInt16;
  220. black: UInt16;
  221. end;
  222. CMCMYColorPtr = ^CMCMYColor;
  223. CMCMYColor = record
  224. cyan: UInt16; { 0..65535 }
  225. magenta: UInt16;
  226. yellow: UInt16;
  227. end;
  228. CMHLSColorPtr = ^CMHLSColor;
  229. CMHLSColor = record
  230. hue: UInt16; { 0..65535. Fraction of circle. Red at 0 }
  231. lightness: UInt16; { 0..65535 }
  232. saturation: UInt16; { 0..65535 }
  233. end;
  234. CMHSVColorPtr = ^CMHSVColor;
  235. CMHSVColor = record
  236. hue: UInt16; { 0..65535. Fraction of circle. Red at 0 }
  237. saturation: UInt16; { 0..65535 }
  238. value: UInt16; { 0..65535 }
  239. end;
  240. CMLabColorPtr = ^CMLabColor;
  241. CMLabColor = record
  242. L: UInt16; { 0..65535 maps to 0..100 }
  243. a: UInt16; { 0..65535 maps to -128..127.996 }
  244. b: UInt16; { 0..65535 maps to -128..127.996 }
  245. end;
  246. CMLuvColorPtr = ^CMLuvColor;
  247. CMLuvColor = record
  248. L: UInt16; { 0..65535 maps to 0..100 }
  249. u: UInt16; { 0..65535 maps to -128..127.996 }
  250. v: UInt16; { 0..65535 maps to -128..127.996 }
  251. end;
  252. CMYxyColorPtr = ^CMYxyColor;
  253. CMYxyColor = record
  254. capY: UInt16; { 0..65535 maps to 0..1 }
  255. x: UInt16; { 0..65535 maps to 0..1 }
  256. y: UInt16; { 0..65535 maps to 0..1 }
  257. end;
  258. CMGrayColorPtr = ^CMGrayColor;
  259. CMGrayColor = record
  260. gray: UInt16; { 0..65535 }
  261. end;
  262. CMMultichannel5ColorPtr = ^CMMultichannel5Color;
  263. CMMultichannel5Color = record
  264. components: packed array [0..4] of UInt8; { 0..255 }
  265. pad: UInt8; {pad byte so record size equals Apple gcc struct size}
  266. end;
  267. CMMultichannel6ColorPtr = ^CMMultichannel6Color;
  268. CMMultichannel6Color = record
  269. components: packed array [0..5] of UInt8; { 0..255 }
  270. end;
  271. CMMultichannel7ColorPtr = ^CMMultichannel7Color;
  272. CMMultichannel7Color = record
  273. components: packed array [0..6] of UInt8; { 0..255 }
  274. pad: UInt8; {pad byte so record size equals Apple gcc struct size}
  275. end;
  276. CMMultichannel8ColorPtr = ^CMMultichannel8Color;
  277. CMMultichannel8Color = record
  278. components: packed array [0..7] of UInt8; { 0..255 }
  279. end;
  280. CMNamedColorPtr = ^CMNamedColor;
  281. CMNamedColor = record
  282. namedColorIndex: UInt32; { 0..a lot }
  283. end;
  284. CMColorPtr = ^CMColor;
  285. CMColor = record
  286. case SInt16 of
  287. 0: (
  288. rgb: CMRGBColor;
  289. );
  290. 1: (
  291. hsv: CMHSVColor;
  292. );
  293. 2: (
  294. hls: CMHLSColor;
  295. );
  296. 3: (
  297. XYZ: CMXYZColor;
  298. );
  299. 4: (
  300. Lab: CMLabColor;
  301. );
  302. 5: (
  303. Luv: CMLuvColor;
  304. );
  305. 6: (
  306. Yxy: CMYxyColor;
  307. );
  308. 7: (
  309. cmyk: CMCMYKColor;
  310. );
  311. 8: (
  312. cmy: CMCMYColor;
  313. );
  314. 9: (
  315. gray: CMGrayColor;
  316. );
  317. 10: (
  318. mc5: CMMultichannel5Color;
  319. );
  320. 11: (
  321. mc6: CMMultichannel6Color;
  322. );
  323. 12: (
  324. mc7: CMMultichannel7Color;
  325. );
  326. 13: (
  327. mc8: CMMultichannel8Color;
  328. );
  329. 14: (
  330. namedColor: CMNamedColor;
  331. );
  332. end;
  333. { GetIndexedProfile() search definition }
  334. CMProfileSearchRecordPtr = ^CMProfileSearchRecord;
  335. CMProfileSearchRecord = record
  336. header: CMHeader;
  337. fieldMask: UInt32;
  338. reserved: array [0..1] of UInt32;
  339. end;
  340. CMProfileSearchRecordHandle = ^CMProfileSearchRecordPtr;
  341. { CMNewProfileSearch() search definition }
  342. CMSearchRecordPtr = ^CMSearchRecord;
  343. CMSearchRecord = record
  344. CMMType: OSType;
  345. profileClass: OSType;
  346. dataColorSpace: OSType;
  347. profileConnectionSpace: OSType;
  348. deviceManufacturer: UInt32;
  349. deviceModel: UInt32;
  350. deviceAttributes: array [0..1] of UInt32;
  351. profileFlags: UInt32;
  352. searchMask: UInt32;
  353. filter: CMProfileFilterUPP;
  354. end;
  355. { CMMIterateUPP() structure }
  356. CMMInfoPtr = ^CMMInfo;
  357. CMMInfo = record
  358. dataSize: UInt32; { Size of this structure - compatibility }
  359. CMMType: OSType; { Signature, e.g. 'appl', 'HDM ' or 'KCMS' }
  360. CMMMfr: OSType; { Vendor, e.g. 'appl' }
  361. CMMVersion: UInt32; { CMM version number }
  362. ASCIIName: packed array [0..31] of UInt8; { pascal string - name }
  363. ASCIIDesc: packed array [0..255] of UInt8; { pascal string - description or copyright }
  364. UniCodeNameCount: UniCharCount; { count of UniChars in following array }
  365. UniCodeName: array [0..31] of UniChar; { the name in UniCode chars }
  366. UniCodeDescCount: UniCharCount; { count of UniChars in following array }
  367. UniCodeDesc: array [0..255] of UniChar; { the description in UniCode chars }
  368. end;
  369. { GetCWInfo() structures }
  370. CMMInfoRecordPtr = ^CMMInfoRecord;
  371. CMMInfoRecord = record
  372. CMMType: OSType;
  373. CMMVersion: SInt32;
  374. end;
  375. CMCWInfoRecordPtr = ^CMCWInfoRecord;
  376. CMCWInfoRecord = record
  377. cmmCount: UInt32;
  378. cmmInfo: array [0..1] of CMMInfoRecord;
  379. end;
  380. { profile identifier structures }
  381. CMProfileIdentifierPtr = ^CMProfileIdentifier;
  382. CMProfileIdentifier = record
  383. profileHeader: CM2Header;
  384. calibrationDate: CMDateTime;
  385. ASCIIProfileDescriptionLen: UInt32;
  386. ASCIIProfileDescription: SInt8; { variable length }
  387. end;
  388. { colorspace masks }
  389. const
  390. cmColorSpaceSpaceMask = $0000003F;
  391. cmColorSpacePremulAlphaMask = $00000040;
  392. cmColorSpaceAlphaMask = $00000080;
  393. cmColorSpaceSpaceAndAlphaMask = $000000FF;
  394. cmColorSpacePackingMask = $0000FF00;
  395. cmColorSpaceEncodingMask = $000F0000;
  396. cmColorSpaceReservedMask = $FFF00000;
  397. { packing formats }
  398. cmNoColorPacking = $0000;
  399. cmWord5ColorPacking = $0500;
  400. cmWord565ColorPacking = $0600;
  401. cmLong8ColorPacking = $0800;
  402. cmLong10ColorPacking = $0A00;
  403. cmAlphaFirstPacking = $1000;
  404. cmOneBitDirectPacking = $0B00;
  405. cmAlphaLastPacking = $0000;
  406. cm8_8ColorPacking = $2800;
  407. cm16_8ColorPacking = $2000;
  408. cm24_8ColorPacking = $2100;
  409. cm32_8ColorPacking = $0800;
  410. cm40_8ColorPacking = $2200;
  411. cm48_8ColorPacking = $2300;
  412. cm56_8ColorPacking = $2400;
  413. cm64_8ColorPacking = $2500;
  414. cm32_16ColorPacking = $2600;
  415. cm48_16ColorPacking = $2900;
  416. cm64_16ColorPacking = $2A00;
  417. cm32_32ColorPacking = $2700;
  418. cmLittleEndianPacking = $4000;
  419. cmReverseChannelPacking = $8000;
  420. { channel encoding format }
  421. cmSRGB16ChannelEncoding = $00010000; { used for sRGB64 encoding ( ±3.12 format) }
  422. { general colorspaces }
  423. cmNoSpace = $0000;
  424. cmRGBSpace = $0001;
  425. cmCMYKSpace = $0002;
  426. cmHSVSpace = $0003;
  427. cmHLSSpace = $0004;
  428. cmYXYSpace = $0005;
  429. cmXYZSpace = $0006;
  430. cmLUVSpace = $0007;
  431. cmLABSpace = $0008;
  432. cmReservedSpace1 = $0009;
  433. cmGraySpace = $000A;
  434. cmReservedSpace2 = $000B;
  435. cmGamutResultSpace = $000C;
  436. cmNamedIndexedSpace = $0010;
  437. cmMCFiveSpace = $0011;
  438. cmMCSixSpace = $0012;
  439. cmMCSevenSpace = $0013;
  440. cmMCEightSpace = $0014;
  441. cmAlphaPmulSpace = $0040;
  442. cmAlphaSpace = $0080;
  443. cmRGBASpace = $0081;
  444. cmGrayASpace = $008A;
  445. cmRGBAPmulSpace = $00C1;
  446. cmGrayAPmulSpace = $00CA;
  447. { supported CMBitmapColorSpaces - Each of the following is a }
  448. { combination of a general colospace and a packing formats. }
  449. { Each can also be or'd with cmReverseChannelPacking. }
  450. cmGray8Space = $280A;
  451. cmGray16Space = $000A;
  452. cmGray16LSpace = $400A;
  453. cmGrayA16Space = $208A;
  454. cmGrayA32Space = $008A;
  455. cmGrayA32LSpace = $408A;
  456. cmGrayA16PmulSpace = $20CA;
  457. cmGrayA32PmulSpace = $00CA;
  458. cmGrayA32LPmulSpace = $40CA;
  459. cmRGB16Space = $0501;
  460. cmRGB16LSpace = $4501;
  461. cmRGB565Space = $0601;
  462. cmRGB565LSpace = $4601;
  463. cmRGB24Space = $2101;
  464. cmRGB32Space = $0801;
  465. cmRGB48Space = $2901;
  466. cmRGB48LSpace = $6901;
  467. cmARGB32Space = $1881;
  468. cmARGB64Space = $3A81;
  469. cmARGB64LSpace = $7A81;
  470. cmRGBA32Space = $0881;
  471. cmRGBA64Space = $2A81;
  472. cmRGBA64LSpace = $6A81;
  473. cmARGB32PmulSpace = $18C1;
  474. cmARGB64PmulSpace = $3AC1;
  475. cmARGB64LPmulSpace = $7AC1;
  476. cmRGBA32PmulSpace = $08C1;
  477. cmRGBA64PmulSpace = $2AC1;
  478. cmRGBA64LPmulSpace = $6AC1;
  479. cmCMYK32Space = $0802;
  480. cmCMYK64Space = $2A02;
  481. cmCMYK64LSpace = $6A02;
  482. cmHSV32Space = $0A03;
  483. cmHLS32Space = $0A04;
  484. cmYXY32Space = $0A05;
  485. cmXYZ24Space = $2106;
  486. cmXYZ32Space = $0A06;
  487. cmXYZ48Space = $2906;
  488. cmXYZ48LSpace = $6906;
  489. cmLUV32Space = $0A07;
  490. cmLAB24Space = $2108;
  491. cmLAB32Space = $0A08;
  492. cmLAB48Space = $2908;
  493. cmLAB48LSpace = $6908;
  494. cmGamutResult1Space = $0B0C;
  495. cmNamedIndexed32Space = $2710;
  496. cmNamedIndexed32LSpace = $6710;
  497. cmMCFive8Space = $2211;
  498. cmMCSix8Space = $2312;
  499. cmMCSeven8Space = $2413;
  500. cmMCEight8Space = $2514;
  501. type
  502. CMBitmapColorSpace = UInt32;
  503. CMBitmapPtr = ^CMBitmap;
  504. CMBitmap = record
  505. image: CStringPtr;
  506. width: SInt32;
  507. height: SInt32;
  508. rowBytes: SInt32;
  509. pixelSize: SInt32;
  510. space: CMBitmapColorSpace;
  511. user1: SInt32;
  512. user2: SInt32;
  513. end;
  514. const
  515. { Profile Locations }
  516. CS_MAX_PATH = 256;
  517. cmNoProfileBase = 0;
  518. cmFileBasedProfile = 1;
  519. cmHandleBasedProfile = 2;
  520. cmPtrBasedProfile = 3;
  521. cmProcedureBasedProfile = 4;
  522. cmPathBasedProfile = 5;
  523. cmBufferBasedProfile = 6;
  524. type
  525. CMFileLocationPtr = ^CMFileLocation;
  526. CMFileLocation = record
  527. spec: FSSpec;
  528. end;
  529. CMHandleLocationPtr = ^CMHandleLocation;
  530. CMHandleLocation = record
  531. h: Handle;
  532. end;
  533. CMPtrLocationPtr = ^CMPtrLocation;
  534. CMPtrLocation = record
  535. p: Ptr;
  536. end;
  537. CMProcedureLocationPtr = ^CMProcedureLocation;
  538. CMProcedureLocation = record
  539. proc: CMProfileAccessUPP;
  540. refCon: Ptr;
  541. end;
  542. CMPathLocationPtr = ^CMPathLocation;
  543. CMPathLocation = record
  544. path: packed array [0..255] of char;
  545. end;
  546. CMBufferLocationPtr = ^CMBufferLocation;
  547. CMBufferLocation = record
  548. buffer: Ptr;
  549. size: UInt32;
  550. end;
  551. CMProfLocPtr = ^CMProfLoc;
  552. CMProfLoc = record
  553. case SInt16 of
  554. 0: (
  555. fileLoc: CMFileLocation;
  556. );
  557. 1: (
  558. handleLoc: CMHandleLocation;
  559. );
  560. 2: (
  561. ptrLoc: CMPtrLocation;
  562. );
  563. 3: (
  564. procLoc: CMProcedureLocation;
  565. );
  566. 4: (
  567. pathLoc: CMPathLocation;
  568. );
  569. 5: (
  570. bufferLoc: CMBufferLocation;
  571. );
  572. end;
  573. CMProfileLocationPtr = ^CMProfileLocation;
  574. CMProfileLocation = record
  575. locType: SInt16;
  576. u: CMProfLoc;
  577. end;
  578. {$ifc TARGET_OS_MAC}
  579. const
  580. cmOriginalProfileLocationSize = 72;
  581. cmCurrentProfileLocationSize = 258;
  582. {$elsec}
  583. const
  584. cmOriginalProfileLocationSize = 258;
  585. cmCurrentProfileLocationSize = 258;
  586. {$endc} {TARGET_OS_MAC}
  587. { Struct and enums used for Profile iteration }
  588. const
  589. cmProfileIterateDataVersion1 = $00010000;
  590. cmProfileIterateDataVersion2 = $00020000; { Added makeAndModel }
  591. cmProfileIterateDataVersion3 = $00030000; { Added MD5 digest }
  592. type
  593. CMProfileIterateDataPtr = ^CMProfileIterateData;
  594. CMProfileIterateData = record
  595. dataVersion: UInt32; { cmProfileIterateDataVersion2 }
  596. header: CM2Header;
  597. code: ScriptCode;
  598. name: Str255;
  599. location: CMProfileLocation;
  600. uniCodeNameCount: UniCharCount;
  601. uniCodeName: UniCharPtr;
  602. asciiName: Ptr;
  603. makeAndModel: CMMakeAndModelPtr;
  604. digest: CMProfileMD5Ptr;
  605. end;
  606. { Caller-supplied callback function for Profile & CMM iteration }
  607. {$ifc TYPED_FUNCTION_POINTERS}
  608. CMProfileIterateProcPtr = function(var iterateData: CMProfileIterateData; refCon: UnivPtr): OSErr;
  609. {$elsec}
  610. CMProfileIterateProcPtr = ProcPtr;
  611. {$endc}
  612. {$ifc TYPED_FUNCTION_POINTERS}
  613. CMMIterateProcPtr = function(var iterateData: CMMInfo; refCon: UnivPtr): OSErr;
  614. {$elsec}
  615. CMMIterateProcPtr = ProcPtr;
  616. {$endc}
  617. {$ifc OPAQUE_UPP_TYPES}
  618. CMProfileIterateUPP = ^SInt32; { an opaque UPP }
  619. {$elsec}
  620. CMProfileIterateUPP = UniversalProcPtr;
  621. {$endc}
  622. {$ifc OPAQUE_UPP_TYPES}
  623. CMMIterateUPP = ^SInt32; { an opaque UPP }
  624. {$elsec}
  625. CMMIterateUPP = UniversalProcPtr;
  626. {$endc}
  627. const
  628. uppCMProfileIterateProcInfo = $000003E0;
  629. uppCMMIterateProcInfo = $000003E0;
  630. {
  631. * NewCMProfileIterateUPP()
  632. *
  633. * Availability:
  634. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  635. * CarbonLib: in CarbonLib 1.0 and later
  636. * Non-Carbon CFM: available as macro/inline
  637. }
  638. function NewCMProfileIterateUPP(userRoutine: CMProfileIterateProcPtr): CMProfileIterateUPP; external name '_NewCMProfileIterateUPP';
  639. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  640. {
  641. * NewCMMIterateUPP()
  642. *
  643. * Availability:
  644. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  645. * CarbonLib: in CarbonLib 1.0 and later
  646. * Non-Carbon CFM: available as macro/inline
  647. }
  648. function NewCMMIterateUPP(userRoutine: CMMIterateProcPtr): CMMIterateUPP; external name '_NewCMMIterateUPP';
  649. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  650. {
  651. * DisposeCMProfileIterateUPP()
  652. *
  653. * Availability:
  654. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  655. * CarbonLib: in CarbonLib 1.0 and later
  656. * Non-Carbon CFM: available as macro/inline
  657. }
  658. procedure DisposeCMProfileIterateUPP(userUPP: CMProfileIterateUPP); external name '_DisposeCMProfileIterateUPP';
  659. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  660. {
  661. * DisposeCMMIterateUPP()
  662. *
  663. * Availability:
  664. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  665. * CarbonLib: in CarbonLib 1.0 and later
  666. * Non-Carbon CFM: available as macro/inline
  667. }
  668. procedure DisposeCMMIterateUPP(userUPP: CMMIterateUPP); external name '_DisposeCMMIterateUPP';
  669. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  670. {
  671. * InvokeCMProfileIterateUPP()
  672. *
  673. * Availability:
  674. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  675. * CarbonLib: in CarbonLib 1.0 and later
  676. * Non-Carbon CFM: available as macro/inline
  677. }
  678. function InvokeCMProfileIterateUPP(var iterateData: CMProfileIterateData; refCon: UnivPtr; userRoutine: CMProfileIterateUPP): OSErr; external name '_InvokeCMProfileIterateUPP';
  679. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  680. {
  681. * InvokeCMMIterateUPP()
  682. *
  683. * Availability:
  684. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  685. * CarbonLib: in CarbonLib 1.0 and later
  686. * Non-Carbon CFM: available as macro/inline
  687. }
  688. function InvokeCMMIterateUPP(var iterateData: CMMInfo; refCon: UnivPtr; userRoutine: CMMIterateUPP): OSErr; external name '_InvokeCMMIterateUPP';
  689. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  690. { CMLabToLabProcPtr isn't used in any official Apple headers and no documentation exists on it. }
  691. //type
  692. // CMLabToLabProcPtr = procedure( var L: Float32; var a: Float32; var b: Float32; refcon: UnivPtr );
  693. { Creating Profiles }
  694. { Profile file and element access }
  695. {
  696. * CMNewProfile()
  697. *
  698. * Availability:
  699. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  700. * CarbonLib: in CarbonLib 1.0 and later
  701. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  702. }
  703. function CMNewProfile(var prof: CMProfileRef; const (*var*) theProfile: CMProfileLocation): CMError; external name '_CMNewProfile';
  704. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  705. {
  706. * CWNewLinkProfile()
  707. *
  708. * Availability:
  709. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  710. * CarbonLib: in CarbonLib 1.0 and later
  711. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  712. }
  713. function CWNewLinkProfile( var prof: CMProfileRef; const (*var*) targetLocation: CMProfileLocation; var profileSet: CMConcatProfileSet ): CMError; external name '_CWNewLinkProfile';
  714. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  715. {
  716. * NCWNewLinkProfile()
  717. *
  718. * Availability:
  719. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  720. * CarbonLib: in CarbonLib 1.0 and later
  721. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  722. }
  723. function NCWNewLinkProfile( var prof: CMProfileRef; const (*var*) targetLocation: CMProfileLocation; var profileSet: NCMConcatProfileSet; proc: CMConcatCallBackUPP; refCon: UnivPtr ): CMError; external name '_NCWNewLinkProfile';
  724. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  725. {
  726. * CMMakeProfile()
  727. *
  728. * Summary:
  729. * Make a display or abstract profile.
  730. *
  731. * Discussion:
  732. * Adds appropriate tags to a profile to make display or abstract
  733. * profile based on an specification dictionary.
  734. *
  735. * One key in the specification dictionary must be "profileType"
  736. * which must have a CFString value of "abstractLab", "displayRGB"
  737. * or "displayID". It can also contain the keys/values:
  738. * "description" CFString (optional)
  739. * "copyright" CFString (optional)
  740. *
  741. * For profileType of "abstractLab", the dictionary
  742. * should also contain the keys/values:
  743. * "gridPoints" CFNumber(SInt32) (should be odd)
  744. * "proc" CFNumber(SInt64)
  745. * (coerced from a LabToLabProcPtr)
  746. * "refcon" CFNumber(SInt64) (optional)
  747. * (coerced from a void*)
  748. *
  749. * For profileType of "displayRGB", the dictionary
  750. * should also contain the keys/values:
  751. * "targetGamma" CFNumber(Float) (e.g. 1.8) (optional)
  752. * "targetWhite" CFNumber(SInt32) (e.g. 6500) (optional)
  753. * "gammaR" CFNumber(Float) (e.g. 2.5)
  754. * "gammaG" CFNumber(Float) (e.g. 2.5)
  755. * "gammaB" CFNumber(Float) (e.g. 2.5)
  756. * "tableChans" CFNumber(SInt32) (1 or 3) (optional)
  757. * "tableEntries" CFNumber(SInt32) (e.g 16 or 255) (optional)
  758. * "tableEntrySize" CFNumber(SInt32) (1 or 2) (optional)
  759. * "tableData" CFData (lut in RRRGGGBBB order) (optional)
  760. * either
  761. * "phosphorRx" CFNumber(Float)
  762. * "phosphorRy" CFNumber(Float)
  763. * "phosphorGx" CFNumber(Float)
  764. * "phosphorGy" CFNumber(Float)
  765. * "phosphorBx" CFNumber(Float)
  766. * "phosphorBy" CFNumber(Float)
  767. * or
  768. * "phosphorSet" CFString ("WideRGB", "700/525/450nm",
  769. * "P22-EBU", "HDTV", "CCIR709", "sRGB",
  770. * "AdobeRGB98" or "Trinitron")
  771. * either
  772. * "whitePointx" CFNumber(Float)
  773. * "whitePointy" CFNumber(Float)
  774. * or
  775. * "whiteTemp" CFNumber(SInt32) (e.g. 5000, 6500, 9300)
  776. *
  777. * For profileType of "displayID", the dictionary
  778. * should also contain the keys/values:
  779. * "targetGamma" CFNumber(Float) (e.g. 1.8) (optional)
  780. * "targetWhite" CFNumber(SInt32) (e.g. 6500) (optional)
  781. * "displayID CFNumber(SInt32)
  782. * Optionally, the keys/values for "displayRGB" can be
  783. * provided to override the valuses from the display.
  784. *
  785. * Parameters:
  786. *
  787. * prof:
  788. * (in) the profile to modify
  789. *
  790. * spec:
  791. * (in) specification dictionary
  792. *
  793. * Availability:
  794. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  795. * CarbonLib: not available
  796. * Non-Carbon CFM: not available
  797. }
  798. function CMMakeProfile( prof: CMProfileRef; spec: CFDictionaryRef ): CMError; external name '_CMMakeProfile';
  799. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  800. { Accessing Profiles }
  801. {
  802. * CMOpenProfile()
  803. *
  804. * Availability:
  805. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  806. * CarbonLib: in CarbonLib 1.0 and later
  807. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  808. }
  809. function CMOpenProfile(var prof: CMProfileRef; const (*var*) theProfile: CMProfileLocation): CMError; external name '_CMOpenProfile';
  810. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  811. {
  812. * CMCloseProfile()
  813. *
  814. * Availability:
  815. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  816. * CarbonLib: in CarbonLib 1.0 and later
  817. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  818. }
  819. function CMCloseProfile(prof: CMProfileRef): CMError; external name '_CMCloseProfile';
  820. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  821. {
  822. * CMUpdateProfile()
  823. *
  824. * Availability:
  825. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  826. * CarbonLib: in CarbonLib 1.0 and later
  827. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  828. }
  829. function CMUpdateProfile(prof: CMProfileRef): CMError; external name '_CMUpdateProfile';
  830. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  831. {
  832. * CMCopyProfile()
  833. *
  834. * Availability:
  835. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  836. * CarbonLib: in CarbonLib 1.0 and later
  837. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  838. }
  839. function CMCopyProfile(var targetProf: CMProfileRef; const (*var*) targetLocation: CMProfileLocation; srcProf: CMProfileRef): CMError; external name '_CMCopyProfile';
  840. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  841. {
  842. * CMValidateProfile()
  843. *
  844. * Availability:
  845. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  846. * CarbonLib: in CarbonLib 1.0 and later
  847. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  848. }
  849. function CMValidateProfile(prof: CMProfileRef; var valid: boolean; var preferredCMMnotfound: boolean): CMError; external name '_CMValidateProfile';
  850. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  851. {
  852. * CMGetProfileLocation()
  853. *
  854. * Availability:
  855. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  856. * CarbonLib: in CarbonLib 1.0 and later
  857. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  858. }
  859. function CMGetProfileLocation(prof: CMProfileRef; var theProfile: CMProfileLocation): CMError; external name '_CMGetProfileLocation';
  860. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  861. {
  862. * NCMGetProfileLocation()
  863. *
  864. * Availability:
  865. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  866. * CarbonLib: in CarbonLib 1.0 and later
  867. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  868. }
  869. function NCMGetProfileLocation(prof: CMProfileRef; var theProfile: CMProfileLocation; var locationSize: UInt32): CMError; external name '_NCMGetProfileLocation';
  870. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  871. {
  872. * CMProfileCopyICCData()
  873. *
  874. * Summary:
  875. * Return a copy of the icc data specified by `prof'.
  876. *
  877. * Parameters:
  878. *
  879. * allocator:
  880. * (in) The object to be used to allocate memory for the data
  881. *
  882. * prof:
  883. * (in) The profile to query
  884. *
  885. * Availability:
  886. * Mac OS X: in version 10.4 and later in ApplicationServices.framework
  887. * CarbonLib: not available
  888. * Non-Carbon CFM: not available
  889. }
  890. function CMProfileCopyICCData( allocator: CFAllocatorRef; prof: CMProfileRef ): CFDataRef; external name '_CMProfileCopyICCData';
  891. (* AVAILABLE_MAC_OS_X_VERSION_10_4_AND_LATER *)
  892. {
  893. * CMFlattenProfile()
  894. *
  895. * Availability:
  896. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  897. * CarbonLib: in CarbonLib 1.0 and later
  898. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  899. }
  900. function CMFlattenProfile(prof: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UnivPtr; var preferredCMMnotfound: boolean): CMError; external name '_CMFlattenProfile';
  901. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  902. {
  903. * NCMUnflattenProfile()
  904. *
  905. * Availability:
  906. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  907. * CarbonLib: in CarbonLib 1.0 and later
  908. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  909. }
  910. function NCMUnflattenProfile( var targetLocation: CMProfileLocation; proc: CMFlattenUPP; refCon: UnivPtr; var preferredCMMnotfound: Boolean ): CMError; external name '_NCMUnflattenProfile';
  911. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  912. {$ifc TARGET_OS_MAC}
  913. {$ifc CALL_NOT_IN_CARBON}
  914. {
  915. * CMUnflattenProfile()
  916. *
  917. * Availability:
  918. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  919. * CarbonLib: not available
  920. * Mac OS X: not available
  921. }
  922. function CMUnflattenProfile(var resultFileSpec: FSSpec; proc: CMFlattenUPP; refCon: UnivPtr; var preferredCMMnotfound: boolean): CMError; external name '_CMUnflattenProfile';
  923. {$endc} {CALL_NOT_IN_CARBON}
  924. {$endc} {TARGET_OS_MAC}
  925. {
  926. * CMGetProfileHeader()
  927. *
  928. * Availability:
  929. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  930. * CarbonLib: in CarbonLib 1.0 and later
  931. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  932. }
  933. function CMGetProfileHeader(prof: CMProfileRef; var header: CMAppleProfileHeader): CMError; external name '_CMGetProfileHeader';
  934. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  935. {
  936. * CMSetProfileHeader()
  937. *
  938. * Availability:
  939. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  940. * CarbonLib: in CarbonLib 1.0 and later
  941. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  942. }
  943. function CMSetProfileHeader(prof: CMProfileRef; const (*var*) header: CMAppleProfileHeader): CMError; external name '_CMSetProfileHeader';
  944. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  945. {
  946. * CMCloneProfileRef()
  947. *
  948. * Availability:
  949. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  950. * CarbonLib: in CarbonLib 1.0 and later
  951. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  952. }
  953. function CMCloneProfileRef( prof: CMProfileRef ): CMError; external name '_CMCloneProfileRef';
  954. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  955. {
  956. * CMGetProfileRefCount()
  957. *
  958. * Availability:
  959. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  960. * CarbonLib: in CarbonLib 1.0 and later
  961. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  962. }
  963. function CMGetProfileRefCount( prof: CMProfileRef; var count: SInt32 ): CMError; external name '_CMGetProfileRefCount';
  964. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  965. {
  966. * CMProfileModified()
  967. *
  968. * Availability:
  969. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  970. * CarbonLib: in CarbonLib 1.0 and later
  971. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  972. }
  973. function CMProfileModified( prof: CMProfileRef; var modified: Boolean ): CMError; external name '_CMProfileModified';
  974. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  975. {
  976. * CMGetProfileMD5()
  977. *
  978. * Availability:
  979. * Mac OS X: in version 10.1 and later in ApplicationServices.framework
  980. * CarbonLib: not available
  981. * Non-Carbon CFM: not available
  982. }
  983. function CMGetProfileMD5( prof: CMProfileRef; digest: CMProfileMD5 ): CMError; external name '_CMGetProfileMD5';
  984. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  985. { Accessing Profile Elements }
  986. {
  987. * CMCountProfileElements()
  988. *
  989. * Availability:
  990. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  991. * CarbonLib: in CarbonLib 1.0 and later
  992. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  993. }
  994. function CMCountProfileElements( prof: CMProfileRef; var elementCount: UInt32 ): CMError; external name '_CMCountProfileElements';
  995. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  996. {
  997. * CMProfileElementExists()
  998. *
  999. * Availability:
  1000. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1001. * CarbonLib: in CarbonLib 1.0 and later
  1002. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1003. }
  1004. function CMProfileElementExists(prof: CMProfileRef; tag: OSType; var found: boolean): CMError; external name '_CMProfileElementExists';
  1005. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1006. {
  1007. * CMGetProfileElement()
  1008. *
  1009. * Availability:
  1010. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1011. * CarbonLib: in CarbonLib 1.0 and later
  1012. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1013. }
  1014. function CMGetProfileElement(prof: CMProfileRef; tag: OSType; var elementSize: UInt32; elementData: UnivPtr): CMError; external name '_CMGetProfileElement';
  1015. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1016. {
  1017. * CMSetProfileElement()
  1018. *
  1019. * Availability:
  1020. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1021. * CarbonLib: in CarbonLib 1.0 and later
  1022. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1023. }
  1024. function CMSetProfileElement(prof: CMProfileRef; tag: OSType; elementSize: UInt32; elementData: UnivPtr): CMError; external name '_CMSetProfileElement';
  1025. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1026. {
  1027. * CMSetProfileElementSize()
  1028. *
  1029. * Availability:
  1030. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1031. * CarbonLib: in CarbonLib 1.0 and later
  1032. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1033. }
  1034. function CMSetProfileElementSize(prof: CMProfileRef; tag: OSType; elementSize: UInt32): CMError; external name '_CMSetProfileElementSize';
  1035. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1036. {
  1037. * CMSetProfileElementReference()
  1038. *
  1039. * Availability:
  1040. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1041. * CarbonLib: in CarbonLib 1.0 and later
  1042. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1043. }
  1044. function CMSetProfileElementReference(prof: CMProfileRef; elementTag: OSType; referenceTag: OSType): CMError; external name '_CMSetProfileElementReference';
  1045. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1046. {
  1047. * CMGetPartialProfileElement()
  1048. *
  1049. * Availability:
  1050. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1051. * CarbonLib: in CarbonLib 1.0 and later
  1052. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1053. }
  1054. function CMGetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: UInt32; var byteCount: UInt32; elementData: UnivPtr): CMError; external name '_CMGetPartialProfileElement';
  1055. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1056. {
  1057. * CMSetPartialProfileElement()
  1058. *
  1059. * Availability:
  1060. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1061. * CarbonLib: in CarbonLib 1.0 and later
  1062. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1063. }
  1064. function CMSetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: UInt32; byteCount: UInt32; elementData: {const} UnivPtr): CMError; external name '_CMSetPartialProfileElement';
  1065. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1066. {
  1067. * CMGetIndProfileElementInfo()
  1068. *
  1069. * Availability:
  1070. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1071. * CarbonLib: in CarbonLib 1.0 and later
  1072. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1073. }
  1074. function CMGetIndProfileElementInfo(prof: CMProfileRef; index: UInt32; var tag: OSType; var elementSize: UInt32; var refs: boolean): CMError; external name '_CMGetIndProfileElementInfo';
  1075. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1076. {
  1077. * CMGetIndProfileElement()
  1078. *
  1079. * Availability:
  1080. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1081. * CarbonLib: in CarbonLib 1.0 and later
  1082. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1083. }
  1084. function CMGetIndProfileElement(prof: CMProfileRef; index: UInt32; var elementSize: UInt32; elementData: UnivPtr): CMError; external name '_CMGetIndProfileElement';
  1085. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1086. {
  1087. * CMRemoveProfileElement()
  1088. *
  1089. * Availability:
  1090. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1091. * CarbonLib: in CarbonLib 1.0 and later
  1092. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1093. }
  1094. function CMRemoveProfileElement(prof: CMProfileRef; tag: OSType): CMError; external name '_CMRemoveProfileElement';
  1095. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1096. { Accessing Profile Descriptions }
  1097. {
  1098. * CMGetScriptProfileDescription()
  1099. *
  1100. * Availability:
  1101. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1102. * CarbonLib: in CarbonLib 1.0 and later
  1103. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1104. }
  1105. function CMGetScriptProfileDescription(prof: CMProfileRef; var name: Str255; var code: ScriptCode): CMError; external name '_CMGetScriptProfileDescription';
  1106. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1107. {
  1108. * CMGetProfileDescriptions()
  1109. *
  1110. * Availability:
  1111. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1112. * CarbonLib: in CarbonLib 1.0 and later
  1113. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1114. }
  1115. 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';
  1116. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1117. {
  1118. * CMSetProfileDescriptions()
  1119. *
  1120. * Availability:
  1121. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1122. * CarbonLib: in CarbonLib 1.0 and later
  1123. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1124. }
  1125. function CMSetProfileDescriptions(prof: CMProfileRef; aName: ConstCStringPtr; aCount: UInt32; const (*var*) mName: Str255; mCode: ScriptCode; uName: ConstUniCharPtr; uCount: UniCharCount): CMError; external name '_CMSetProfileDescriptions';
  1126. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1127. {
  1128. * CMCopyProfileLocalizedStringDictionary()
  1129. *
  1130. * Availability:
  1131. * Mac OS X: in version 10.1 and later in ApplicationServices.framework
  1132. * CarbonLib: not available
  1133. * Non-Carbon CFM: in ColorSyncLib 3.1 and later
  1134. }
  1135. function CMCopyProfileLocalizedStringDictionary(prof: CMProfileRef; tag: OSType; var theDict: CFDictionaryRef): CMError; external name '_CMCopyProfileLocalizedStringDictionary';
  1136. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  1137. {
  1138. * CMSetProfileLocalizedStringDictionary()
  1139. *
  1140. * Availability:
  1141. * Mac OS X: in version 10.1 and later in ApplicationServices.framework
  1142. * CarbonLib: not available
  1143. * Non-Carbon CFM: in ColorSyncLib 3.1 and later
  1144. }
  1145. function CMSetProfileLocalizedStringDictionary(prof: CMProfileRef; tag: OSType; theDict: CFDictionaryRef): CMError; external name '_CMSetProfileLocalizedStringDictionary';
  1146. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  1147. {
  1148. * CMCopyProfileLocalizedString()
  1149. *
  1150. * Availability:
  1151. * Mac OS X: in version 10.1 and later in ApplicationServices.framework
  1152. * CarbonLib: not available
  1153. * Non-Carbon CFM: in ColorSyncLib 3.1 and later
  1154. }
  1155. function CMCopyProfileLocalizedString(prof: CMProfileRef; tag: OSType; reqLocale: CFStringRef; var locale: CFStringRef; var str: CFStringRef): CMError; external name '_CMCopyProfileLocalizedString';
  1156. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  1157. {
  1158. * CMCopyProfileDescriptionString()
  1159. *
  1160. * Summary:
  1161. * Returns the name of a profile as a CFString.
  1162. *
  1163. * Discussion:
  1164. * If the profile is multi-localized, the best localized name for
  1165. * the current process is returned.
  1166. *
  1167. * Parameters:
  1168. *
  1169. * prof:
  1170. * (in) the profile to query
  1171. *
  1172. * str:
  1173. * (out) returns the name
  1174. *
  1175. * Availability:
  1176. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  1177. * CarbonLib: not available
  1178. * Non-Carbon CFM: not available
  1179. }
  1180. function CMCopyProfileDescriptionString( prof: CMProfileRef; var str: CFStringRef ): CMError; external name '_CMCopyProfileDescriptionString';
  1181. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  1182. { Accessing Name-Class Profiles }
  1183. {
  1184. * CMGetNamedColorInfo()
  1185. *
  1186. * Availability:
  1187. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1188. * CarbonLib: in CarbonLib 1.0 and later
  1189. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1190. }
  1191. function CMGetNamedColorInfo(prof: CMProfileRef; var deviceChannels: UInt32; var deviceColorSpace: OSType; var PCSColorSpace: OSType; var count: UInt32; prefix: StringPtr; suffix: StringPtr): CMError; external name '_CMGetNamedColorInfo';
  1192. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1193. {
  1194. * CMGetNamedColorValue()
  1195. *
  1196. * Availability:
  1197. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1198. * CarbonLib: in CarbonLib 1.0 and later
  1199. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1200. }
  1201. function CMGetNamedColorValue(prof: CMProfileRef; name: StringPtr; var deviceColor: CMColor; var PCSColor: CMColor): CMError; external name '_CMGetNamedColorValue';
  1202. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1203. {
  1204. * CMGetIndNamedColorValue()
  1205. *
  1206. * Availability:
  1207. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1208. * CarbonLib: in CarbonLib 1.0 and later
  1209. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1210. }
  1211. function CMGetIndNamedColorValue(prof: CMProfileRef; index: UInt32; var deviceColor: CMColor; var PCSColor: CMColor): CMError; external name '_CMGetIndNamedColorValue';
  1212. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1213. {
  1214. * CMGetNamedColorIndex()
  1215. *
  1216. * Availability:
  1217. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1218. * CarbonLib: in CarbonLib 1.0 and later
  1219. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1220. }
  1221. function CMGetNamedColorIndex(prof: CMProfileRef; name: StringPtr; var index: UInt32): CMError; external name '_CMGetNamedColorIndex';
  1222. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1223. {
  1224. * CMGetNamedColorName()
  1225. *
  1226. * Availability:
  1227. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1228. * CarbonLib: in CarbonLib 1.0 and later
  1229. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1230. }
  1231. function CMGetNamedColorName(prof: CMProfileRef; index: UInt32; name: StringPtr): CMError; external name '_CMGetNamedColorName';
  1232. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1233. { General-purpose matching functions }
  1234. { Working with ColorWorlds }
  1235. {
  1236. * NCWNewColorWorld()
  1237. *
  1238. * Availability:
  1239. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1240. * CarbonLib: in CarbonLib 1.0 and later
  1241. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1242. }
  1243. function NCWNewColorWorld(var cw: CMWorldRef; src: CMProfileRef; dst: CMProfileRef): CMError; external name '_NCWNewColorWorld';
  1244. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1245. {
  1246. * CWConcatColorWorld()
  1247. *
  1248. * Availability:
  1249. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1250. * CarbonLib: in CarbonLib 1.0 and later
  1251. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1252. }
  1253. function CWConcatColorWorld(var cw: CMWorldRef; var profileSet: CMConcatProfileSet): CMError; external name '_CWConcatColorWorld';
  1254. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1255. {
  1256. * NCWConcatColorWorld()
  1257. *
  1258. * Availability:
  1259. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1260. * CarbonLib: in CarbonLib 1.0 and later
  1261. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1262. }
  1263. function NCWConcatColorWorld(var cw: CMWorldRef; var profileSet: NCMConcatProfileSet; proc: CMConcatCallBackUPP; refCon: UnivPtr): CMError; external name '_NCWConcatColorWorld';
  1264. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1265. {
  1266. * CMGetCWInfo()
  1267. *
  1268. * Availability:
  1269. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1270. * CarbonLib: in CarbonLib 1.0 and later
  1271. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1272. }
  1273. function CMGetCWInfo( cw: CMWorldRef; var info: CMCWInfoRecord ): CMError; external name '_CMGetCWInfo';
  1274. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1275. {
  1276. * CWDisposeColorWorld()
  1277. *
  1278. * Availability:
  1279. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1280. * CarbonLib: in CarbonLib 1.0 and later
  1281. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1282. }
  1283. procedure CWDisposeColorWorld(cw: CMWorldRef); external name '_CWDisposeColorWorld';
  1284. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1285. {
  1286. * CWMatchColors()
  1287. *
  1288. * Availability:
  1289. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1290. * CarbonLib: in CarbonLib 1.0 and later
  1291. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1292. }
  1293. function CWMatchColors(cw: CMWorldRef; var myColors: CMColor; count: UInt32): CMError; external name '_CWMatchColors';
  1294. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1295. {
  1296. * CWCheckColors()
  1297. *
  1298. * Availability:
  1299. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1300. * CarbonLib: in CarbonLib 1.0 and later
  1301. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1302. }
  1303. function CWCheckColors(cw: CMWorldRef; var myColors: CMColor; count: UInt32; var result: SInt8): CMError; external name '_CWCheckColors';
  1304. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1305. {
  1306. * CWMatchBitmap()
  1307. *
  1308. * Availability:
  1309. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1310. * CarbonLib: in CarbonLib 1.0 and later
  1311. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1312. }
  1313. function CWMatchBitmap(cw: CMWorldRef; var bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UnivPtr; var matchedBitmap: CMBitmap): CMError; external name '_CWMatchBitmap';
  1314. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1315. {
  1316. * CWCheckBitmap()
  1317. *
  1318. * Availability:
  1319. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1320. * CarbonLib: in CarbonLib 1.0 and later
  1321. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1322. }
  1323. function CWCheckBitmap(cw: CMWorldRef; const (*var*) bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UnivPtr; var resultBitmap: CMBitmap): CMError; external name '_CWCheckBitmap';
  1324. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1325. { OpenGL support }
  1326. const
  1327. cmTextureRGBtoRGBX8 = 0; { RGB to 8-bit RGBx texture}
  1328. {
  1329. * CWFillLookupTexture()
  1330. *
  1331. * Summary:
  1332. * Fills a 3d lookup texture from a colorworld.
  1333. *
  1334. * Discussion:
  1335. * The resulting table is suitable for use in OpenGL to accelerate
  1336. * color management in hardware.
  1337. *
  1338. * Parameters:
  1339. *
  1340. * cw:
  1341. * (in) the colorworld to use
  1342. *
  1343. * gridPoints:
  1344. * (in) number of grid points per channel in the texture
  1345. *
  1346. * format:
  1347. * (in) format of pixels in texture (e.g. cmTextureRGBtoRGBX8)
  1348. *
  1349. * dataSize:
  1350. * (in) size in bytes of texture data to fill
  1351. *
  1352. * data:
  1353. * (in/out) pointer to texture data to fill
  1354. *
  1355. * Availability:
  1356. * Mac OS X: in version 10.3 and later in ApplicationServices.framework
  1357. * CarbonLib: not available
  1358. * Non-Carbon CFM: not available
  1359. }
  1360. function CWFillLookupTexture( cw: CMWorldRef; gridPoints: UInt32; format: UInt32; dataSize: UInt32; data: UnivPtr ): CMError; external name '_CWFillLookupTexture';
  1361. (* AVAILABLE_MAC_OS_X_VERSION_10_3_AND_LATER *)
  1362. { Quickdraw-specific matching }
  1363. { Mac OS X active declarations are in QuickDraw.p[.pas] }
  1364. {$ifc TARGET_OS_MAC AND _DECLARE_CS_QD_API_}
  1365. {
  1366. * CWMatchPixMap()
  1367. *
  1368. * Availability:
  1369. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1370. * CarbonLib: in CarbonLib 1.0 and later
  1371. * Mac OS X: not available
  1372. }
  1373. function CWMatchPixMap(cw: CMWorldRef; var myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UnivPtr): CMError; external name '_CWMatchPixMap';
  1374. {
  1375. * CWCheckPixMap()
  1376. *
  1377. * Availability:
  1378. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1379. * CarbonLib: in CarbonLib 1.0 and later
  1380. * Mac OS X: not available
  1381. }
  1382. function CWCheckPixMap(cw: CMWorldRef; var myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UnivPtr; var resultBitMap: BitMap): CMError; external name '_CWCheckPixMap';
  1383. {
  1384. * NCMBeginMatching()
  1385. *
  1386. * Availability:
  1387. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1388. * CarbonLib: in CarbonLib 1.0 and later
  1389. * Mac OS X: not available
  1390. }
  1391. function NCMBeginMatching(src: CMProfileRef; dst: CMProfileRef; var myRef: CMMatchRef): CMError; external name '_NCMBeginMatching';
  1392. {
  1393. * CMEndMatching()
  1394. *
  1395. * Availability:
  1396. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1397. * CarbonLib: in CarbonLib 1.0 and later
  1398. * Mac OS X: not available
  1399. }
  1400. procedure CMEndMatching(myRef: CMMatchRef); external name '_CMEndMatching';
  1401. {
  1402. * NCMDrawMatchedPicture()
  1403. *
  1404. * Availability:
  1405. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1406. * CarbonLib: in CarbonLib 1.0 and later
  1407. * Mac OS X: not available
  1408. }
  1409. procedure NCMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileRef; var myRect: Rect); external name '_NCMDrawMatchedPicture';
  1410. {
  1411. * CMEnableMatchingComment()
  1412. *
  1413. * Availability:
  1414. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1415. * CarbonLib: in CarbonLib 1.0 and later
  1416. * Mac OS X: not available
  1417. }
  1418. procedure CMEnableMatchingComment(enableIt: boolean); external name '_CMEnableMatchingComment';
  1419. {
  1420. * NCMUseProfileComment()
  1421. *
  1422. * Availability:
  1423. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1424. * CarbonLib: in CarbonLib 1.0 and later
  1425. * Mac OS X: not available
  1426. }
  1427. function NCMUseProfileComment(prof: CMProfileRef; flags: UInt32): CMError; external name '_NCMUseProfileComment';
  1428. {$endc}
  1429. {$ifc TARGET_OS_WIN32}
  1430. {$ifc CALL_NOT_IN_CARBON}
  1431. {
  1432. * CWMatchHBITMAP()
  1433. *
  1434. * Availability:
  1435. * Non-Carbon CFM: not available
  1436. * CarbonLib: not available
  1437. * Mac OS X: not available
  1438. }
  1439. function CWMatchHBITMAP(cw: CMWorldRef; hBitmap_: HBITMAP; progressProc: CMBitmapCallBackUPP; refCon: UnivPtr): CMError; external name '_CWMatchHBITMAP';
  1440. {$endc} {CALL_NOT_IN_CARBON}
  1441. {$endc} {TARGET_OS_WIN32}
  1442. { Accessing Special Profiles }
  1443. { System Profile access }
  1444. {
  1445. * CMGetSystemProfile()
  1446. *
  1447. * Availability:
  1448. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1449. * CarbonLib: in CarbonLib 1.0 and later
  1450. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1451. }
  1452. function CMGetSystemProfile(var prof: CMProfileRef): CMError; external name '_CMGetSystemProfile';
  1453. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1454. {
  1455. * CMSetSystemProfile()
  1456. *
  1457. * Availability:
  1458. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1459. * CarbonLib: in CarbonLib 1.0 and later
  1460. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1461. }
  1462. function CMSetSystemProfile(const (*var*) profileFileSpec: FSSpec): CMError; external name '_CMSetSystemProfile';
  1463. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1464. {
  1465. * NCMSetSystemProfile()
  1466. *
  1467. * Availability:
  1468. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1469. * CarbonLib: in CarbonLib 1.0 and later
  1470. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1471. }
  1472. function NCMSetSystemProfile(const (*var*) profLoc: CMProfileLocation): CMError; external name '_NCMSetSystemProfile';
  1473. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1474. {
  1475. * CMGetDefaultProfileBySpace()
  1476. *
  1477. * Availability:
  1478. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1479. * CarbonLib: in CarbonLib 1.0 and later
  1480. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1481. }
  1482. function CMGetDefaultProfileBySpace(dataColorSpace: OSType; var prof: CMProfileRef): CMError; external name '_CMGetDefaultProfileBySpace';
  1483. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1484. {
  1485. * CMSetDefaultProfileBySpace()
  1486. *
  1487. * Availability:
  1488. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1489. * CarbonLib: in CarbonLib 1.0 and later
  1490. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1491. }
  1492. function CMSetDefaultProfileBySpace(dataColorSpace: OSType; prof: CMProfileRef): CMError; external name '_CMSetDefaultProfileBySpace';
  1493. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1494. { Profile access by Use }
  1495. {
  1496. * CMGetDefaultProfileByUse()
  1497. *
  1498. * Availability:
  1499. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1500. * CarbonLib: in CarbonLib 1.0 and later
  1501. * Non-Carbon CFM: in ColorSyncLib 3.0 and later
  1502. }
  1503. function CMGetDefaultProfileByUse(use: OSType; var prof: CMProfileRef): CMError; external name '_CMGetDefaultProfileByUse';
  1504. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1505. {
  1506. * CMSetDefaultProfileByUse()
  1507. *
  1508. * Availability:
  1509. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1510. * CarbonLib: in CarbonLib 1.0 and later
  1511. * Non-Carbon CFM: in ColorSyncLib 3.0 and later
  1512. }
  1513. function CMSetDefaultProfileByUse(use: OSType; prof: CMProfileRef): CMError; external name '_CMSetDefaultProfileByUse';
  1514. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1515. {
  1516. * CMGetProfileByAVID()
  1517. *
  1518. * Availability:
  1519. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1520. * CarbonLib: in CarbonLib 1.0 and later
  1521. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1522. }
  1523. function CMGetProfileByAVID(theID: CMDisplayIDType; var prof: CMProfileRef): CMError; external name '_CMGetProfileByAVID';
  1524. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1525. {
  1526. * CMSetProfileByAVID()
  1527. *
  1528. * Availability:
  1529. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1530. * CarbonLib: in CarbonLib 1.0 and later
  1531. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1532. }
  1533. function CMSetProfileByAVID(theID: CMDisplayIDType; prof: CMProfileRef): CMError; external name '_CMSetProfileByAVID';
  1534. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1535. {
  1536. * CMGetGammaByAVID()
  1537. *
  1538. * Availability:
  1539. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1540. * CarbonLib: in CarbonLib 1.0 and later
  1541. * Non-Carbon CFM: in ColorSyncLib 3.0 and later
  1542. }
  1543. function CMGetGammaByAVID(theID: CMDisplayIDType; var gamma: CMVideoCardGamma; var size: UInt32): CMError; external name '_CMGetGammaByAVID';
  1544. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1545. {
  1546. * CMSetGammaByAVID()
  1547. *
  1548. * Availability:
  1549. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1550. * CarbonLib: in CarbonLib 1.0 and later
  1551. * Non-Carbon CFM: in ColorSyncLib 3.0 and later
  1552. }
  1553. function CMSetGammaByAVID(theID: CMDisplayIDType; var gamma: CMVideoCardGamma): CMError; external name '_CMSetGammaByAVID';
  1554. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1555. { Profile Management }
  1556. { Searching for Profiles }
  1557. {
  1558. * CMIterateColorSyncFolder()
  1559. *
  1560. * Availability:
  1561. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1562. * CarbonLib: in CarbonLib 1.0 and later
  1563. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1564. }
  1565. function CMIterateColorSyncFolder(proc: CMProfileIterateUPP; var seed: UInt32; var count: UInt32; refCon: UnivPtr): CMError; external name '_CMIterateColorSyncFolder';
  1566. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1567. {
  1568. * CMGetColorSyncFolderSpec()
  1569. *
  1570. * Availability:
  1571. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1572. * CarbonLib: in CarbonLib 1.0 and later
  1573. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1574. }
  1575. function CMGetColorSyncFolderSpec(vRefNum: SInt16; createFolder: boolean; var foundVRefNum: SInt16; var foundDirID: SInt32): CMError; external name '_CMGetColorSyncFolderSpec';
  1576. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1577. {
  1578. * CMNewProfileSearch()
  1579. *
  1580. * Availability:
  1581. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1582. * CarbonLib: in CarbonLib 1.0 and later
  1583. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1584. }
  1585. function CMNewProfileSearch(var searchSpec: CMSearchRecord; refCon: UnivPtr; var count: UInt32; var searchResult: CMProfileSearchRef): CMError; external name '_CMNewProfileSearch';
  1586. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1587. {
  1588. * CMUpdateProfileSearch()
  1589. *
  1590. * Availability:
  1591. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1592. * CarbonLib: in CarbonLib 1.0 and later
  1593. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1594. }
  1595. function CMUpdateProfileSearch(search: CMProfileSearchRef; refCon: UnivPtr; var count: UInt32): CMError; external name '_CMUpdateProfileSearch';
  1596. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1597. {
  1598. * CMDisposeProfileSearch()
  1599. *
  1600. * Availability:
  1601. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1602. * CarbonLib: in CarbonLib 1.0 and later
  1603. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1604. }
  1605. procedure CMDisposeProfileSearch(search: CMProfileSearchRef); external name '_CMDisposeProfileSearch';
  1606. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1607. {
  1608. * CMSearchGetIndProfile()
  1609. *
  1610. * Availability:
  1611. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1612. * CarbonLib: in CarbonLib 1.0 and later
  1613. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1614. }
  1615. function CMSearchGetIndProfile(search: CMProfileSearchRef; index: UInt32; var prof: CMProfileRef): CMError; external name '_CMSearchGetIndProfile';
  1616. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1617. {
  1618. * CMSearchGetIndProfileFileSpec()
  1619. *
  1620. * Availability:
  1621. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1622. * CarbonLib: in CarbonLib 1.0 and later
  1623. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1624. }
  1625. function CMSearchGetIndProfileFileSpec(search: CMProfileSearchRef; index: UInt32; var profileFile: FSSpec): CMError; external name '_CMSearchGetIndProfileFileSpec';
  1626. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1627. {
  1628. * CMCreateProfileIdentifier()
  1629. *
  1630. * Availability:
  1631. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1632. * CarbonLib: in CarbonLib 1.0 and later
  1633. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1634. }
  1635. function CMCreateProfileIdentifier(prof: CMProfileRef; ident: CMProfileIdentifierPtr; var size: UInt32): CMError; external name '_CMCreateProfileIdentifier';
  1636. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1637. {
  1638. * CMProfileIdentifierFolderSearch()
  1639. *
  1640. * Availability:
  1641. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1642. * CarbonLib: in CarbonLib 1.0 and later
  1643. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1644. }
  1645. function CMProfileIdentifierFolderSearch(ident: CMProfileIdentifierPtr; var matchedCount: UInt32; var searchResult: CMProfileSearchRef): CMError; external name '_CMProfileIdentifierFolderSearch';
  1646. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1647. {
  1648. * CMProfileIdentifierListSearch()
  1649. *
  1650. * Availability:
  1651. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1652. * CarbonLib: in CarbonLib 1.0 and later
  1653. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1654. }
  1655. function CMProfileIdentifierListSearch(ident: CMProfileIdentifierPtr; var profileList: CMProfileRef; listSize: UInt32; var matchedCount: UInt32; var matchedList: CMProfileRef): CMError; external name '_CMProfileIdentifierListSearch';
  1656. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1657. {$ifc TARGET_API_MAC_OS8}
  1658. {$ifc CALL_NOT_IN_CARBON}
  1659. {
  1660. * CMConvertProfile2to1()
  1661. *
  1662. * Availability:
  1663. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1664. * CarbonLib: not available
  1665. * Mac OS X: not available
  1666. }
  1667. function CMConvertProfile2to1(profv2: CMProfileRef; var profv1: CMProfileHandle): CMError; external name '_CMConvertProfile2to1';
  1668. {$endc} {CALL_NOT_IN_CARBON}
  1669. {$endc} {TARGET_API_MAC_OS8}
  1670. { Utilities }
  1671. {
  1672. * CMGetPreferredCMM()
  1673. *
  1674. * Availability:
  1675. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1676. * CarbonLib: in CarbonLib 1.0 and later
  1677. * Non-Carbon CFM: in ColorSyncLib 2.5 and later
  1678. }
  1679. function CMGetPreferredCMM(var cmmType: OSType; var preferredCMMnotfound: boolean): CMError; external name '_CMGetPreferredCMM';
  1680. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1681. {
  1682. * CMIterateCMMInfo()
  1683. *
  1684. * Availability:
  1685. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1686. * CarbonLib: in CarbonLib 1.0 and later
  1687. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1688. }
  1689. function CMIterateCMMInfo(proc: CMMIterateUPP; var count: UInt32; refCon: UnivPtr): CMError; external name '_CMIterateCMMInfo';
  1690. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1691. {
  1692. * CMGetColorSyncVersion()
  1693. *
  1694. * Availability:
  1695. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1696. * CarbonLib: in CarbonLib 1.0 and later
  1697. * Non-Carbon CFM: in ColorSyncLib 2.6 and later
  1698. }
  1699. function CMGetColorSyncVersion(var version: UInt32): CMError; external name '_CMGetColorSyncVersion';
  1700. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1701. {
  1702. * CMLaunchControlPanel()
  1703. *
  1704. * Availability:
  1705. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1706. * CarbonLib: in CarbonLib 1.0 and later
  1707. * Non-Carbon CFM: in ColorSyncLib 3.0 and later
  1708. }
  1709. function CMLaunchControlPanel(flags: UInt32): CMError; external name '_CMLaunchControlPanel';
  1710. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1711. { ColorSpace conversion functions }
  1712. { Converting Colors }
  1713. {
  1714. * CMConvertXYZToLab()
  1715. *
  1716. * Availability:
  1717. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1718. * CarbonLib: in CarbonLib 1.0 and later
  1719. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1720. }
  1721. function CMConvertXYZToLab(const (*var*) src: CMColor; const (*var*) white: CMXYZColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertXYZToLab';
  1722. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1723. {
  1724. * CMConvertLabToXYZ()
  1725. *
  1726. * Availability:
  1727. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1728. * CarbonLib: in CarbonLib 1.0 and later
  1729. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1730. }
  1731. function CMConvertLabToXYZ(const (*var*) src: CMColor; const (*var*) white: CMXYZColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertLabToXYZ';
  1732. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1733. {
  1734. * CMConvertXYZToLuv()
  1735. *
  1736. * Availability:
  1737. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1738. * CarbonLib: in CarbonLib 1.0 and later
  1739. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1740. }
  1741. function CMConvertXYZToLuv(const (*var*) src: CMColor; const (*var*) white: CMXYZColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertXYZToLuv';
  1742. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1743. {
  1744. * CMConvertLuvToXYZ()
  1745. *
  1746. * Availability:
  1747. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1748. * CarbonLib: in CarbonLib 1.0 and later
  1749. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1750. }
  1751. function CMConvertLuvToXYZ(const (*var*) src: CMColor; const (*var*) white: CMXYZColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertLuvToXYZ';
  1752. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1753. {
  1754. * CMConvertXYZToYxy()
  1755. *
  1756. * Availability:
  1757. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1758. * CarbonLib: in CarbonLib 1.0 and later
  1759. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1760. }
  1761. function CMConvertXYZToYxy(const (*var*) src: CMColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertXYZToYxy';
  1762. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1763. {
  1764. * CMConvertYxyToXYZ()
  1765. *
  1766. * Availability:
  1767. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1768. * CarbonLib: in CarbonLib 1.0 and later
  1769. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1770. }
  1771. function CMConvertYxyToXYZ(const (*var*) src: CMColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertYxyToXYZ';
  1772. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1773. {
  1774. * CMConvertRGBToHLS()
  1775. *
  1776. * Availability:
  1777. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1778. * CarbonLib: in CarbonLib 1.0 and later
  1779. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1780. }
  1781. function CMConvertRGBToHLS(const (*var*) src: CMColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertRGBToHLS';
  1782. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1783. {
  1784. * CMConvertHLSToRGB()
  1785. *
  1786. * Availability:
  1787. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1788. * CarbonLib: in CarbonLib 1.0 and later
  1789. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1790. }
  1791. function CMConvertHLSToRGB(const (*var*) src: CMColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertHLSToRGB';
  1792. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1793. {
  1794. * CMConvertRGBToHSV()
  1795. *
  1796. * Availability:
  1797. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1798. * CarbonLib: in CarbonLib 1.0 and later
  1799. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1800. }
  1801. function CMConvertRGBToHSV(const (*var*) src: CMColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertRGBToHSV';
  1802. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1803. {
  1804. * CMConvertHSVToRGB()
  1805. *
  1806. * Availability:
  1807. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1808. * CarbonLib: in CarbonLib 1.0 and later
  1809. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1810. }
  1811. function CMConvertHSVToRGB(const (*var*) src: CMColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertHSVToRGB';
  1812. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1813. {
  1814. * CMConvertRGBToGray()
  1815. *
  1816. * Availability:
  1817. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1818. * CarbonLib: in CarbonLib 1.0 and later
  1819. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1820. }
  1821. function CMConvertRGBToGray(const (*var*) src: CMColor; var dst: CMColor; count: UInt32): CMError; external name '_CMConvertRGBToGray';
  1822. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1823. {
  1824. * CMConvertXYZToFixedXYZ()
  1825. *
  1826. * Availability:
  1827. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1828. * CarbonLib: in CarbonLib 1.0 and later
  1829. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1830. }
  1831. function CMConvertXYZToFixedXYZ(const (*var*) src: CMXYZColor; var dst: CMFixedXYZColor; count: UInt32): CMError; external name '_CMConvertXYZToFixedXYZ';
  1832. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1833. {
  1834. * CMConvertFixedXYZToXYZ()
  1835. *
  1836. * Availability:
  1837. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1838. * CarbonLib: in CarbonLib 1.0 and later
  1839. * Non-Carbon CFM: in ColorSyncLib 2.1 and later
  1840. }
  1841. function CMConvertFixedXYZToXYZ(const (*var*) src: CMFixedXYZColor; var dst: CMXYZColor; count: UInt32): CMError; external name '_CMConvertFixedXYZToXYZ';
  1842. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1843. {
  1844. * CMConvertXYZToXYZ()
  1845. *
  1846. * Availability:
  1847. * Mac OS X: in version 10.1 and later in ApplicationServices.framework
  1848. * CarbonLib: not available
  1849. * Non-Carbon CFM: not available
  1850. }
  1851. 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';
  1852. (* AVAILABLE_MAC_OS_X_VERSION_10_1_AND_LATER *)
  1853. { PS-related }
  1854. { Working with PostScript }
  1855. {
  1856. * CMGetPS2ColorSpace()
  1857. *
  1858. * Availability:
  1859. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1860. * CarbonLib: in CarbonLib 1.0 and later
  1861. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1862. }
  1863. function CMGetPS2ColorSpace(srcProf: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UnivPtr; var preferredCMMnotfound: boolean): CMError; external name '_CMGetPS2ColorSpace';
  1864. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1865. {
  1866. * CMGetPS2ColorRenderingIntent()
  1867. *
  1868. * Availability:
  1869. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1870. * CarbonLib: in CarbonLib 1.0 and later
  1871. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1872. }
  1873. function CMGetPS2ColorRenderingIntent(srcProf: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UnivPtr; var preferredCMMnotfound: boolean): CMError; external name '_CMGetPS2ColorRenderingIntent';
  1874. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1875. {
  1876. * CMGetPS2ColorRendering()
  1877. *
  1878. * Availability:
  1879. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1880. * CarbonLib: in CarbonLib 1.0 and later
  1881. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1882. }
  1883. function CMGetPS2ColorRendering(srcProf: CMProfileRef; dstProf: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UnivPtr; var preferredCMMnotfound: boolean): CMError; external name '_CMGetPS2ColorRendering';
  1884. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1885. {
  1886. * CMGetPS2ColorRenderingVMSize()
  1887. *
  1888. * Availability:
  1889. * Mac OS X: in version 10.0 and later in ApplicationServices.framework
  1890. * CarbonLib: in CarbonLib 1.0 and later
  1891. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1892. }
  1893. function CMGetPS2ColorRenderingVMSize(srcProf: CMProfileRef; dstProf: CMProfileRef; var vmSize: UInt32; var preferredCMMnotfound: boolean): CMError; external name '_CMGetPS2ColorRenderingVMSize';
  1894. (* AVAILABLE_MAC_OS_X_VERSION_10_0_AND_LATER *)
  1895. { Notifications }
  1896. {
  1897. * Clients can register for notifications of ColorSync preference changes by
  1898. * using the kCMPrefsChangedNotification key. This notification will be sent
  1899. * if the user changes ColorSync preferences such as:
  1900. * the default profile by colors space, (CMSetDefaultProfileBySpace)
  1901. * the default profile by device useage, (CMSetDefaultProfileByUse)
  1902. * or the preferred CMM.
  1903. * See <CMDeviceIntegration.h> for more notifications that can be sent.
  1904. }
  1905. {$ifc USE_CFSTR_CONSTANT_MACROS}
  1906. {$definec kCMPrefsChangedNotification CFSTRP('AppleColorSyncPreferencesChangedNotification')}
  1907. {$endc}
  1908. { ColorSync 1.0 functions which have parallel 2.0 counterparts }
  1909. {$ifc TARGET_API_MAC_OS8}
  1910. {$ifc CALL_NOT_IN_CARBON}
  1911. {
  1912. * CWNewColorWorld()
  1913. *
  1914. * Availability:
  1915. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1916. * CarbonLib: not available
  1917. * Mac OS X: not available
  1918. }
  1919. function CWNewColorWorld(var cw: CMWorldRef; src: CMProfileHandle; dst: CMProfileHandle): CMError; external name '_CWNewColorWorld';
  1920. {
  1921. * ConcatenateProfiles()
  1922. *
  1923. * Availability:
  1924. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1925. * CarbonLib: not available
  1926. * Mac OS X: not available
  1927. }
  1928. function ConcatenateProfiles(thru: CMProfileHandle; dst: CMProfileHandle; var newDst: CMProfileHandle): CMError; external name '_ConcatenateProfiles';
  1929. {
  1930. * CMBeginMatching()
  1931. *
  1932. * Availability:
  1933. * Non-Carbon CFM: in ColorSyncLib 2.0 and later
  1934. * CarbonLib: not available
  1935. * Mac OS X: not available
  1936. }
  1937. function CMBeginMatching(src: CMProfileHandle; dst: CMProfileHandle; var myRef: CMMatchRef): CMError; external name '_CMBeginMatching';
  1938. {
  1939. * CMDrawMatchedPicture()
  1940. *
  1941. * Availability:
  1942. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1943. * CarbonLib: not available
  1944. * Mac OS X: not available
  1945. }
  1946. procedure CMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileHandle; var myRect: Rect); external name '_CMDrawMatchedPicture';
  1947. {
  1948. * CMUseProfileComment()
  1949. *
  1950. * Availability:
  1951. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1952. * CarbonLib: not available
  1953. * Mac OS X: not available
  1954. }
  1955. function CMUseProfileComment(profile: CMProfileHandle): CMError; external name '_CMUseProfileComment';
  1956. {
  1957. * CMGetProfileName()
  1958. *
  1959. * Availability:
  1960. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1961. * CarbonLib: not available
  1962. * Mac OS X: not available
  1963. }
  1964. procedure CMGetProfileName(myProfile: CMProfileHandle; var IStringResult: CMIString); external name '_CMGetProfileName';
  1965. {
  1966. * CMGetProfileAdditionalDataOffset()
  1967. *
  1968. * Availability:
  1969. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1970. * CarbonLib: not available
  1971. * Mac OS X: not available
  1972. }
  1973. function CMGetProfileAdditionalDataOffset(myProfile: CMProfileHandle): SInt32; external name '_CMGetProfileAdditionalDataOffset';
  1974. { ProfileResponder definitions }
  1975. {$endc} {CALL_NOT_IN_CARBON}
  1976. const
  1977. cmSystemDevice = $73797320 (* 'sys ' *);
  1978. cmGDevice = $67646576 (* 'gdev' *);
  1979. { ProfileResponder functions }
  1980. {$ifc CALL_NOT_IN_CARBON}
  1981. {
  1982. * GetProfile()
  1983. *
  1984. * Availability:
  1985. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1986. * CarbonLib: not available
  1987. * Mac OS X: not available
  1988. }
  1989. function GetProfile(deviceType: OSType; refNum: SInt32; aProfile: CMProfileHandle; var returnedProfile: CMProfileHandle): CMError; external name '_GetProfile';
  1990. {
  1991. * SetProfile()
  1992. *
  1993. * Availability:
  1994. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  1995. * CarbonLib: not available
  1996. * Mac OS X: not available
  1997. }
  1998. function SetProfile(deviceType: OSType; refNum: SInt32; newProfile: CMProfileHandle): CMError; external name '_SetProfile';
  1999. {
  2000. * SetProfileDescription()
  2001. *
  2002. * Availability:
  2003. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  2004. * CarbonLib: not available
  2005. * Mac OS X: not available
  2006. }
  2007. function SetProfileDescription(deviceType: OSType; refNum: SInt32; deviceData: SInt32; hProfile: CMProfileHandle): CMError; external name '_SetProfileDescription';
  2008. {
  2009. * GetIndexedProfile()
  2010. *
  2011. * Availability:
  2012. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  2013. * CarbonLib: not available
  2014. * Mac OS X: not available
  2015. }
  2016. function GetIndexedProfile(deviceType: OSType; refNum: SInt32; search: CMProfileSearchRecordHandle; var returnProfile: CMProfileHandle; var index: SInt32): CMError; external name '_GetIndexedProfile';
  2017. {
  2018. * DeleteDeviceProfile()
  2019. *
  2020. * Availability:
  2021. * Non-Carbon CFM: in ColorSyncLib 1.0 and later
  2022. * CarbonLib: not available
  2023. * Mac OS X: not available
  2024. }
  2025. function DeleteDeviceProfile(deviceType: OSType; refNum: SInt32; deleteMe: CMProfileHandle): CMError; external name '_DeleteDeviceProfile';
  2026. {$endc} {CALL_NOT_IN_CARBON}
  2027. {$ifc OLDROUTINENAMES}
  2028. { old constants }
  2029. type
  2030. CMFlattenProc = CMFlattenProcPtr;
  2031. CMBitmapCallBackProc = CMBitmapCallBackProcPtr;
  2032. CMProfileFilterProc = CMProfileFilterProcPtr;
  2033. const
  2034. qdSystemDevice = $73797320 (* 'sys ' *);
  2035. qdGDevice = $67646576 (* 'gdev' *);
  2036. kMatchCMMType = $00000001;
  2037. kMatchApplProfileVersion = $00000002;
  2038. kMatchDataType = $00000004;
  2039. kMatchDeviceType = $00000008;
  2040. kMatchDeviceManufacturer = $00000010;
  2041. kMatchDeviceModel = $00000020;
  2042. kMatchDeviceAttributes = $00000040;
  2043. kMatchFlags = $00000080;
  2044. kMatchOptions = $00000100;
  2045. kMatchWhite = $00000200;
  2046. kMatchBlack = $00000400;
  2047. { old types }
  2048. type
  2049. CMYKColor = CMCMYKColor;
  2050. CMYKColorPtr = ^CMYKColor;
  2051. CWorld = CMWorldRef;
  2052. CMGamutResult = ^SInt32;
  2053. { old functions }
  2054. {$endc} {OLDROUTINENAMES}
  2055. { Deprecated stuff }
  2056. { PrGeneral parameter blocks }
  2057. const
  2058. enableColorMatchingOp = 12;
  2059. registerProfileOp = 13;
  2060. type
  2061. TEnableColorMatchingBlkPtr = ^TEnableColorMatchingBlk;
  2062. TEnableColorMatchingBlk = record
  2063. iOpCode: SInt16;
  2064. iError: SInt16;
  2065. lReserved: SInt32;
  2066. hPrint: THPrint;
  2067. fEnableIt: boolean;
  2068. filler: SInt8;
  2069. end;
  2070. TRegisterProfileBlkPtr = ^TRegisterProfileBlk;
  2071. TRegisterProfileBlk = record
  2072. iOpCode: SInt16;
  2073. iError: SInt16;
  2074. lReserved: SInt32;
  2075. hPrint: THPrint;
  2076. fRegisterIt: boolean;
  2077. filler: SInt8;
  2078. end;
  2079. {$endc} {TARGET_API_MAC_OS8}
  2080. {$ALIGN MAC68K}
  2081. end.