CGColorSpace.pas 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486
  1. { CoreGraphics - CGColorSpace.h
  2. Copyright (c) 1999-2009 Apple Inc.
  3. All rights reserved. }
  4. { Pascal Translation Updated: Peter N Lewis, <[email protected]>, August 2005 }
  5. { Pascal Translation Updated: Gale R Paeper, <[email protected]>, 2006 }
  6. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, October 2009 }
  7. { Pascal Translation Updated: Jonas Maebe, <[email protected]>, August 2015 }
  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. {$packenum 1}
  16. {$macro on}
  17. {$inline on}
  18. {$calling mwpascal}
  19. unit CGColorSpace;
  20. interface
  21. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  22. {$setc GAP_INTERFACES_VERSION := $0308}
  23. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  24. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  25. {$endc}
  26. {$ifc defined CPUPOWERPC and defined CPUI386}
  27. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  28. {$endc}
  29. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  30. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  31. {$endc}
  32. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  33. {$setc __ppc__ := 1}
  34. {$elsec}
  35. {$setc __ppc__ := 0}
  36. {$endc}
  37. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  38. {$setc __ppc64__ := 1}
  39. {$elsec}
  40. {$setc __ppc64__ := 0}
  41. {$endc}
  42. {$ifc not defined __i386__ and defined CPUI386}
  43. {$setc __i386__ := 1}
  44. {$elsec}
  45. {$setc __i386__ := 0}
  46. {$endc}
  47. {$ifc not defined __x86_64__ and defined CPUX86_64}
  48. {$setc __x86_64__ := 1}
  49. {$elsec}
  50. {$setc __x86_64__ := 0}
  51. {$endc}
  52. {$ifc not defined __arm__ and defined CPUARM}
  53. {$setc __arm__ := 1}
  54. {$elsec}
  55. {$setc __arm__ := 0}
  56. {$endc}
  57. {$ifc not defined __arm64__ and defined CPUAARCH64}
  58. {$setc __arm64__ := 1}
  59. {$elsec}
  60. {$setc __arm64__ := 0}
  61. {$endc}
  62. {$ifc defined cpu64}
  63. {$setc __LP64__ := 1}
  64. {$elsec}
  65. {$setc __LP64__ := 0}
  66. {$endc}
  67. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  68. {$error Conflicting definitions for __ppc__ and __i386__}
  69. {$endc}
  70. {$ifc defined __ppc__ and __ppc__}
  71. {$setc TARGET_CPU_PPC := TRUE}
  72. {$setc TARGET_CPU_PPC64 := FALSE}
  73. {$setc TARGET_CPU_X86 := FALSE}
  74. {$setc TARGET_CPU_X86_64 := FALSE}
  75. {$setc TARGET_CPU_ARM := FALSE}
  76. {$setc TARGET_CPU_ARM64 := FALSE}
  77. {$setc TARGET_OS_MAC := TRUE}
  78. {$setc TARGET_OS_IPHONE := FALSE}
  79. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  80. {$setc TARGET_OS_EMBEDDED := FALSE}
  81. {$elifc defined __ppc64__ and __ppc64__}
  82. {$setc TARGET_CPU_PPC := FALSE}
  83. {$setc TARGET_CPU_PPC64 := TRUE}
  84. {$setc TARGET_CPU_X86 := FALSE}
  85. {$setc TARGET_CPU_X86_64 := FALSE}
  86. {$setc TARGET_CPU_ARM := FALSE}
  87. {$setc TARGET_CPU_ARM64 := FALSE}
  88. {$setc TARGET_OS_MAC := TRUE}
  89. {$setc TARGET_OS_IPHONE := FALSE}
  90. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  91. {$setc TARGET_OS_EMBEDDED := FALSE}
  92. {$elifc defined __i386__ and __i386__}
  93. {$setc TARGET_CPU_PPC := FALSE}
  94. {$setc TARGET_CPU_PPC64 := FALSE}
  95. {$setc TARGET_CPU_X86 := TRUE}
  96. {$setc TARGET_CPU_X86_64 := FALSE}
  97. {$setc TARGET_CPU_ARM := FALSE}
  98. {$setc TARGET_CPU_ARM64 := FALSE}
  99. {$ifc defined(iphonesim)}
  100. {$setc TARGET_OS_MAC := FALSE}
  101. {$setc TARGET_OS_IPHONE := TRUE}
  102. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  103. {$elsec}
  104. {$setc TARGET_OS_MAC := TRUE}
  105. {$setc TARGET_OS_IPHONE := FALSE}
  106. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  107. {$endc}
  108. {$setc TARGET_OS_EMBEDDED := FALSE}
  109. {$elifc defined __x86_64__ and __x86_64__}
  110. {$setc TARGET_CPU_PPC := FALSE}
  111. {$setc TARGET_CPU_PPC64 := FALSE}
  112. {$setc TARGET_CPU_X86 := FALSE}
  113. {$setc TARGET_CPU_X86_64 := TRUE}
  114. {$setc TARGET_CPU_ARM := FALSE}
  115. {$setc TARGET_CPU_ARM64 := FALSE}
  116. {$ifc defined(iphonesim)}
  117. {$setc TARGET_OS_MAC := FALSE}
  118. {$setc TARGET_OS_IPHONE := TRUE}
  119. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  120. {$elsec}
  121. {$setc TARGET_OS_MAC := TRUE}
  122. {$setc TARGET_OS_IPHONE := FALSE}
  123. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  124. {$endc}
  125. {$setc TARGET_OS_EMBEDDED := FALSE}
  126. {$elifc defined __arm__ and __arm__}
  127. {$setc TARGET_CPU_PPC := FALSE}
  128. {$setc TARGET_CPU_PPC64 := FALSE}
  129. {$setc TARGET_CPU_X86 := FALSE}
  130. {$setc TARGET_CPU_X86_64 := FALSE}
  131. {$setc TARGET_CPU_ARM := TRUE}
  132. {$setc TARGET_CPU_ARM64 := FALSE}
  133. { will require compiler define when/if other Apple devices with ARM cpus ship }
  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. { will require compiler define when/if other Apple devices with ARM cpus ship }
  146. {$setc TARGET_OS_MAC := FALSE}
  147. {$setc TARGET_OS_IPHONE := TRUE}
  148. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  149. {$setc TARGET_OS_EMBEDDED := TRUE}
  150. {$elsec}
  151. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  152. {$endc}
  153. {$ifc defined __LP64__ and __LP64__ }
  154. {$setc TARGET_CPU_64 := TRUE}
  155. {$elsec}
  156. {$setc TARGET_CPU_64 := FALSE}
  157. {$endc}
  158. {$ifc defined FPC_BIG_ENDIAN}
  159. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  160. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  161. {$elifc defined FPC_LITTLE_ENDIAN}
  162. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  163. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  164. {$elsec}
  165. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  166. {$endc}
  167. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  168. {$setc CALL_NOT_IN_CARBON := FALSE}
  169. {$setc OLDROUTINENAMES := FALSE}
  170. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  171. {$setc OPAQUE_UPP_TYPES := TRUE}
  172. {$setc OTCARBONAPPLICATION := TRUE}
  173. {$setc OTKERNEL := FALSE}
  174. {$setc PM_USE_SESSION_APIS := TRUE}
  175. {$setc TARGET_API_MAC_CARBON := TRUE}
  176. {$setc TARGET_API_MAC_OS8 := FALSE}
  177. {$setc TARGET_API_MAC_OSX := TRUE}
  178. {$setc TARGET_CARBON := TRUE}
  179. {$setc TARGET_CPU_68K := FALSE}
  180. {$setc TARGET_CPU_MIPS := FALSE}
  181. {$setc TARGET_CPU_SPARC := FALSE}
  182. {$setc TARGET_OS_UNIX := FALSE}
  183. {$setc TARGET_OS_WIN32 := FALSE}
  184. {$setc TARGET_RT_MAC_68881 := FALSE}
  185. {$setc TARGET_RT_MAC_CFM := FALSE}
  186. {$setc TARGET_RT_MAC_MACHO := TRUE}
  187. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  188. {$setc TYPE_BOOL := FALSE}
  189. {$setc TYPE_EXTENDED := FALSE}
  190. {$setc TYPE_LONGLONG := TRUE}
  191. uses MacTypes,CFBase,CFData,CFString,CGBase,CGDataProvider;
  192. {$endc} {not MACOSALLINCLUDE}
  193. {$ALIGN POWER}
  194. type
  195. CGColorSpaceRef = ^OpaqueCGColorSpaceRef; { an opaque type }
  196. OpaqueCGColorSpaceRef = record end;
  197. type
  198. TristimulusValue = array[0..2] of CGFloat;
  199. RedGreenBlueValue = array[0..2] of CGFloat;
  200. Single4 = array[0..3] of CGFloat;
  201. Single9 = array[0..8] of CGFloat;
  202. { Color rendering intents. }
  203. type
  204. CGColorRenderingIntent = SInt32;
  205. const
  206. kCGRenderingIntentDefault = 0;
  207. kCGRenderingIntentAbsoluteColorimetric = 1;
  208. kCGRenderingIntentRelativeColorimetric = 2;
  209. kCGRenderingIntentPerceptual = 3;
  210. kCGRenderingIntentSaturation = 4;
  211. { The model of a color space. }
  212. type
  213. CGColorSpaceModel = SInt32;
  214. const
  215. kCGColorSpaceModelUnknown = -1;
  216. kCGColorSpaceModelMonochrome = -1 + 1;
  217. kCGColorSpaceModelRGB = -1 + 2;
  218. kCGColorSpaceModelCMYK = -1 + 3;
  219. kCGColorSpaceModelLab = -1 + 4;
  220. kCGColorSpaceModelDeviceN = -1 + 5;
  221. kCGColorSpaceModelIndexed = -1 + 6;
  222. kCGColorSpaceModelPattern = -1 + 7;
  223. {$ifc TARGET_OS_MAC}
  224. { The name of the "Generic" gray color space. }
  225. var kCGColorSpaceGenericGray: CFStringRef; external name '_kCGColorSpaceGenericGray'; (* attribute const *)
  226. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
  227. { The name of the "Generic" RGB color space. }
  228. var kCGColorSpaceGenericRGB: CFStringRef; external name '_kCGColorSpaceGenericRGB'; (* attribute const *)
  229. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
  230. { The name of the "Generic" CMYK color space. }
  231. var kCGColorSpaceGenericCMYK: CFStringRef; external name '_kCGColorSpaceGenericCMYK'; (* attribute const *)
  232. (* CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_NA) *)
  233. { The name of the "Generic" linear RGB color space. This is the same as
  234. `kCGColorSpaceGenericRGB' but with a 1.0 gamma. }
  235. var kCGColorSpaceGenericRGBLinear: CFStringRef; external name '_kCGColorSpaceGenericRGBLinear'; (* attribute const *)
  236. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  237. { The name of the Adobe RGB (1998) color space. For more information, see
  238. "Adobe RGB (1998) Color Image Encoding", Version 2005-05, Adobe Systems
  239. Inc. (http://www.adobe.com). }
  240. var kCGColorSpaceAdobeRGB1998: CFStringRef; external name '_kCGColorSpaceAdobeRGB1998'; (* attribute const *)
  241. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  242. { The name of the sRGB color space. The capitalization in the name, while
  243. strictly inaccurate, avoids interpretational ambiguity. For more
  244. information, see IEC 61966-2-1 (1999-10): "Multimedia systems and
  245. equipment - Colour measurement and management - Part 2-1: Colour
  246. management - Default RGB colour space - sRGB". }
  247. var kCGColorSpaceSRGB: CFStringRef; external name '_kCGColorSpaceSRGB'; (* attribute const *)
  248. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  249. { The "Generic" gray color space with gamma = 2.2. }
  250. var kCGColorSpaceGenericGrayGamma2_2: CFStringRef; external name '_kCGColorSpaceGenericGrayGamma2_2'; (* attribute const *)
  251. (* CG_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_NA) *)
  252. {$endc}
  253. {* Device-dependent color spaces. *}
  254. { Create a DeviceGray color space. }
  255. function CGColorSpaceCreateDeviceGray: CGColorSpaceRef; external name '_CGColorSpaceCreateDeviceGray';
  256. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
  257. { Create a DeviceRGB color space. }
  258. function CGColorSpaceCreateDeviceRGB: CGColorSpaceRef; external name '_CGColorSpaceCreateDeviceRGB';
  259. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
  260. { Create a DeviceCMYK color space. }
  261. function CGColorSpaceCreateDeviceCMYK: CGColorSpaceRef; external name '_CGColorSpaceCreateDeviceCMYK';
  262. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
  263. {* Device-independent color spaces. *}
  264. { Create a calibrated gray color space. `whitePoint' is an array of 3
  265. numbers specifying the tristimulus value, in the CIE 1931 XYZ-space, of
  266. the diffuse white point. `blackPoint' is an array of 3 numbers specifying
  267. the tristimulus value, in CIE 1931 XYZ-space, of the diffuse black point.
  268. `gamma' defines the gamma for the gray component. }
  269. function CGColorSpaceCreateCalibratedGray( const (*var*) whitePoint: TristimulusValue; const (*var*) blackPoint: TristimulusValue; gamma: CGFloat ): CGColorSpaceRef; external name '_CGColorSpaceCreateCalibratedGray';
  270. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
  271. { Create a calibrated RGB color space. `whitePoint' is an array of 3
  272. numbers specifying the tristimulus value, in the CIE 1931 XYZ-space, of
  273. the diffuse white point. `blackPoint' is an array of 3 numbers specifying
  274. the tristimulus value, in CIE 1931 XYZ-space, of the diffuse black point.
  275. `gamma' is an array of 3 numbers specifying the gamma for the red, green,
  276. and blue components of the color space. `matrix' is an array of 9 numbers
  277. specifying the linear interpretation of the gamma-modified RGB values of
  278. the color space with respect to the final XYZ representation. }
  279. function CGColorSpaceCreateCalibratedRGB( const (*var*) whitePoint: TristimulusValue; const (*var*) blackPoint: TristimulusValue; const (*var*) gamma: RedGreenBlueValue; const (*var*) matrix: Single9 ): CGColorSpaceRef; external name '_CGColorSpaceCreateCalibratedRGB';
  280. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
  281. { Create an L*a*b* color space. `whitePoint' is an array of 3 numbers
  282. specifying the tristimulus value, in the CIE 1931 XYZ-space, of the
  283. diffuse white point. `blackPoint' is an array of 3 numbers specifying the
  284. tristimulus value, in CIE 1931 XYZ-space, of the diffuse black point.
  285. `range' is an array of four numbers specifying the range of valid values
  286. for the a* and b* components of the color space. }
  287. function CGColorSpaceCreateLab(const (*var*) whitePoint: TristimulusValue; const (*var*) blackPoint: TristimulusValue; const (*var*) range: Single4): CGColorSpaceRef; external name '_CGColorSpaceCreateLab';
  288. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
  289. { Create an ICC-based color space using the ICC profile specified by
  290. `data'. }
  291. function CGColorSpaceCreateWithICCProfile( data: CFDataRef ): CGColorSpaceRef; external name '_CGColorSpaceCreateWithICCProfile';
  292. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) *)
  293. { Create an ICC-based color space. `nComponents' specifies the number of
  294. color components in the color space defined by the ICC profile data. This
  295. must match the number of components actually in the ICC profile, and must
  296. be 1, 3, or 4. `range' is an array of 2*nComponents numbers specifying
  297. the minimum and maximum valid values of the corresponding color
  298. components, so that for color component k, range[2*k] <= c[k] <=
  299. range[2*k+1], where c[k] is the k'th color component. `profile' is a data
  300. provider specifying the ICC profile. `alternate' specifies an alternate
  301. color space to be used in case the ICC profile is not supported. It must
  302. have `nComponents' color components. If `alternate' is NULL, then the
  303. color space used will be DeviceGray, DeviceRGB, or DeviceCMYK, depending
  304. on whether `nComponents' is 1, 3, or 4, respectively. }
  305. function CGColorSpaceCreateICCBased( nComponents: size_t; {const} range: {variable-size-array} CGFloatPtr; profile: CGDataProviderRef; alternate: CGColorSpaceRef ): CGColorSpaceRef; external name '_CGColorSpaceCreateICCBased';
  306. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
  307. {* Special colorspaces. *}
  308. { Create an indexed color space. A sample value in an indexed color space
  309. is treated as an index into the color table of the color space. `base'
  310. specifies the base color space in which the values in the color table are
  311. to be interpreted. `lastIndex' is an integer which specifies the maximum
  312. valid index value; it must be less than or equal to 255. `colorTable' is
  313. an array of m * (lastIndex + 1) bytes, where m is the number of color
  314. components in the base color space. Each byte is an unsigned integer in
  315. the range 0 to 255 that is scaled to the range of the corresponding color
  316. component in the base color space. }
  317. function CGColorSpaceCreateIndexed( baseSpace: CGColorSpaceRef; lastIndex: size_t; colorTable: UInt8Ptr ): CGColorSpaceRef; external name '_CGColorSpaceCreateIndexed';
  318. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
  319. { Create a pattern color space. `baseSpace' is the underlying color space
  320. of the pattern color space. For colored patterns, `baseSpace' should be
  321. NULL; for uncolored patterns, `baseSpace' specifies the color space of
  322. colors which will be painted through the pattern. }
  323. function CGColorSpaceCreatePattern( baseSpace: CGColorSpaceRef ): CGColorSpaceRef; external name '_CGColorSpaceCreatePattern';
  324. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
  325. {$ifc TARGET_OS_MAC}
  326. { Create a color space using `ref', a platform-specific color space
  327. reference. For MacOS X, `ref' should be a CMProfileRef. }
  328. function CGColorSpaceCreateWithPlatformColorSpace( ref: {const} UnivPtr ): CGColorSpaceRef; external name '_CGColorSpaceCreateWithPlatformColorSpace';
  329. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_NA) *)
  330. {$endc}
  331. { Create a color space using `name' as the identifier for the color
  332. space. }
  333. function CGColorSpaceCreateWithName( name: CFStringRef ): CGColorSpaceRef; external name '_CGColorSpaceCreateWithName';
  334. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_2_0) *)
  335. { Equivalent to `CFRetain(space)', except it doesn't crash (as CFRetain
  336. does) if `space' is NULL. }
  337. function CGColorSpaceRetain( space: CGColorSpaceRef ): CGColorSpaceRef; external name '_CGColorSpaceRetain';
  338. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
  339. { Equivalent to `CFRelease(space)', except it doesn't crash (as CFRelease
  340. does) if `space' is NULL. }
  341. procedure CGColorSpaceRelease( space: CGColorSpaceRef ); external name '_CGColorSpaceRelease';
  342. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
  343. {$ifc TARGET_OS_MAC}
  344. { Return the name used to create the color space `space', or NULL if the
  345. color space was not created using `CGColorSpaceCreateWithName'. }
  346. function CGColorSpaceCopyName( space: CGColorSpaceRef ): CFStringRef; external name '_CGColorSpaceCopyName';
  347. (* CG_AVAILABLE_STARTING(__MAC_10_6, __IPHONE_NA) *)
  348. {$endc}
  349. {* Colorspace information. *}
  350. { Return the CFTypeID for CGColorSpaces. }
  351. function CGColorSpaceGetTypeID: CFTypeID; external name '_CGColorSpaceGetTypeID';
  352. (* CG_AVAILABLE_STARTING(__MAC_10_2, __IPHONE_2_0) *)
  353. { Return the number of color components in the color space `space'. }
  354. function CGColorSpaceGetNumberOfComponents( space: CGColorSpaceRef ): size_t; external name '_CGColorSpaceGetNumberOfComponents';
  355. (* CG_AVAILABLE_STARTING(__MAC_10_0, __IPHONE_2_0) *)
  356. { Return the color space model of `space'. }
  357. function CGColorSpaceGetModel( space: CGColorSpaceRef ): CGColorSpaceModel; external name '_CGColorSpaceGetModel';
  358. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) *)
  359. { Return the base color space of `space' if `space' is a pattern or indexed
  360. color space; otherwise, return NULL. To determine whether a color space
  361. is an indexed or pattern color space, use `CGColorSpaceGetModel'. }
  362. function CGColorSpaceGetBaseColorSpace( space: CGColorSpaceRef ): CGColorSpaceRef; external name '_CGColorSpaceGetBaseColorSpace';
  363. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) *)
  364. { Return the number of entries in the color table of `space' if `space' is
  365. an indexed color space; otherwise, return 0. To determine whether a color
  366. space is an indexed color space, use `CGColorSpaceGetModel'. }
  367. function CGColorSpaceGetColorTableCount( space: CGColorSpaceRef ): size_t; external name '_CGColorSpaceGetColorTableCount';
  368. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) *)
  369. { Copy the entries in the color table of `space' to `table' if `space' is
  370. an indexed color space; otherwise, do nothing. The array pointed to by
  371. `table' should be at least as large as the number of entries in the color
  372. table; the returned data is in the same format as that passed to
  373. `CGColorSpaceCreateIndexed'. To determine whether a color space is an
  374. indexed color space, use `CGColorSpaceGetModel'. }
  375. procedure CGColorSpaceGetColorTable( space: CGColorSpaceRef; table: UInt8Ptr ); external name '_CGColorSpaceGetColorTable';
  376. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0) *)
  377. {$ifc TARGET_OS_MAC}
  378. { Return a copy of the ICC profile of `space', or NULL if the color space
  379. doesn't have an ICC profile. }
  380. function CGColorSpaceCopyICCProfile( space: CGColorSpaceRef ): CFDataRef; external name '_CGColorSpaceCopyICCProfile';
  381. (* CG_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_NA) *)
  382. {$endc}
  383. {* Deprecated APIs. *}
  384. { Use "kCGColorSpaceGenericGray" instead. }
  385. {$ifc USE_CFSTR_CONSTANT_MACROS}
  386. {$definec kCGColorSpaceUserGray CFSTRP('kCGColorSpaceUserGray')}
  387. {$endc}
  388. { Use "kCGColorSpaceGenericRGB" instead. }
  389. {$ifc USE_CFSTR_CONSTANT_MACROS}
  390. {$definec kCGColorSpaceUserRGB CFSTRP('kCGColorSpaceUserRGB')}
  391. {$endc}
  392. { Use "kCGColorSpaceGenericCMYK" instead. }
  393. {$ifc USE_CFSTR_CONSTANT_MACROS}
  394. {$definec kCGColorSpaceUserCMYK CFSTRP('kCGColorSpaceUserCMYK')}
  395. {$endc}
  396. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  397. end.
  398. {$endc} {not MACOSALLINCLUDE}