ColorSyncProfile.pas 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. {
  2. * ColorSync - ColorSyncProfile.h
  3. * Copyright (c) 2008 Apple Inc.
  4. * All rights reserved.
  5. }
  6. { Pascal Translation: Jonas Maebe, <[email protected]>, October 2009 }
  7. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2012 }
  8. {
  9. Modified for use with Free Pascal
  10. Version 308
  11. Please report any bugs to <[email protected]>
  12. }
  13. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  14. {$mode macpas}
  15. {$modeswitch cblocks}
  16. {$packenum 1}
  17. {$macro on}
  18. {$inline on}
  19. {$calling mwpascal}
  20. unit ColorSyncProfile;
  21. interface
  22. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  23. {$setc GAP_INTERFACES_VERSION := $0308}
  24. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  25. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  26. {$endc}
  27. {$ifc defined CPUPOWERPC and defined CPUI386}
  28. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  29. {$endc}
  30. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  31. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  32. {$endc}
  33. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  34. {$setc __ppc__ := 1}
  35. {$elsec}
  36. {$setc __ppc__ := 0}
  37. {$endc}
  38. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  39. {$setc __ppc64__ := 1}
  40. {$elsec}
  41. {$setc __ppc64__ := 0}
  42. {$endc}
  43. {$ifc not defined __i386__ and defined CPUI386}
  44. {$setc __i386__ := 1}
  45. {$elsec}
  46. {$setc __i386__ := 0}
  47. {$endc}
  48. {$ifc not defined __x86_64__ and defined CPUX86_64}
  49. {$setc __x86_64__ := 1}
  50. {$elsec}
  51. {$setc __x86_64__ := 0}
  52. {$endc}
  53. {$ifc not defined __arm__ and defined CPUARM}
  54. {$setc __arm__ := 1}
  55. {$elsec}
  56. {$setc __arm__ := 0}
  57. {$endc}
  58. {$ifc not defined __arm64__ and defined CPUAARCH64}
  59. {$setc __arm64__ := 1}
  60. {$elsec}
  61. {$setc __arm64__ := 0}
  62. {$endc}
  63. {$ifc defined cpu64}
  64. {$setc __LP64__ := 1}
  65. {$elsec}
  66. {$setc __LP64__ := 0}
  67. {$endc}
  68. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  69. {$error Conflicting definitions for __ppc__ and __i386__}
  70. {$endc}
  71. {$ifc defined __ppc__ and __ppc__}
  72. {$setc TARGET_CPU_PPC := TRUE}
  73. {$setc TARGET_CPU_PPC64 := FALSE}
  74. {$setc TARGET_CPU_X86 := FALSE}
  75. {$setc TARGET_CPU_X86_64 := FALSE}
  76. {$setc TARGET_CPU_ARM := FALSE}
  77. {$setc TARGET_CPU_ARM64 := FALSE}
  78. {$setc TARGET_OS_MAC := TRUE}
  79. {$setc TARGET_OS_IPHONE := FALSE}
  80. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  81. {$setc TARGET_OS_EMBEDDED := FALSE}
  82. {$elifc defined __ppc64__ and __ppc64__}
  83. {$setc TARGET_CPU_PPC := FALSE}
  84. {$setc TARGET_CPU_PPC64 := TRUE}
  85. {$setc TARGET_CPU_X86 := FALSE}
  86. {$setc TARGET_CPU_X86_64 := FALSE}
  87. {$setc TARGET_CPU_ARM := FALSE}
  88. {$setc TARGET_CPU_ARM64 := FALSE}
  89. {$setc TARGET_OS_MAC := TRUE}
  90. {$setc TARGET_OS_IPHONE := FALSE}
  91. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  92. {$setc TARGET_OS_EMBEDDED := FALSE}
  93. {$elifc defined __i386__ and __i386__}
  94. {$setc TARGET_CPU_PPC := FALSE}
  95. {$setc TARGET_CPU_PPC64 := FALSE}
  96. {$setc TARGET_CPU_X86 := TRUE}
  97. {$setc TARGET_CPU_X86_64 := FALSE}
  98. {$setc TARGET_CPU_ARM := FALSE}
  99. {$setc TARGET_CPU_ARM64 := FALSE}
  100. {$ifc defined iphonesim}
  101. {$setc TARGET_OS_MAC := FALSE}
  102. {$setc TARGET_OS_IPHONE := TRUE}
  103. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  104. {$elsec}
  105. {$setc TARGET_OS_MAC := TRUE}
  106. {$setc TARGET_OS_IPHONE := FALSE}
  107. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  108. {$endc}
  109. {$setc TARGET_OS_EMBEDDED := FALSE}
  110. {$elifc defined __x86_64__ and __x86_64__}
  111. {$setc TARGET_CPU_PPC := FALSE}
  112. {$setc TARGET_CPU_PPC64 := FALSE}
  113. {$setc TARGET_CPU_X86 := FALSE}
  114. {$setc TARGET_CPU_X86_64 := TRUE}
  115. {$setc TARGET_CPU_ARM := FALSE}
  116. {$setc TARGET_CPU_ARM64 := FALSE}
  117. {$ifc defined iphonesim}
  118. {$setc TARGET_OS_MAC := FALSE}
  119. {$setc TARGET_OS_IPHONE := TRUE}
  120. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  121. {$elsec}
  122. {$setc TARGET_OS_MAC := TRUE}
  123. {$setc TARGET_OS_IPHONE := FALSE}
  124. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  125. {$endc}
  126. {$setc TARGET_OS_EMBEDDED := FALSE}
  127. {$elifc defined __arm__ and __arm__}
  128. {$setc TARGET_CPU_PPC := FALSE}
  129. {$setc TARGET_CPU_PPC64 := FALSE}
  130. {$setc TARGET_CPU_X86 := FALSE}
  131. {$setc TARGET_CPU_X86_64 := FALSE}
  132. {$setc TARGET_CPU_ARM := TRUE}
  133. {$setc TARGET_CPU_ARM64 := FALSE}
  134. {$setc TARGET_OS_MAC := FALSE}
  135. {$setc TARGET_OS_IPHONE := TRUE}
  136. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  137. {$setc TARGET_OS_EMBEDDED := TRUE}
  138. {$elifc defined __arm64__ and __arm64__}
  139. {$setc TARGET_CPU_PPC := FALSE}
  140. {$setc TARGET_CPU_PPC64 := FALSE}
  141. {$setc TARGET_CPU_X86 := FALSE}
  142. {$setc TARGET_CPU_X86_64 := FALSE}
  143. {$setc TARGET_CPU_ARM := FALSE}
  144. {$setc TARGET_CPU_ARM64 := TRUE}
  145. {$ifc defined ios}
  146. {$setc TARGET_OS_MAC := FALSE}
  147. {$setc TARGET_OS_IPHONE := TRUE}
  148. {$setc TARGET_OS_EMBEDDED := TRUE}
  149. {$elsec}
  150. {$setc TARGET_OS_MAC := TRUE}
  151. {$setc TARGET_OS_IPHONE := FALSE}
  152. {$setc TARGET_OS_EMBEDDED := FALSE}
  153. {$endc}
  154. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  155. {$elsec}
  156. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  157. {$endc}
  158. {$ifc defined __LP64__ and __LP64__ }
  159. {$setc TARGET_CPU_64 := TRUE}
  160. {$elsec}
  161. {$setc TARGET_CPU_64 := FALSE}
  162. {$endc}
  163. {$ifc defined FPC_BIG_ENDIAN}
  164. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  165. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  166. {$elifc defined FPC_LITTLE_ENDIAN}
  167. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  168. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  169. {$elsec}
  170. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  171. {$endc}
  172. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  173. {$setc CALL_NOT_IN_CARBON := FALSE}
  174. {$setc OLDROUTINENAMES := FALSE}
  175. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  176. {$setc OPAQUE_UPP_TYPES := TRUE}
  177. {$setc OTCARBONAPPLICATION := TRUE}
  178. {$setc OTKERNEL := FALSE}
  179. {$setc PM_USE_SESSION_APIS := TRUE}
  180. {$setc TARGET_API_MAC_CARBON := TRUE}
  181. {$setc TARGET_API_MAC_OS8 := FALSE}
  182. {$setc TARGET_API_MAC_OSX := TRUE}
  183. {$setc TARGET_CARBON := TRUE}
  184. {$setc TARGET_CPU_68K := FALSE}
  185. {$setc TARGET_CPU_MIPS := FALSE}
  186. {$setc TARGET_CPU_SPARC := FALSE}
  187. {$setc TARGET_OS_UNIX := FALSE}
  188. {$setc TARGET_OS_WIN32 := FALSE}
  189. {$setc TARGET_RT_MAC_68881 := FALSE}
  190. {$setc TARGET_RT_MAC_CFM := FALSE}
  191. {$setc TARGET_RT_MAC_MACHO := TRUE}
  192. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  193. {$setc TYPE_BOOL := FALSE}
  194. {$setc TYPE_EXTENDED := FALSE}
  195. {$setc TYPE_LONGLONG := TRUE}
  196. uses MacTypes,CFBase,CFArray,CFData,CFDictionary,CFError,CFUUID;
  197. {$endc} {not MACOSALLINCLUDE}
  198. {$ifc TARGET_OS_MAC}
  199. {$ALIGN POWER}
  200. type
  201. ColorSyncProfileRef = ^OpaqueColorSyncProfileRef; { an opaque type }
  202. OpaqueColorSyncProfileRef = record end;
  203. type
  204. ColorSyncProfile_ = record end;
  205. ColorSyncMutableProfileRef = ^ColorSyncProfile_;
  206. var kColorSyncGenericGrayProfile: CFStringRef; external name '_kColorSyncGenericGrayProfile'; (* attribute const *) { com.apple.ColorSync.GenericGray }
  207. var kColorSyncGenericGrayGamma22Profile: CFStringRef; external name '_kColorSyncGenericGrayGamma22Profile'; (* attribute const *) { com.apple.ColorSync.GenericGrayGamma2.2 }
  208. var kColorSyncGenericRGBProfile: CFStringRef; external name '_kColorSyncGenericRGBProfile'; (* attribute const *) { com.apple.ColorSync.GenericRGB }
  209. var kColorSyncGenericCMYKProfile: CFStringRef; external name '_kColorSyncGenericCMYKProfile'; (* attribute const *) { com.apple.ColorSync.GenericCMYK }
  210. var kColorSyncSRGBProfile: CFStringRef; external name '_kColorSyncSRGBProfile'; (* attribute const *) { com.apple.ColorSync.sRGB }
  211. var kColorSyncAdobeRGB1998Profile: CFStringRef; external name '_kColorSyncAdobeRGB1998Profile'; (* attribute const *) { com.apple.ColorSync.AdobeRGB1998 }
  212. var kColorSyncGenericLabProfile: CFStringRef; external name '_kColorSyncGenericLabProfile'; (* attribute const *) { com.apple.ColorSync.GenericLab }
  213. var kColorSyncGenericXYZProfile: CFStringRef; external name '_kColorSyncGenericXYZProfile'; (* attribute const *) { com.apple.ColorSync.GenericXYZ }
  214. var kColorSyncProfileHeader: CFStringRef; external name '_kColorSyncProfileHeader'; (* attribute const *) { com.apple.ColorSync.ProfileHeader }
  215. var kColorSyncProfileClass: CFStringRef; external name '_kColorSyncProfileClass'; (* attribute const *) { com.apple.ColorSync.ProfileClass }
  216. var kColorSyncProfileColorSpace: CFStringRef; external name '_kColorSyncProfileColorSpace'; (* attribute const *) { com.apple.ColorSync.ProfileColorSpace }
  217. var kColorSyncProfilePCS: CFStringRef; external name '_kColorSyncProfilePCS'; (* attribute const *) { com.apple.ColorSync.PCS }
  218. var kColorSyncProfileURL: CFStringRef; external name '_kColorSyncProfileURL'; (* attribute const *) { com.apple.ColorSync.ProfileURL }
  219. var kColorSyncProfileDescription: CFStringRef; external name '_kColorSyncProfileDescription'; (* attribute const *) { com.apple.ColorSync.ProfileDescription }
  220. var kColorSyncProfileMD5Digest: CFStringRef; external name '_kColorSyncProfileMD5Digest'; (* attribute const *) { com.apple.ColorSync.ProfileMD5Digest }
  221. function ColorSyncProfileGetTypeID: CFTypeID; external name '_ColorSyncProfileGetTypeID';
  222. {
  223. * returns the CFTypeID for ColorSyncProfiles.
  224. }
  225. function ColorSyncProfileCreate( data: CFDataRef; var error: CFErrorRef ): ColorSyncProfileRef; external name '_ColorSyncProfileCreate';
  226. {
  227. * data - profile data
  228. * error - (optional) pointer to the error that will be returned in case of failure
  229. *
  230. * returns ColorSyncProfileRef or NULL in case of failure
  231. }
  232. function ColorSyncProfileCreateWithURL( url: CFURLRef; var error: CFErrorRef ): ColorSyncProfileRef; external name '_ColorSyncProfileCreateWithURL';
  233. {
  234. * url - URL to the profile data (caller needs to have privileges to read url).
  235. * error - (optional) pointer to the error that will be returned in case of failure
  236. *
  237. * returns ColorSyncProfileRef or NULL in case of failure
  238. }
  239. function ColorSyncProfileCreateWithName( name: CFStringRef ): ColorSyncProfileRef; external name '_ColorSyncProfileCreateWithName';
  240. {
  241. * name - predefined profile name
  242. *
  243. * returns ColorSyncProfileRef or NULL in case of failure
  244. }
  245. function ColorSyncProfileCreateWithDisplayID( displayID: UInt32 ): ColorSyncProfileRef; external name '_ColorSyncProfileCreateWithDisplayID';
  246. {
  247. * displayID - system-wide unique display ID (defined by IOKIt); pass 0 for main display.
  248. *
  249. * returns ColorSyncProfileRef or NULL in case of failure
  250. }
  251. function ColorSyncProfileCreateDeviceProfile( deviceClass: CFStringRef; deviceID: CFUUIDRef; profileID: CFTypeRef ): ColorSyncProfileRef; external name '_ColorSyncProfileCreateDeviceProfile';
  252. {
  253. * deviceClass - ColorSync device class
  254. * deviceID - deviceID registered with ColorSync
  255. * profileID - profileID registered with ColorSync; pass kColorSyncDeviceDefaultProfileID to get the default profile.
  256. *
  257. * See ColorSyncDevice.h for more info on deviceClass, deviceID and profileID
  258. *
  259. * returns ColorSyncProfileRef or NULL in case of failure
  260. }
  261. function ColorSyncProfileCreateMutable: ColorSyncMutableProfileRef; external name '_ColorSyncProfileCreateMutable';
  262. {
  263. * returns empty ColorSyncMutableProfileRef or NULL in case of failure
  264. }
  265. function ColorSyncProfileCreateMutableCopy( prof: ColorSyncProfileRef ): ColorSyncMutableProfileRef; external name '_ColorSyncProfileCreateMutableCopy';
  266. {
  267. * prof - profile from which profile data will be copied to the created profile.
  268. *
  269. * returns ColorSyncMutableProfileRef or NULL in case of failure
  270. }
  271. function ColorSyncProfileCreateLink( profileInfo: CFArrayRef; options: CFDictionaryRef ): ColorSyncProfileRef; external name '_ColorSyncProfileCreateLink';
  272. {
  273. * profileInfo - array of dictionaries, each one containing a profile object and the
  274. * information on the usage of the profile in the transform.
  275. *
  276. * Required keys:
  277. * ==============
  278. * kColorSyncProfile : ColorSyncProfileRef
  279. * kColorSyncRenderingIntent : CFStringRef defining rendering intent
  280. * kColorSyncTransformTag : CFStringRef defining which tags to use
  281. * Optional key:
  282. * =============
  283. * kColorSyncBlackPointCompensation : CFBooleanRef to enable/disable BPC
  284. *
  285. * options - dictionary with additional public global options (e.g. preferred CMM, quality,
  286. * etc... It can also contain custom options that are CMM specific.
  287. *
  288. * returns ColorSyncProfileRef or NULL in case of failure
  289. }
  290. function ColorSyncProfileVerify( prof: ColorSyncProfileRef; var errors: CFErrorRef; var warnings: CFErrorRef ): CBool; external name '_ColorSyncProfileVerify';
  291. {
  292. * prof - profile to be verified
  293. *
  294. * errors - returns error strings in case problems are found which
  295. * would prevent use of the profile.
  296. *
  297. * warnings - returns warning strings indicating problems due to lack of
  298. * conformance with the ICC specification, but not preventing
  299. * use of the profile.
  300. *
  301. * returns true if profile can be used or false otherwise
  302. }
  303. function ColorSyncProfileEstimateGammaWithDisplayID( {const} displayID: SInt32; var error: CFErrorRef ): Float32; external name '_ColorSyncProfileEstimateGammaWithDisplayID';
  304. {
  305. * displayID - system-wide unique display ID (defined by IOKIt)
  306. * error - (optional) pointer to the error that will be returned in
  307. * case of failure
  308. *
  309. * returns non-zero value if success or 0.0 in case of error.
  310. }
  311. function ColorSyncProfileEstimateGamma( prof: ColorSyncProfileRef; var error: CFErrorRef ): Float32; external name '_ColorSyncProfileEstimateGamma';
  312. {
  313. * prof - profile to perform estimation on
  314. * error - (optional) pointer to the error that will be returned in
  315. * case of failure
  316. *
  317. * returns non-zero value if success or 0.0 in case of error
  318. }
  319. const
  320. COLORSYNC_MD5_LENGTH = 16;
  321. type
  322. ColorSyncMD5 = record
  323. digest: array [0..COLORSYNC_MD5_LENGTH-1] of UInt8;
  324. end;
  325. function ColorSyncProfileGetMD5( prof: ColorSyncProfileRef ): ColorSyncMD5; external name '_ColorSyncProfileGetMD5';
  326. {
  327. * returns MD5 digest for the profile calculated as defined by
  328. * ICC specification or a "zero" signature (filled with zeros)
  329. * in case of failure
  330. }
  331. function ColorSyncProfileCopyData( prof: ColorSyncProfileRef; var error: CFErrorRef ): CFDataRef; external name '_ColorSyncProfileCopyData';
  332. {
  333. * prof - profile to copy the flattened data from
  334. * error - (optional) pointer to the error that will be returned in case of failure
  335. *
  336. * returns CFDataRef if success or NULL in case of failure
  337. }
  338. function ColorSyncProfileGetURL( prof: ColorSyncProfileRef; var error: CFErrorRef ): CFURLRef; external name '_ColorSyncProfileGetURL';
  339. {
  340. * prof - profile to get URL from
  341. * error - (optional) pointer to the error that will be returned in case of failure
  342. *
  343. * returns CFURLRef if success or NULL in case of failure
  344. }
  345. function ColorSyncProfileCopyHeader( prof: ColorSyncProfileRef ): CFDataRef; external name '_ColorSyncProfileCopyHeader';
  346. {
  347. * prof - profile from which to copy the header
  348. *
  349. * returns CFDataRef containing profile header (in host endianess) or NULL in case of failure
  350. }
  351. procedure ColorSyncProfileSetHeader( prof: ColorSyncMutableProfileRef; header: CFDataRef ); external name '_ColorSyncProfileSetHeader';
  352. {
  353. * prof - profile in which to set the header
  354. * header - CFDataRef containing the header data (must be in host endianess)
  355. }
  356. function ColorSyncProfileCopyDescriptionString( prof: ColorSyncProfileRef ): CFStringRef; external name '_ColorSyncProfileCopyDescriptionString';
  357. {
  358. * prof - profile from which to copy description string
  359. *
  360. * returns CFStringRef containing profile description localized to current locale
  361. }
  362. function ColorSyncProfileCopyTagSignatures( prof: ColorSyncProfileRef ): CFArrayRef; external name '_ColorSyncProfileCopyTagSignatures';
  363. {
  364. * prof - profile from which to copy tag signatures
  365. *
  366. * returns CFArray with signatures (CFStringRef) of tags in the profile
  367. }
  368. function ColorSyncProfileContainsTag( prof: ColorSyncProfileRef; signature: CFStringRef ): CBool; external name '_ColorSyncProfileContainsTag';
  369. {
  370. * prof - profile in which to search for the tag
  371. * signature - signature of the tag to be searched for
  372. *
  373. * returns true if tag exists or false if does not
  374. }
  375. function ColorSyncProfileCopyTag( prof: ColorSyncProfileRef; signature: CFStringRef ): CFDataRef; external name '_ColorSyncProfileCopyTag';
  376. {
  377. * prof - profile from which to copy the tag
  378. * signature - signature of the tag to be copied
  379. *
  380. * returns CFDataRef containing tag data or NULL in case of failure
  381. }
  382. procedure ColorSyncProfileSetTag( prof: ColorSyncMutableProfileRef; signature: CFStringRef; data: CFDataRef ); external name '_ColorSyncProfileSetTag';
  383. {
  384. * prof - profile in which to set the tag
  385. * signature - signature of the tag to be set in the profile
  386. * data - CFDataRef containing the tag data
  387. }
  388. procedure ColorSyncProfileRemoveTag( prof: ColorSyncMutableProfileRef; signature: CFStringRef ); external name '_ColorSyncProfileRemoveTag';
  389. {
  390. * prof - profile from which to remove the tag
  391. * signature - signature of the tag to be removed
  392. *
  393. * returns true if success or false in case of failure
  394. }
  395. function ColorSyncProfileGetDisplayTransferFormulaFromVCGT( profile: ColorSyncProfileRef; var redMin: Float32; var redMax: Float32; var redGamma: Float32; var greenMin: Float32; var greenMax: Float32; var greenGamma: Float32; var blueMin: Float32; var blueMax: Float32; var blueGamma: Float32 ): CBool; external name '_ColorSyncProfileGetDisplayTransferFormulaFromVCGT';
  396. (* AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER *)
  397. {
  398. * An utility function converting vcgt tag (if vcgt tag exists in the profile and conversion possible)
  399. * to formula components used by CGSetDisplayTransferByFormula.
  400. }
  401. function ColorSyncProfileCreateDisplayTransferTablesFromVCGT( profile: ColorSyncProfileRef; var nSamplesPerChannel: size_t ): CFDataRef; external name '_ColorSyncProfileCreateDisplayTransferTablesFromVCGT';
  402. (* AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER *)
  403. {
  404. * An utility function creating three tables of floats (redTable, greenTable, blueTable)
  405. * each of size nSamplesPerChannel, packed into contiguous memory contained in the CFDataRef
  406. * to be returned from the vcgt tag of the profile (if vcgt tag exists in the profile).
  407. * Used by CGSetDisplayTransferByTable.
  408. }
  409. type
  410. ColorSyncProfileIterateCallback = function( profileInfo: CFDictionaryRef; userInfo: UnivPtr ): CBool;
  411. {
  412. * Notes:
  413. * 1. Only validated profiles will be passed to the caller
  414. * 2. if the ColorSyncProfileIterateCallback returns false, the iteration stops
  415. }
  416. procedure ColorSyncIterateInstalledProfiles( callBack: ColorSyncProfileIterateCallback; seed: UInt32Ptr; userInfo: UnivPtr; var error: CFErrorRef ); external name '_ColorSyncIterateInstalledProfiles';
  417. {
  418. * callBack - pointer to a client provided function (can be NULL)
  419. * seed - pointer to a cache seed owned by the client (can be NULL)
  420. * error - (optional) pointer to the error that will be returned in case of failure
  421. *
  422. }
  423. {$endc} {TARGET_OS_MAC}
  424. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  425. end.
  426. {$endc} {not MACOSALLINCLUDE}