GPUImageView.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. #import <Cocoa/Cocoa.h>
  2. #import "GPUImageContext.h"
  3. typedef enum {
  4. kGPUImageFillModeStretch, // Stretch to fill the full view, which may distort the image outside of its normal aspect ratio
  5. kGPUImageFillModePreserveAspectRatio, // Maintains the aspect ratio of the source image, adding bars of the specified background color
  6. kGPUImageFillModePreserveAspectRatioAndFill // Maintains the aspect ratio of the source image, zooming in on its center to fill the view
  7. } GPUImageFillModeType;
  8. /**
  9. UIView subclass to use as an endpoint for displaying GPUImage outputs
  10. */
  11. @interface GPUImageView : NSOpenGLView <GPUImageInput>
  12. {
  13. GPUImageRotationMode inputRotation;
  14. }
  15. /** The fill mode dictates how images are fit in the view, with the default being kGPUImageFillModePreserveAspectRatio
  16. */
  17. @property(readwrite, nonatomic) GPUImageFillModeType fillMode;
  18. /** This calculates the current display size, in pixels, taking into account Retina scaling factors
  19. */
  20. @property(readonly, nonatomic) CGSize sizeInPixels;
  21. @property(nonatomic) BOOL enabled;
  22. /** Handling fill mode
  23. @param redComponent Red component for background color
  24. @param greenComponent Green component for background color
  25. @param blueComponent Blue component for background color
  26. @param alphaComponent Alpha component for background color
  27. */
  28. - (void)setBackgroundColorRed:(GLfloat)redComponent green:(GLfloat)greenComponent blue:(GLfloat)blueComponent alpha:(GLfloat)alphaComponent;
  29. - (void)setCurrentlyReceivingMonochromeInput:(BOOL)newValue;
  30. @end