forked from card-io/card.io-iOS-source
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCardIOGPURenderer.h
37 lines (27 loc) · 1.06 KB
/
CardIOGPURenderer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
// CardIOGPURenderer.h
// See the file "LICENSE.md" for the full license governing this code.
//
@interface CardIOGPURenderer : NSObject {
// Handles
GLuint _programHandle;
// Inputs
GLuint _inputTexture, _positionSlot, _texCoordSlot, _textureUniform;
}
- (id)initWithSize:(CGSize)size vertexShaderSrc:(NSString *)vertexShaderSrc fragmentShaderSrc:(NSString *)vertexShaderSrc;
- (void)finish;
- (void)prepareForUse;
- (GLuint) uniformIndex:(NSString *)uniformName;
- (void)withContextDo:(void (^)(void))successBlock;
- (void)renderUIImage:(UIImage *)inputImage toSize:(const CGSize)targetSize;
// Creates a UIImage from the currently rendered framebuffer.
// Resulting image is 32bit RGBA
- (UIImage *)captureUIImageOfSize:(const CGSize)size;
#if USE_CAMERA
- (void)renderIplImage:(IplImage *)inputImage toSize:(const CGSize)targetSize;
// Creates an IplImage from the currently rendered framebuffer.
// Resulting image is 8bit grayscale
- (void) captureIplImage:(IplImage *)dstImg;
#endif // USE_CAMERA
@property (nonatomic, assign, readonly) CGSize size;
@end