Mac OS 9
CGImage.h
Go to the documentation of this file.
1 
20 #ifndef __CGIMAGE__
21 #define __CGIMAGE__
22 
23 #ifndef __CGBASE__
24 #include <CGBase.h>
25 #endif
26 
27 #ifndef __CGCOLORSPACE__
28 #include <CGColorSpace.h>
29 #endif
30 
31 #ifndef __CGDATAPROVIDER__
32 #include <CGDataProvider.h>
33 #endif
34 
35 #if PRAGMA_ONCE
36 #pragma once
37 #endif
38 
39 #ifdef __cplusplus
40 extern "C"
41 {
42 #endif
43 
44 #if PRAGMA_IMPORT
45 #pragma import on
46 #endif
47 
48 #if PRAGMA_STRUCT_ALIGN
49 #pragma options align = mac68k
50 #elif PRAGMA_STRUCT_PACKPUSH
51 #pragma pack(push, 2)
52 #elif PRAGMA_STRUCT_PACK
53 #pragma pack(2)
54 #endif
55 
56 #if PRAGMA_ENUM_ALWAYSINT
57 #if defined(__fourbyteints__) && !__fourbyteints__
58 #define __CGIMAGE__RESTORE_TWOBYTEINTS
59 #pragma fourbyteints on
60 #endif
61 #pragma enumsalwaysint on
62 #elif PRAGMA_ENUM_OPTIONS
63 #pragma option enum =int
64 #elif PRAGMA_ENUM_PACK
65 #if __option(pack_enums)
66 #define __CGIMAGE__RESTORE_PACKED_ENUMS
67 #pragma options(!pack_enums)
68 #endif
69 #endif
70 
71  typedef struct CGImage *CGImageRef;
72  enum CGImageAlphaInfo
73  {
74  kCGImageAlphaNone = 0,
75  kCGImageAlphaPremultipliedLast = 1, /* For example, premultiplied RGBA */
76  kCGImageAlphaPremultipliedFirst = 2, /* For example, premultiplied ARGB */
77  kCGImageAlphaLast = 3, /* For example, non-premultiplied RGBA */
78  kCGImageAlphaFirst = 4, /* For example, non-premultiplied ARGB */
79  kCGImageAlphaNoneSkipLast = 5, /* Equivalent to kCGImageAlphaNone. */
80  kCGImageAlphaNoneSkipFirst = 6
81  };
82  typedef enum CGImageAlphaInfo CGImageAlphaInfo;
83 
84  /* Create an image. */
93  CGImageRef
94  CGImageCreate(size_t width, size_t height, size_t bitsPerComponent,
95  size_t bitsPerPixel, size_t bytesPerRow,
96  CGColorSpaceRef colorspace, CGImageAlphaInfo alphaInfo,
97  CGDataProviderRef provider, const float decode[],
98  int shouldInterpolate, CGColorRenderingIntent intent);
99 
100  /* Create an image mask. */
109  CGImageRef
110  CGImageMaskCreate(size_t width, size_t height, size_t bitsPerComponent,
111  size_t bitsPerPixel, size_t bytesPerRow,
112  CGDataProviderRef provider, const float decode[],
113  int shouldInterpolate);
114 
115  /* Create an image from `source', a data provider of JPEG-encoded data. */
124  CGImageRef
125  CGImageCreateWithJPEGDataProvider(CGDataProviderRef source,
126  const float decode[], int shouldInterpolate,
127  CGColorRenderingIntent intent);
128 
129  /* Increment the retain count of `image' and return it. All images are
130  * created with an initial retain count of 1. */
139  CGImageRef
140  CGImageRetain(CGImageRef image);
141 
142  /* Decrement the retain count of `image'. If the retain count reaches 0,
143  * then release it and any associated resources. */
152  void
153  CGImageRelease(CGImageRef image);
154 
155  /* Return 1 if `image' is an image mask, 0 otherwise. */
164  int CGImageIsMask(CGImageRef image);
165 
166  /* Return the width of `image'. */
175  size_t
176  CGImageGetWidth(CGImageRef image);
177 
178  /* Return the height of `image'. */
187  size_t
188  CGImageGetHeight(CGImageRef image);
189 
190  /* Return the number of bits/component of `image'. */
199  size_t
200  CGImageGetBitsPerComponent(CGImageRef image);
201 
202  /* Return the number of bits/pixel of `image'. */
211  size_t
212  CGImageGetBitsPerPixel(CGImageRef image);
213 
214  /* Return the number of bytes/row of `image'. */
223  size_t
224  CGImageGetBytesPerRow(CGImageRef image);
225 
226  /* Return the colorspace of `image', or NULL if `image' is an image
227  * mask. */
236  CGColorSpaceRef
237  CGImageGetColorSpace(CGImageRef image);
238 
239  /* Return the alpha info of `image'. */
248  CGImageAlphaInfo
249  CGImageGetAlphaInfo(CGImageRef image);
250 
251  /*Return the data provider of `image'. */
260  CGDataProviderRef
261  CGImageGetDataProvider(CGImageRef image);
262 
263  /* Return the decode array of `image'. */
272  const float *
273  CGImageGetDecode(CGImageRef image);
274 
275  /* Return the interpolation parameter of `image'. */
284  int CGImageGetShouldInterpolate(CGImageRef image);
285 
286  /* Return the rendering intent of `image'. */
295  CGColorRenderingIntent
296  CGImageGetRenderingIntent(CGImageRef image);
297 
298 #if PRAGMA_ENUM_ALWAYSINT
299 #pragma enumsalwaysint reset
300 #ifdef __CGIMAGE__RESTORE_TWOBYTEINTS
301 #pragma fourbyteints off
302 #endif
303 #elif PRAGMA_ENUM_OPTIONS
304 #pragma option enum =reset
305 #elif defined(__CGIMAGE__RESTORE_PACKED_ENUMS)
306 #pragma options(pack_enums)
307 #endif
308 
309 #if PRAGMA_STRUCT_ALIGN
310 #pragma options align = reset
311 #elif PRAGMA_STRUCT_PACKPUSH
312 #pragma pack(pop)
313 #elif PRAGMA_STRUCT_PACK
314 #pragma pack()
315 #endif
316 
317 #ifdef PRAGMA_IMPORT_OFF
318 #pragma import off
319 #elif PRAGMA_IMPORT
320 #pragma import reset
321 #endif
322 
323 #ifdef __cplusplus
324 }
325 #endif
326 
327 #endif /* __CGIMAGE__ */
xxx put contents here xxx
CoreGraphics color space.
xxx put contents here xxx
const float * CGImageGetDecode(CGImageRef image)
CGColorRenderingIntent CGImageGetRenderingIntent(CGImageRef image)
size_t CGImageGetBytesPerRow(CGImageRef image)
void CGImageRelease(CGImageRef image)
size_t CGImageGetBitsPerComponent(CGImageRef image)
size_t CGImageGetBitsPerPixel(CGImageRef image)
int CGImageGetShouldInterpolate(CGImageRef image)
size_t CGImageGetHeight(CGImageRef image)
int CGImageIsMask(CGImageRef image)
size_t CGImageGetWidth(CGImageRef image)
CGDataProviderRef CGImageGetDataProvider(CGImageRef image)
CGImageRef CGImageMaskCreate(size_t width, size_t height, size_t bitsPerComponent, size_t bitsPerPixel, size_t bytesPerRow, CGDataProviderRef provider, const float decode[], int shouldInterpolate)
CGImageAlphaInfo CGImageGetAlphaInfo(CGImageRef image)
CGImageRef CGImageRetain(CGImageRef image)
CGImageRef CGImageCreateWithJPEGDataProvider(CGDataProviderRef source, const float decode[], int shouldInterpolate, CGColorRenderingIntent intent)
CGColorSpaceRef CGImageGetColorSpace(CGImageRef image)
CGImageRef CGImageCreate(size_t width, size_t height, size_t bitsPerComponent, size_t bitsPerPixel, size_t bytesPerRow, CGColorSpaceRef colorspace, CGImageAlphaInfo alphaInfo, CGDataProviderRef provider, const float decode[], int shouldInterpolate, CGColorRenderingIntent intent)