HHCustomCameraView.h
1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// 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