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