CMMComponent.pas 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393
  1. {
  2. File: CMMComponent.p
  3. Contains: ColorSync CMM Component API
  4. Version: Technology: ColorSync 2.6
  5. Release: Universal Interfaces 3.4.2
  6. Copyright: © 1994-2002 by Apple Computer, Inc., all rights reserved.
  7. Bugs?: For bug reports, consult the following page on
  8. the World Wide Web:
  9. http://www.freepascal.org/bugs.html
  10. }
  11. {
  12. Modified for use with Free Pascal
  13. Version 200
  14. Please report any bugs to <[email protected]>
  15. }
  16. {$mode macpas}
  17. {$packenum 1}
  18. {$macro on}
  19. {$inline on}
  20. {$CALLING MWPASCAL}
  21. unit CMMComponent;
  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,Files,CMTypes,CMICCProfile,CMApplication,Quickdraw,Components;
  92. {$ALIGN MAC68K}
  93. { Component-based CMM interface version }
  94. const
  95. CMMInterfaceVersion = 1;
  96. { Component-based CMM function selectors }
  97. { Required }
  98. kCMMOpen = -1; { kComponentOpenSelect, }
  99. kCMMClose = -2; { kComponentCloseSelect, }
  100. kCMMGetInfo = -4; { kComponentVersionSelect }
  101. kNCMMInit = 6;
  102. kCMMMatchColors = 1;
  103. kCMMCheckColors = 2; { }
  104. { }
  105. { Optional }
  106. kCMMValidateProfile = 8;
  107. kCMMMatchBitmap = 9;
  108. kCMMCheckBitmap = 10;
  109. kCMMConcatenateProfiles = 5;
  110. kCMMConcatInit = 7;
  111. kCMMNewLinkProfile = 16;
  112. kNCMMConcatInit = 18;
  113. kNCMMNewLinkProfile = 19;
  114. kCMMGetPS2ColorSpace = 11;
  115. kCMMGetPS2ColorRenderingIntent = 12;
  116. kCMMGetPS2ColorRendering = 13;
  117. kCMMGetPS2ColorRenderingVMSize = 17; { }
  118. { }
  119. { obsolete with ColorSync 2.5 }
  120. kCMMFlattenProfile = 14;
  121. kCMMUnflattenProfile = 15; { }
  122. { }
  123. { obsolete with ColorSync 2.6 }
  124. kCMMInit = 0;
  125. kCMMGetNamedColorInfo = 70;
  126. kCMMGetNamedColorValue = 71;
  127. kCMMGetIndNamedColorValue = 72;
  128. kCMMGetNamedColorIndex = 73;
  129. kCMMGetNamedColorName = 74; { }
  130. { }
  131. { obsolete with ColorSync 3.0 }
  132. kCMMMatchPixMap = 3;
  133. kCMMCheckPixMap = 4;
  134. {$ifc TARGET_API_MAC_OS8}
  135. type
  136. CMMComponentInst = ComponentInstance;
  137. {$ifc CALL_NOT_IN_CARBON}
  138. {
  139. * NCMMInit()
  140. *
  141. * Availability:
  142. * Non-Carbon CFM: not available
  143. * CarbonLib: not available
  144. * Mac OS X: not available
  145. }
  146. function NCMMInit(cmm: CMMComponentInst; srcProfile: CMProfileRef; dstProfile: CMProfileRef): CMError; external name '_NCMMInit';
  147. {
  148. * CMMInit()
  149. *
  150. * Availability:
  151. * Non-Carbon CFM: not available
  152. * CarbonLib: not available
  153. * Mac OS X: not available
  154. }
  155. function CMMInit(cmm: CMMComponentInst; srcProfile: CMProfileHandle; dstProfile: CMProfileHandle): CMError; external name '_CMMInit';
  156. {
  157. * CMMMatchColors()
  158. *
  159. * Availability:
  160. * Non-Carbon CFM: not available
  161. * CarbonLib: not available
  162. * Mac OS X: not available
  163. }
  164. function CMMMatchColors(cmm: CMMComponentInst; var colors: CMColor; count: UInt32): CMError; external name '_CMMMatchColors';
  165. {
  166. * CMMCheckColors()
  167. *
  168. * Availability:
  169. * Non-Carbon CFM: not available
  170. * CarbonLib: not available
  171. * Mac OS X: not available
  172. }
  173. function CMMCheckColors(cmm: CMMComponentInst; var colors: CMColor; count: UInt32; var result: UInt32): CMError; external name '_CMMCheckColors';
  174. {
  175. * CMMValidateProfile()
  176. *
  177. * Availability:
  178. * Non-Carbon CFM: not available
  179. * CarbonLib: not available
  180. * Mac OS X: not available
  181. }
  182. function CMMValidateProfile(cmm: CMMComponentInst; prof: CMProfileRef; var valid: boolean): CMError; external name '_CMMValidateProfile';
  183. {
  184. * CMMFlattenProfile()
  185. *
  186. * Availability:
  187. * Non-Carbon CFM: not available
  188. * CarbonLib: not available
  189. * Mac OS X: not available
  190. }
  191. function CMMFlattenProfile(cmm: CMMComponentInst; prof: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UnivPtr): CMError; external name '_CMMFlattenProfile';
  192. {
  193. * CMMUnflattenProfile()
  194. *
  195. * Availability:
  196. * Non-Carbon CFM: not available
  197. * CarbonLib: not available
  198. * Mac OS X: not available
  199. }
  200. function CMMUnflattenProfile(cmm: CMMComponentInst; var resultFileSpec: FSSpec; proc: CMFlattenUPP; refCon: UnivPtr): CMError; external name '_CMMUnflattenProfile';
  201. {
  202. * CMMMatchBitmap()
  203. *
  204. * Availability:
  205. * Non-Carbon CFM: not available
  206. * CarbonLib: not available
  207. * Mac OS X: not available
  208. }
  209. function CMMMatchBitmap(cmm: CMMComponentInst; var bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UnivPtr; var matchedBitmap: CMBitmap): CMError; external name '_CMMMatchBitmap';
  210. {
  211. * CMMCheckBitmap()
  212. *
  213. * Availability:
  214. * Non-Carbon CFM: not available
  215. * CarbonLib: not available
  216. * Mac OS X: not available
  217. }
  218. function CMMCheckBitmap(cmm: CMMComponentInst; const (*var*) bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UnivPtr; var resultBitmap: CMBitmap): CMError; external name '_CMMCheckBitmap';
  219. {
  220. * CMMMatchPixMap()
  221. *
  222. * Availability:
  223. * Non-Carbon CFM: not available
  224. * CarbonLib: not available
  225. * Mac OS X: not available
  226. }
  227. function CMMMatchPixMap(cmm: CMMComponentInst; var pixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UnivPtr): CMError; external name '_CMMMatchPixMap';
  228. {
  229. * CMMCheckPixMap()
  230. *
  231. * Availability:
  232. * Non-Carbon CFM: not available
  233. * CarbonLib: not available
  234. * Mac OS X: not available
  235. }
  236. function CMMCheckPixMap(cmm: CMMComponentInst; const (*var*) pixMap: PixMap; progressProc: CMBitmapCallBackUPP; var bitMap: BitMap; refCon: UnivPtr): CMError; external name '_CMMCheckPixMap';
  237. {
  238. * CMMConcatInit()
  239. *
  240. * Availability:
  241. * Non-Carbon CFM: not available
  242. * CarbonLib: not available
  243. * Mac OS X: not available
  244. }
  245. function CMMConcatInit(cmm: CMMComponentInst; var profileSet: CMConcatProfileSet): CMError; external name '_CMMConcatInit';
  246. {
  247. * NCMMConcatInit()
  248. *
  249. * Availability:
  250. * Non-Carbon CFM: not available
  251. * CarbonLib: not available
  252. * Mac OS X: not available
  253. }
  254. function NCMMConcatInit(cmm: CMMComponentInst; var profileSet: NCMConcatProfileSet; proc: CMConcatCallBackUPP; refCon: UnivPtr): CMError; external name '_NCMMConcatInit';
  255. {
  256. * CMMNewLinkProfile()
  257. *
  258. * Availability:
  259. * Non-Carbon CFM: not available
  260. * CarbonLib: not available
  261. * Mac OS X: not available
  262. }
  263. function CMMNewLinkProfile(cmm: CMMComponentInst; var prof: CMProfileRef; const (*var*) targetLocation: CMProfileLocation; var profileSet: CMConcatProfileSet): CMError; external name '_CMMNewLinkProfile';
  264. {
  265. * NCMMNewLinkProfile()
  266. *
  267. * Availability:
  268. * Non-Carbon CFM: not available
  269. * CarbonLib: not available
  270. * Mac OS X: not available
  271. }
  272. function NCMMNewLinkProfile(cmm: CMMComponentInst; prof: CMProfileRef; var profileSet: NCMConcatProfileSet; proc: CMConcatCallBackUPP; refCon: UnivPtr): CMError; external name '_NCMMNewLinkProfile';
  273. {
  274. * CMMGetPS2ColorSpace()
  275. *
  276. * Availability:
  277. * Non-Carbon CFM: not available
  278. * CarbonLib: not available
  279. * Mac OS X: not available
  280. }
  281. function CMMGetPS2ColorSpace(cmm: CMMComponentInst; srcProf: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UnivPtr): CMError; external name '_CMMGetPS2ColorSpace';
  282. {
  283. * CMMGetPS2ColorRenderingIntent()
  284. *
  285. * Availability:
  286. * Non-Carbon CFM: not available
  287. * CarbonLib: not available
  288. * Mac OS X: not available
  289. }
  290. function CMMGetPS2ColorRenderingIntent(cmm: CMMComponentInst; srcProf: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UnivPtr): CMError; external name '_CMMGetPS2ColorRenderingIntent';
  291. {
  292. * CMMGetPS2ColorRendering()
  293. *
  294. * Availability:
  295. * Non-Carbon CFM: not available
  296. * CarbonLib: not available
  297. * Mac OS X: not available
  298. }
  299. function CMMGetPS2ColorRendering(cmm: CMMComponentInst; srcProf: CMProfileRef; dstProf: CMProfileRef; flags: UInt32; proc: CMFlattenUPP; refCon: UnivPtr): CMError; external name '_CMMGetPS2ColorRendering';
  300. {
  301. * CMMGetPS2ColorRenderingVMSize()
  302. *
  303. * Availability:
  304. * Non-Carbon CFM: not available
  305. * CarbonLib: not available
  306. * Mac OS X: not available
  307. }
  308. function CMMGetPS2ColorRenderingVMSize(cmm: CMMComponentInst; srcProf: CMProfileRef; dstProf: CMProfileRef; var vmSize: UInt32): CMError; external name '_CMMGetPS2ColorRenderingVMSize';
  309. {
  310. * CMMConcatenateProfiles()
  311. *
  312. * Availability:
  313. * Non-Carbon CFM: not available
  314. * CarbonLib: not available
  315. * Mac OS X: not available
  316. }
  317. function CMMConcatenateProfiles(cmm: CMMComponentInst; thru: CMProfileHandle; dst: CMProfileHandle; var newDst: CMProfileHandle): CMError; external name '_CMMConcatenateProfiles';
  318. {
  319. * CMMGetNamedColorInfo()
  320. *
  321. * Availability:
  322. * Non-Carbon CFM: not available
  323. * CarbonLib: not available
  324. * Mac OS X: not available
  325. }
  326. function CMMGetNamedColorInfo(cmm: CMMComponentInst; srcProf: CMProfileRef; var deviceChannels: UInt32; var deviceColorSpace: OSType; var PCSColorSpace: OSType; var count: UInt32; prefix: StringPtr; suffix: StringPtr): CMError; external name '_CMMGetNamedColorInfo';
  327. {
  328. * CMMGetNamedColorValue()
  329. *
  330. * Availability:
  331. * Non-Carbon CFM: not available
  332. * CarbonLib: not available
  333. * Mac OS X: not available
  334. }
  335. function CMMGetNamedColorValue(cmm: CMMComponentInst; prof: CMProfileRef; name: StringPtr; var deviceColor: CMColor; var PCSColor: CMColor): CMError; external name '_CMMGetNamedColorValue';
  336. {
  337. * CMMGetIndNamedColorValue()
  338. *
  339. * Availability:
  340. * Non-Carbon CFM: not available
  341. * CarbonLib: not available
  342. * Mac OS X: not available
  343. }
  344. function CMMGetIndNamedColorValue(cmm: CMMComponentInst; prof: CMProfileRef; index: UInt32; var deviceColor: CMColor; var PCSColor: CMColor): CMError; external name '_CMMGetIndNamedColorValue';
  345. {
  346. * CMMGetNamedColorIndex()
  347. *
  348. * Availability:
  349. * Non-Carbon CFM: not available
  350. * CarbonLib: not available
  351. * Mac OS X: not available
  352. }
  353. function CMMGetNamedColorIndex(cmm: CMMComponentInst; prof: CMProfileRef; name: StringPtr; var index: UInt32): CMError; external name '_CMMGetNamedColorIndex';
  354. {
  355. * CMMGetNamedColorName()
  356. *
  357. * Availability:
  358. * Non-Carbon CFM: not available
  359. * CarbonLib: not available
  360. * Mac OS X: not available
  361. }
  362. function CMMGetNamedColorName(cmm: CMMComponentInst; prof: CMProfileRef; index: UInt32; name: StringPtr): CMError; external name '_CMMGetNamedColorName';
  363. {$endc} {CALL_NOT_IN_CARBON}
  364. {$endc} {TARGET_API_MAC_OS8}
  365. {$ALIGN MAC68K}
  366. end.