FUOpenGLView.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // FUOpenGLView.h
  3. // FULiveDemo
  4. //
  5. // Created by 刘洋 on 2017/8/15.
  6. // Copyright © 2017年 刘洋. All rights reserved.
  7. //
  8. #import <GLKit/GLKit.h>
  9. typedef NS_ENUM(NSInteger, FUOpenGLViewOrientation) {
  10. FUOpenGLViewOrientationPortrait = 0,
  11. FUOpenGLViewOrientationLandscapeRight = 1,
  12. FUOpenGLViewOrientationPortraitUpsideDown = 2,
  13. FUOpenGLViewOrientationLandscapeLeft = 3,
  14. };
  15. typedef NS_ENUM(NSInteger, FUOpenGLViewContentMode) {
  16. /* 等比例短边充满 */
  17. FUOpenGLViewContentModeScaleAspectFill = 0,
  18. /* 拉伸铺满 */
  19. FUOpenGLViewContentModeScaleToFill = 1,
  20. /* 等比例长边充满 */
  21. FUOpenGLViewContentModeScaleAspectFit = 2,
  22. };
  23. @interface FUOpenGLView : UIView
  24. /* 视频填充模式 */
  25. @property (nonatomic, assign) FUOpenGLViewContentMode contentMode;
  26. // 设置视频朝向,保证视频总是竖屏播放
  27. @property (nonatomic, assign) FUOpenGLViewOrientation origintation;
  28. @property (nonatomic, assign) NSInteger disapplePointIndex ;
  29. - (UIColor*)getColorWithPoint:(CGPoint)point;
  30. - (void)displayPixelBuffer:(CVPixelBufferRef)pixelBuffer;
  31. - (void)displayPixelBuffer:(CVPixelBufferRef)pixelBuffer withLandmarks:(float *)landmarks count:(int)count MAX:(BOOL)max;
  32. - (void)displayImageData:(void *)imageData Size:(CGSize)size Landmarks:(float *)landmarks count:(int)count zoomScale:(float)zoomScale;
  33. - (void)displayImageData:(void *)imageData withSize:(CGSize)size Center:(CGPoint)center Landmarks:(float *)landmarks count:(int)count;
  34. /* 同步渲染 */
  35. - (void)displaySyncPixelBuffer:(CVPixelBufferRef)pixelBuffer;
  36. @end