SMPixelFree.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. //
  2. // SMPixelFree.h
  3. // SMBeautyEngine
  4. //
  5. // Created by mumu on 2020/7/27.
  6. // Copyright © 2020 孙慕. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import <OpenGLES/EAGL.h>
  10. #import <OpenGLES/ES2/gl.h>
  11. #import <OpenGLES/ES2/glext.h>
  12. #import "pixelFree_c.hpp"
  13. //#import "SMFilterModel.h"
  14. NS_ASSUME_NONNULL_BEGIN
  15. __attribute__((visibility("default"))) @interface SMPixelFree : NSObject
  16. /// 初始化
  17. /// @param context sdk 运行的上线文,context != nil 所有着色器程序将在这里初始化, 否在视频第一帧处理时候初始化
  18. - (instancetype)initWithProcessContext:(EAGLContext *)context srcFilterPath:(NSString *)filterPath authFile:(NSString *)authFile;
  19. /*!
  20. @property glContext
  21. @brief OpenGL context
  22. @since v1.0.0
  23. */
  24. @property(nonatomic, strong, readonly) EAGLContext* glContext;
  25. /**
  26. 处理纹理数据
  27. @param texture 纹理数据
  28. @param width 宽度
  29. @param height 高度
  30. */
  31. - (void)processWithTexture:(GLuint)texture width:(GLint)width height:(GLint)height;
  32. /**
  33. 处理cpu数据
  34. @param pixelBuffer 纹理数据
  35. @param rotationMode 人脸检测方向
  36. */
  37. - (int)processWithBuffer:(CVPixelBufferRef)pixelBuffer rotationMode:(PFRotationMode)rotationMode;
  38. /**
  39. 图片处理
  40. @param image 纹理数据
  41. @param rotationMode 人脸检测方向
  42. @return 处理后效果图
  43. */
  44. - (UIImage *)processWithImage:(UIImage *)image rotationMode:(PFRotationMode)rotationMode;
  45. - (void)pixelFreeSetBeautyFiterParam:(int)key value:(void *)value;
  46. // 加载美颜bundle
  47. - (void)createBeautyItemFormBundle:(void*)data size:(int)sz;
  48. - (void)pixelFreeGetFaceRect:(float *)faceRect;
  49. - (int)getPixelFreeFaceNum;
  50. @end
  51. NS_ASSUME_NONNULL_END