PPIDCardSDK Penpower
PPIDCardCaptureView.h
1//
2// PPIDCardCaptureView.h
3//
4
5#import <UIKit/UIKit.h>
6#import <PPIDCardSDK/PPIDCardDetectStatus.h>
7#import <PPIDCardSDK/PPIDCardType.h>
8#import <PPIDCardSDK/PPIDCardSide.h>
9
11// Mode setting (標準版要把mode都關掉)
12
13// 只顯示preview畫面,所有狀態透過delegate通知。
14#define _MODE_SINGLE_AUTO_
15
16// 5合1偵測
17//#define _MODE_MULTI_DETECT_
18
20
21// local端辨識
22#define _LOCAL_RECOGNIZE_
23
25
27@class PPIDCardAppearanceModel;
31
32@protocol PPIDCardCaptureViewDelegate <NSObject>
33@optional
34
35#if defined (_MODE_SINGLE_AUTO_)
36
54- (void)captureViewDidDetectWithStatus:(PPIDCardDetectStatus)status cornerPoints:(NSArray<NSValue *> *)cornerPoints;
55
56
57#ifdef _LOCAL_RECOGNIZE_
58
61- (void)captureViewDidRecognizeWithIDCardResult:(PPIDCardResultModel *)result;
62
65- (void)captureViewDidRecognizeWithDriverLicenseResult:(PPDriverLicenseResultModel *)result;
66
69- (void)captureViewDidRecognizeWithPassportResult:(PPPassportResultModel *)result;
70
71#else
72
75- (void)captureViewDidCaptureWithJpgData:(NSData *)jpgData;
76
77#endif // endof _LOCAL_RECOGNIZE_
78
79
80#elif defined (_MODE_MULTI_DETECT_)
81
83- (void)captureViewDidClickCancel;
84
88- (void)captureViewDidCaptureFrontSideImage:(UIImage *)frontSideImage backSideImage:(UIImage *)backSideImage;
89
90#else
91
93- (void)captureViewDidClickCancel;
94
98- (void)captureViewDidRecognizeWithFrontSideResult:(PPIDCardResultModel *)frontSideResult
99 backSideResult:(PPIDCardResultModel *)backSideResult;
100
101#endif
102
103@end
104
106
107@interface PPIDCardCaptureView : UIView
108
110@property (atomic, assign) id<PPIDCardCaptureViewDelegate> delegate;
111
113@property (nonatomic, assign) PPIDCardType cardType;
114
116@property (nonatomic, assign) BOOL enableFaceDetection;
117
121- (instancetype)initWithFrame:(CGRect)frame
122 signature:(NSString *)signature;
123
124@end
125
126
128
129
130#if defined (_MODE_SINGLE_AUTO_)
131
132@interface PPIDCardCaptureView (SingleAuto)
133
135@property (nonatomic, assign) PPIDCardSide captureSide;
136
138@property (nonatomic, assign) UIInterfaceOrientation previewOrientation;
139
144- (void)switchToFrontCamera:(BOOL)toFrontCamera;
145
148- (void)torchTurnOn:(BOOL)turnOn;
149
152- (void)focusWithPoint:(CGPoint)viewPoint;
153
156- (void)capture;
157
159- (void)restart;
160
165- (void)borderWithColor:(UIColor *)color width:(CGFloat)width cornerRadius:(CGFloat)cornerRadius;
166
167@end
168
169#endif
170
171
173
174
175#if defined (_MODE_MULTI_DETECT_)
176
177@interface PPIDCardCaptureView (MultiDetect)
178
180@property (nonatomic, assign) BOOL defaultManualCapture;
181
183@property (nonatomic, assign) BOOL enableSideDetection;
184
186@property (nonatomic, retain) PPIDCardAppearanceModel *appearanceModel;
187
188@end
189
190#endif
Definition PPDriverLicenseResultModel.h:9
Definition PPIDCardCaptureView.h:108
PPIDCardType cardType
證件種類,預設為身份證。
Definition PPIDCardCaptureView.h:113
BOOL enableFaceDetection
駕照是否開啟人臉偵測,預設為開啟。
Definition PPIDCardCaptureView.h:116
id< PPIDCardCaptureViewDelegate > delegate
代理
Definition PPIDCardCaptureView.h:110
Definition PPIDCardResultModel.h:9
Definition PPPassportResultModel.h:9