Chipmunk2D Pro API Reference  6.1.5
 All Classes Functions Variables Typedefs Properties Groups Pages
ChipmunkImageSampler.h
1 #import "ObjectiveChipmunk.h"
2 #import "ChipmunkAutoGeometry.h"
3 
4 #import <TargetConditionals.h>
5 
6 #if TARGET_OS_IPHONE == 1
7  #import <CoreGraphics/CoreGraphics.h>
8 #endif
9 
10 
17 @private
18  NSUInteger _width, _height, _stride;
19  NSUInteger _bytesPerPixel, _component;
20 
21  bool _flip;
22  const uint8_t *_pixels;
23  NSData *_pixelData;
24 
25  cpFloat _borderValue;
26 
27  cpBB _outputRect;
28 }
29 
31 @property(nonatomic, readonly) NSUInteger width;
32 
34 @property(nonatomic, readonly) NSUInteger height;
35 
37 @property(nonatomic, readonly) NSUInteger bytesPerPixel;
38 
40 @property(nonatomic, assign) NSUInteger component;
41 
43 @property(nonatomic, readonly) NSData *pixelData;
44 
47 @property(nonatomic, assign) cpBB outputRect;
48 
57 -(id)initWithWidth:(NSUInteger)width height:(NSUInteger)height stride:(NSUInteger)stride bytesPerPixel:(NSUInteger)bytesPerPixel component:(NSUInteger)component flip:(bool)flip pixelData:(NSData *)pixelData;
58 
60 -(void)setBorderRepeat;
61 
63 -(void)setBorderValue:(cpFloat)borderValue;
64 
66 -(ChipmunkPolylineSet *)marchAllWithBorder:(bool)bordered hard:(bool)hard;
67 
68 @end
69 
70 
71 
75 @private
76  CGContextRef _context;
77 }
78 
80 @property(nonatomic, readonly) CGContextRef context;
81 
83 @property(nonatomic, readonly) NSMutableData *pixelData;
84 
87 -(id)initWithWidth:(int)width height:(int)height colorSpace:(CGColorSpaceRef)colorSpace bitmapInfo:(CGBitmapInfo)bitmapInfo component:(NSUInteger)component;
88 
89 @end
90 
91 
92 
95 
97 +(CGImageRef)loadImage:(NSURL *)url;
98 
101 -(id)initWithImage:(CGImageRef)image isMask:(bool)isMask contextWidth:(NSUInteger)width contextHeight:(NSUInteger)height;
102 
105 -(id)initWithImageFile:(NSURL *)url isMask:(bool)isMask;
106 
109 +(ChipmunkImageSampler *)samplerWithImageFile:(NSURL *)url isMask:(bool)isMask;
110 
111 @end