HHCustomCameraView.h 1.34 KB
//
//  HHCustomCameraView.h
//  HHDoctor
//
//  Created by 罗志平 on 2022/4/6.
//

#import <UIKit/UIKit.h>

typedef void (^CompletionBlock)(UIImage * _Nonnull image);

@class HHCustomCameraView;

NS_ASSUME_NONNULL_BEGIN

@protocol HHCustomCameraViewProtocol <NSObject>

- (void)customCamera:(HHCustomCameraView *)customCameraView didSnapShotVideo:(UIImage *)image;

- (void)customCameraDidCancel:(HHCustomCameraView *)customCameraView;

// TRTC判断是否是前置摄像头
- (BOOL)customCameraIsFrontCamera:(HHCustomCameraView *)customCameraView;

// 设置TRTC自动聚焦是否可用
- (void)customCamera:(HHCustomCameraView *)customCameraView enableCameraAutoFocus:(BOOL)enableCameraAutoFocus;

// TRTC切换摄像头
- (void)customCamera:(HHCustomCameraView *)customCameraView frontCamera:(BOOL)frontCamera;

// TRTC设置聚焦位置
- (void)customCamera:(HHCustomCameraView *)customCameraView focusPosition:(CGPoint)point;

// TRTC截屏
- (void)customCamera:(HHCustomCameraView *)customCamaraView snapshotVideo:(CompletionBlock)completionBlock;

@end

typedef NS_ENUM(NSInteger, ScaleEnum) {
    large,
    small,
};

@interface HHCustomCameraView : UIView

@property (nonatomic, weak) id<HHCustomCameraViewProtocol>  delegate;

+ (HHCustomCameraView *)customCameraViewWithFrame:(CGRect)frame;

- (void)scale:(ScaleEnum)scaleEnum;

@end

NS_ASSUME_NONNULL_END