/ CoreGraphics / CGBitmapContext.m
CGBitmapContext.m
 1  /* Copyright (c) 2007 Christopher J. W. Lloyd
 2  
 3  Permission is hereby granted, free of charge, to any person obtaining a copy of
 4  this software and associated documentation files (the "Software"), to deal in
 5  the Software without restriction, including without limitation the rights to
 6  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 7  the Software, and to permit persons to whom the Software is furnished to do so,
 8  subject to the following conditions:
 9  
10  The above copyright notice and this permission notice shall be included in all
11  copies or substantial portions of the Software.
12  
13  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
19  
20  #import <CoreGraphics/CGBitmapContext.h>
21  #import <Onyx2D/O2BitmapContext.h>
22  
23  CGContextRef CGBitmapContextCreate(void *bytes, size_t width, size_t height,
24                                     size_t bitsPerComponent, size_t bytesPerRow,
25                                     CGColorSpaceRef colorSpace,
26                                     CGBitmapInfo bitmapInfo)
27  {
28      return O2BitmapContextCreate(bytes, width, height, bitsPerComponent,
29                                   bytesPerRow, colorSpace, bitmapInfo);
30  }
31  
32  CGContextRef CGBitmapContextCreateWithData(void *data, size_t width, size_t height,
33                                             size_t bitsPerComponent, size_t bytesPerRow,
34                                             CGColorSpaceRef space, uint32_t bitmapInfo,
35                                             CGBitmapContextReleaseDataCallback releaseCallback,
36                                             void *releaseInfo)
37  {
38      printf("STUB %s\n", __PRETTY_FUNCTION__);
39      return nil;
40  }
41  
42  void *CGBitmapContextGetData(CGContextRef self) {
43      return O2BitmapContextGetData(self);
44  }
45  
46  size_t CGBitmapContextGetWidth(CGContextRef self) {
47      return O2BitmapContextGetWidth(self);
48  }
49  
50  size_t CGBitmapContextGetHeight(CGContextRef self) {
51      return O2BitmapContextGetHeight(self);
52  }
53  
54  size_t CGBitmapContextGetBitsPerComponent(CGContextRef self) {
55      return O2BitmapContextGetBitsPerComponent(self);
56  }
57  
58  size_t CGBitmapContextGetBytesPerRow(CGContextRef self) {
59      return O2BitmapContextGetBytesPerRow(self);
60  }
61  
62  CGColorSpaceRef CGBitmapContextGetColorSpace(CGContextRef self) {
63      return O2BitmapContextGetColorSpace(self);
64  }
65  
66  CGBitmapInfo CGBitmapContextGetBitmapInfo(CGContextRef self) {
67      return O2BitmapContextGetBitmapInfo(self);
68  }
69  
70  size_t CGBitmapContextGetBitsPerPixel(CGContextRef self) {
71      return O2BitmapContextGetBitsPerPixel(self);
72  }
73  
74  CGImageAlphaInfo CGBitmapContextGetAlphaInfo(CGContextRef self) {
75      return O2BitmapContextGetAlphaInfo(self);
76  }
77  
78  CGImageRef CGBitmapContextCreateImage(CGContextRef self) {
79      return O2BitmapContextCreateImage(self);
80  }