GPUImageRawDataOutput.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #import <Foundation/Foundation.h>
  2. #import "GPUImageContext.h"
  3. struct GPUByteColorVector {
  4. GLubyte red;
  5. GLubyte green;
  6. GLubyte blue;
  7. GLubyte alpha;
  8. };
  9. typedef struct GPUByteColorVector GPUByteColorVector;
  10. @protocol GPUImageRawDataProcessor;
  11. #if TARGET_IPHONE_SIMULATOR || TARGET_OS_IPHONE
  12. @interface GPUImageRawDataOutput : NSObject <GPUImageInput> {
  13. CGSize imageSize;
  14. GPUImageRotationMode inputRotation;
  15. BOOL outputBGRA;
  16. }
  17. #else
  18. @interface GPUImageRawDataOutput : NSObject <GPUImageInput> {
  19. CGSize imageSize;
  20. GPUImageRotationMode inputRotation;
  21. BOOL outputBGRA;
  22. }
  23. #endif
  24. @property(readonly) GLubyte *rawBytesForImage;
  25. @property(nonatomic, copy) void(^newFrameAvailableBlock)(void);
  26. @property(nonatomic) BOOL enabled;
  27. // Initialization and teardown
  28. - (id)initWithImageSize:(CGSize)newImageSize resultsInBGRAFormat:(BOOL)resultsInBGRAFormat;
  29. // Data access
  30. - (GPUByteColorVector)colorAtLocation:(CGPoint)locationInImage;
  31. - (NSUInteger)bytesPerRowInOutput;
  32. - (void)setImageSize:(CGSize)newImageSize;
  33. - (void)lockFramebufferForReading;
  34. - (void)unlockFramebufferAfterReading;
  35. @end