@regulaforensics/cordova-plugin-document-reader-api 6.9.1 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -40
- package/example/README.md +32 -0
- package/example/config.xml +5 -1
- package/example/package.json +7 -10
- package/example/www/js/index.js +85 -159
- package/package.json +1 -1
- package/plugin.xml +8 -8
- package/src/android/BluetoothUtil.kt +78 -74
- package/src/android/Config.kt +692 -0
- package/src/android/DocumentReader.kt +524 -0
- package/src/android/JSONConstructor.kt +2198 -0
- package/src/android/Utils.kt +261 -0
- package/src/android/build.gradle +3 -3
- package/src/ios/RGLWConfig.h +48 -0
- package/src/ios/RGLWConfig.m +1312 -0
- package/src/ios/RGLWDocumentReader.h +14 -11
- package/src/ios/RGLWDocumentReader.m +384 -579
- package/src/ios/RGLWJSONConstructor.h +173 -69
- package/src/ios/RGLWJSONConstructor.m +1832 -786
- package/www/DocumentReader.js +869 -278
- package/src/android/DocumentReader.java +0 -1118
- package/src/android/Helpers.java +0 -259
- package/src/android/JSONConstructor.java +0 -1119
- package/src/android/RegulaConfig.java +0 -830
- package/src/ios/RGLWRegulaConfig.h +0 -26
- package/src/ios/RGLWRegulaConfig.m +0 -1152
|
@@ -0,0 +1,1312 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RGLWConfig.m
|
|
3
|
+
// DocumentReader
|
|
4
|
+
//
|
|
5
|
+
// Created by Pavel Masiuk on 21.09.2023.
|
|
6
|
+
// Copyright © 2023 Regula. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <Foundation/Foundation.h>
|
|
10
|
+
#import "RGLWConfig.h"
|
|
11
|
+
|
|
12
|
+
@implementation RGLWConfig
|
|
13
|
+
|
|
14
|
+
+(void)setFunctionality:(NSDictionary*)options :(RGLFunctionality*)functionality {
|
|
15
|
+
// Boolean
|
|
16
|
+
if([options valueForKey:@"showTorchButton"] != nil)
|
|
17
|
+
functionality.showTorchButton = [[options valueForKey:@"showTorchButton"] boolValue];
|
|
18
|
+
if([options valueForKey:@"showCloseButton"] != nil)
|
|
19
|
+
functionality.showCloseButton = [[options valueForKey:@"showCloseButton"] boolValue];
|
|
20
|
+
if([options valueForKey:@"videoCaptureMotionControl"] != nil)
|
|
21
|
+
functionality.videoCaptureMotionControl = [[options valueForKey:@"videoCaptureMotionControl"] boolValue];
|
|
22
|
+
if([options valueForKey:@"showCaptureButton"] != nil)
|
|
23
|
+
functionality.showCaptureButton = [[options valueForKey:@"showCaptureButton"] boolValue];
|
|
24
|
+
if([options valueForKey:@"showChangeFrameButton"] != nil)
|
|
25
|
+
functionality.showChangeFrameButton = [[options valueForKey:@"showChangeFrameButton"] boolValue];
|
|
26
|
+
if([options valueForKey:@"showSkipNextPageButton"] != nil)
|
|
27
|
+
functionality.showSkipNextPageButton = [[options valueForKey:@"showSkipNextPageButton"] boolValue];
|
|
28
|
+
if([options valueForKey:@"useAuthenticator"] != nil)
|
|
29
|
+
functionality.useAuthenticator = [[options valueForKey:@"useAuthenticator"] boolValue];
|
|
30
|
+
if([options valueForKey:@"skipFocusingFrames"] != nil)
|
|
31
|
+
functionality.skipFocusingFrames = [[options valueForKey:@"skipFocusingFrames"] boolValue];
|
|
32
|
+
if([options valueForKey:@"showCameraSwitchButton"] != nil)
|
|
33
|
+
functionality.showCameraSwitchButton = [[options valueForKey:@"showCameraSwitchButton"] boolValue];
|
|
34
|
+
if([options valueForKey:@"displayMetadata"] != nil)
|
|
35
|
+
functionality.showMetadataInfo = [[options valueForKey:@"displayMetadata"] boolValue];
|
|
36
|
+
if([options valueForKey:@"isZoomEnabled"] != nil)
|
|
37
|
+
functionality.isZoomEnabled = [[options valueForKey:@"isZoomEnabled"] boolValue];
|
|
38
|
+
if([options valueForKey:@"recordScanningProcess"] != nil)
|
|
39
|
+
functionality.recordScanningProcess = [[options valueForKey:@"recordScanningProcess"] boolValue];
|
|
40
|
+
if([options valueForKey:@"manualMultipageMode"] != nil)
|
|
41
|
+
functionality.manualMultipageMode = [[options valueForKey:@"manualMultipageMode"] boolValue];
|
|
42
|
+
if([options valueForKey:@"singleResult"] != nil)
|
|
43
|
+
functionality.singleResult = [[options valueForKey:@"singleResult"] boolValue];
|
|
44
|
+
|
|
45
|
+
// Int
|
|
46
|
+
if([options valueForKey:@"showCaptureButtonDelayFromDetect"] != nil)
|
|
47
|
+
functionality.showCaptureButtonDelayFromDetect = [[options valueForKey:@"showCaptureButtonDelayFromDetect"] doubleValue];
|
|
48
|
+
if([options valueForKey:@"showCaptureButtonDelayFromStart"] != nil)
|
|
49
|
+
functionality.showCaptureButtonDelayFromStart = [[options valueForKey:@"showCaptureButtonDelayFromStart"] doubleValue];
|
|
50
|
+
if([options valueForKey:@"forcePagesCount"] != nil)
|
|
51
|
+
functionality.forcePagesCount = [options valueForKey:@"forcePagesCount"];
|
|
52
|
+
if([options valueForKey:@"orientation"] != nil)
|
|
53
|
+
functionality.orientation = [self interfaceOrientationMaskWithNumber:[options valueForKey:@"orientation"]];
|
|
54
|
+
if([options valueForKey:@"captureMode"] != nil)
|
|
55
|
+
functionality.captureMode = [[options valueForKey:@"captureMode"] integerValue];
|
|
56
|
+
if(options[@"cameraPositionIOS"])
|
|
57
|
+
functionality.cameraPosition = [options[@"cameraPositionIOS"] integerValue];
|
|
58
|
+
|
|
59
|
+
// String
|
|
60
|
+
if([options valueForKey:@"cameraFrame"] != nil)
|
|
61
|
+
functionality.cameraFrame = [self docReaderFrameWithString:[options valueForKey:@"cameraFrame"]];
|
|
62
|
+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
63
|
+
if([options valueForKey:@"btDeviceName"] != nil)
|
|
64
|
+
functionality.btDeviceName = [options valueForKey:@"btDeviceName"];
|
|
65
|
+
#pragma clang diagnostic pop
|
|
66
|
+
|
|
67
|
+
// Float
|
|
68
|
+
if([options valueForKey:@"zoomFactor"] != nil)
|
|
69
|
+
functionality.zoomFactor = [[options valueForKey:@"zoomFactor"] floatValue];
|
|
70
|
+
|
|
71
|
+
// JSONObject
|
|
72
|
+
if([options valueForKey:@"onlineProcessingConfiguration"] != nil)
|
|
73
|
+
functionality.onlineProcessingConfig = [RGLWJSONConstructor onlineProcessingConfigFromJson:[options valueForKey:@"onlineProcessingConfiguration"]];
|
|
74
|
+
|
|
75
|
+
// Custom
|
|
76
|
+
// in android - cameraSize
|
|
77
|
+
if([options valueForKey:@"videoSessionPreset"] != nil)
|
|
78
|
+
functionality.videoSessionPreset = [self captureSessionPresetWithNumber:[options valueForKey:@"videoSessionPreset"]];
|
|
79
|
+
if([options valueForKey:@"videoOutputSettings"] != nil)
|
|
80
|
+
functionality.videoOutputSettings = [options valueForKey:@"videoOutputSettings"];
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
+(NSDictionary*)getFunctionality:(RGLFunctionality*)functionality {
|
|
84
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
85
|
+
|
|
86
|
+
// Boolean
|
|
87
|
+
result[@"showTorchButton"] = [NSNumber numberWithBool:functionality.showTorchButton];
|
|
88
|
+
result[@"showCloseButton"] = [NSNumber numberWithBool:functionality.showCloseButton];
|
|
89
|
+
result[@"videoCaptureMotionControl"] = [NSNumber numberWithBool:functionality.videoCaptureMotionControl];
|
|
90
|
+
result[@"showCaptureButton"] = [NSNumber numberWithBool:functionality.showCaptureButton];
|
|
91
|
+
result[@"showChangeFrameButton"] = [NSNumber numberWithBool:functionality.showChangeFrameButton];
|
|
92
|
+
result[@"showSkipNextPageButton"] = [NSNumber numberWithBool:functionality.showSkipNextPageButton];
|
|
93
|
+
result[@"useAuthenticator"] = [NSNumber numberWithBool:functionality.isUseAuthenticator];
|
|
94
|
+
result[@"skipFocusingFrames"] = [NSNumber numberWithBool:functionality.skipFocusingFrames];
|
|
95
|
+
result[@"showCameraSwitchButton"] = [NSNumber numberWithBool:functionality.showCameraSwitchButton];
|
|
96
|
+
result[@"displayMetadata"] = [NSNumber numberWithBool:functionality.showMetadataInfo];
|
|
97
|
+
result[@"isZoomEnabled"] = [NSNumber numberWithBool:functionality.isZoomEnabled];
|
|
98
|
+
result[@"recordScanningProcess"] = [NSNumber numberWithBool:functionality.recordScanningProcess];
|
|
99
|
+
result[@"manualMultipageMode"] = [NSNumber numberWithBool:functionality.manualMultipageMode];
|
|
100
|
+
result[@"singleResult"] = [NSNumber numberWithBool:functionality.singleResult];
|
|
101
|
+
|
|
102
|
+
// Int
|
|
103
|
+
result[@"showCaptureButtonDelayFromDetect"] = [NSNumber numberWithDouble:functionality.showCaptureButtonDelayFromDetect];
|
|
104
|
+
result[@"showCaptureButtonDelayFromStart"] = [NSNumber numberWithDouble:functionality.showCaptureButtonDelayFromStart];
|
|
105
|
+
result[@"forcePagesCount"] = functionality.forcePagesCount;
|
|
106
|
+
result[@"orientation"] = [self generateInterfaceOrientationMask:functionality.orientation];
|
|
107
|
+
result[@"captureMode"] = [NSNumber numberWithInteger:functionality.captureMode];
|
|
108
|
+
result[@"cameraPositionIOS"] = @(functionality.cameraPosition);
|
|
109
|
+
|
|
110
|
+
// String
|
|
111
|
+
result[@"cameraFrame"] = [self generateDocReaderFrame:functionality.cameraFrame];
|
|
112
|
+
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
|
|
113
|
+
result[@"btDeviceName"] = functionality.btDeviceName;
|
|
114
|
+
#pragma clang diagnostic pop
|
|
115
|
+
|
|
116
|
+
// Float
|
|
117
|
+
result[@"zoomFactor"] = [NSNumber numberWithFloat:functionality.zoomFactor];
|
|
118
|
+
|
|
119
|
+
// JSONObject
|
|
120
|
+
result[@"onlineProcessingConfiguration"] = [RGLWJSONConstructor generateOnlineProcessingConfig:functionality.onlineProcessingConfig];
|
|
121
|
+
|
|
122
|
+
// Custom
|
|
123
|
+
// in android - cameraSize
|
|
124
|
+
result[@"videoSessionPreset"] = [self generateCaptureSessionPreset:functionality.videoSessionPreset];
|
|
125
|
+
result[@"videoOutputSettings"] = functionality.videoOutputSettings;
|
|
126
|
+
|
|
127
|
+
return result;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
+(void)setProcessParams:(NSDictionary*)options :(RGLProcessParams*)processParams {
|
|
131
|
+
|
|
132
|
+
// Boolean
|
|
133
|
+
if([options valueForKey:@"multipageProcessing"] != nil)
|
|
134
|
+
processParams.multipageProcessing = [options valueForKey:@"multipageProcessing"];
|
|
135
|
+
if([options valueForKey:@"logs"] != nil)
|
|
136
|
+
processParams.logs = [options valueForKey:@"logs"];
|
|
137
|
+
if([options valueForKey:@"debugSaveImages"] != nil)
|
|
138
|
+
processParams.debugSaveImages = [options valueForKey:@"debugSaveImages"];
|
|
139
|
+
if([options valueForKey:@"debugSaveLogs"] != nil)
|
|
140
|
+
processParams.debugSaveLogs = [options valueForKey:@"debugSaveLogs"];
|
|
141
|
+
if([options valueForKey:@"returnUncroppedImage"] != nil)
|
|
142
|
+
processParams.returnUncroppedImage = [options valueForKey:@"returnUncroppedImage"];
|
|
143
|
+
if([options valueForKey:@"debugSaveCroppedImages"] != nil)
|
|
144
|
+
processParams.debugSaveCroppedImages = [options valueForKey:@"debugSaveCroppedImages"];
|
|
145
|
+
if([options valueForKey:@"disableFocusingCheck"] != nil)
|
|
146
|
+
processParams.disableFocusingCheck = [options valueForKey:@"disableFocusingCheck"];
|
|
147
|
+
if([options valueForKey:@"debugSaveRFIDSession"] != nil)
|
|
148
|
+
processParams.debugSaveRFIDSession = [options valueForKey:@"debugSaveRFIDSession"];
|
|
149
|
+
if([options valueForKey:@"doublePageSpread"] != nil)
|
|
150
|
+
processParams.doublePageSpread = [options valueForKey:@"doublePageSpread"];
|
|
151
|
+
if([options valueForKey:@"manualCrop"] != nil)
|
|
152
|
+
processParams.manualCrop = [options valueForKey:@"manualCrop"];
|
|
153
|
+
if([options valueForKey:@"integralImage"] != nil)
|
|
154
|
+
processParams.integralImage = [options valueForKey:@"integralImage"];
|
|
155
|
+
if([options valueForKey:@"returnCroppedBarcode"] != nil)
|
|
156
|
+
processParams.returnCroppedBarcode = [options valueForKey:@"returnCroppedBarcode"];
|
|
157
|
+
if([options valueForKey:@"checkRequiredTextFields"] != nil)
|
|
158
|
+
processParams.checkRequiredTextFields = [options valueForKey:@"checkRequiredTextFields"];
|
|
159
|
+
if([options valueForKey:@"depersonalizeLog"] != nil)
|
|
160
|
+
processParams.depersonalizeLog = [options valueForKey:@"depersonalizeLog"];
|
|
161
|
+
if([options valueForKey:@"generateDoublePageSpreadImage"] != nil)
|
|
162
|
+
processParams.generateDoublePageSpreadImage = [options valueForKey:@"generateDoublePageSpreadImage"];
|
|
163
|
+
if([options valueForKey:@"alreadyCropped"] != nil)
|
|
164
|
+
processParams.alreadyCropped = [options valueForKey:@"alreadyCropped"];
|
|
165
|
+
if([options valueForKey:@"matchTextFieldMask"] != nil)
|
|
166
|
+
processParams.matchTextFieldMask = [options valueForKey:@"matchTextFieldMask"];
|
|
167
|
+
if([options valueForKey:@"updateOCRValidityByGlare"] != nil)
|
|
168
|
+
processParams.updateOCRValidityByGlare = [options valueForKey:@"updateOCRValidityByGlare"];
|
|
169
|
+
if([options valueForKey:@"noGraphics"] != nil)
|
|
170
|
+
processParams.noGraphics = [options valueForKey:@"noGraphics"];
|
|
171
|
+
if([options valueForKey:@"multiDocOnImage"] != nil)
|
|
172
|
+
processParams.multiDocOnImage = [options valueForKey:@"multiDocOnImage"];
|
|
173
|
+
if([options valueForKey:@"forceReadMrzBeforeLocate"] != nil)
|
|
174
|
+
processParams.forceReadMrzBeforeLocate = [options valueForKey:@"forceReadMrzBeforeLocate"];
|
|
175
|
+
if([options valueForKey:@"parseBarcodes"] != nil)
|
|
176
|
+
processParams.parseBarcodes = [options valueForKey:@"parseBarcodes"];
|
|
177
|
+
if([options valueForKey:@"shouldReturnPackageForReprocess"] != nil)
|
|
178
|
+
processParams.shouldReturnPackageForReprocess = [options valueForKey:@"shouldReturnPackageForReprocess"];
|
|
179
|
+
if([options valueForKey:@"disablePerforationOCR"] != nil)
|
|
180
|
+
processParams.disablePerforationOCR = [options valueForKey:@"disablePerforationOCR"];
|
|
181
|
+
if([options valueForKey:@"respectImageQuality"] != nil)
|
|
182
|
+
processParams.respectImageQuality = [options valueForKey:@"respectImageQuality"];
|
|
183
|
+
if([options valueForKey:@"splitNames"] != nil)
|
|
184
|
+
processParams.splitNames = [options valueForKey:@"splitNames"];
|
|
185
|
+
if([options valueForKey:@"doDetectCan"] != nil)
|
|
186
|
+
processParams.doDetectCan = [options valueForKey:@"doDetectCan"];
|
|
187
|
+
if([options valueForKey:@"useFaceApi"] != nil)
|
|
188
|
+
processParams.useFaceApi = [options valueForKey:@"useFaceApi"];
|
|
189
|
+
if([options valueForKey:@"useAuthenticityCheck"] != nil)
|
|
190
|
+
processParams.useAuthenticityCheck = [options valueForKey:@"useAuthenticityCheck"];
|
|
191
|
+
if([options valueForKey:@"checkHologram"] != nil)
|
|
192
|
+
processParams.checkHologram = [options valueForKey:@"checkHologram"];
|
|
193
|
+
|
|
194
|
+
// Int
|
|
195
|
+
if([options valueForKey:@"measureSystem"] != nil)
|
|
196
|
+
processParams.measureSystem = [[options valueForKey:@"measureSystem"] integerValue];
|
|
197
|
+
if([options valueForKey:@"barcodeParserType"] != nil)
|
|
198
|
+
processParams.barcodeParserType = [options valueForKey:@"barcodeParserType"];
|
|
199
|
+
if([options valueForKey:@"perspectiveAngle"] != nil)
|
|
200
|
+
processParams.perspectiveAngle = [options valueForKey:@"perspectiveAngle"];
|
|
201
|
+
if([options valueForKey:@"minDPI"] != nil)
|
|
202
|
+
processParams.minDPI = [options valueForKey:@"minDPI"];
|
|
203
|
+
if([options valueForKey:@"imageDpiOutMax"] != nil)
|
|
204
|
+
processParams.imageDpiOutMax = [options valueForKey:@"imageDpiOutMax"];
|
|
205
|
+
if([options valueForKey:@"forceDocID"] != nil)
|
|
206
|
+
processParams.forceDocID = [options valueForKey:@"forceDocID"];
|
|
207
|
+
if([options valueForKey:@"forceDocFormat"] != nil)
|
|
208
|
+
processParams.forceDocFormat = [options valueForKey:@"forceDocFormat"];
|
|
209
|
+
if([options valueForKey:@"shiftExpiryDate"] != nil)
|
|
210
|
+
processParams.shiftExpiryDate = [options valueForKey:@"shiftExpiryDate"];
|
|
211
|
+
if([options valueForKey:@"minimalHolderAge"] != nil)
|
|
212
|
+
processParams.minimalHolderAge = [options valueForKey:@"minimalHolderAge"];
|
|
213
|
+
if([options valueForKey:@"imageOutputMaxHeight"] != nil)
|
|
214
|
+
processParams.imageOutputMaxHeight = [options valueForKey:@"imageOutputMaxHeight"];
|
|
215
|
+
if([options valueForKey:@"imageOutputMaxWidth"] != nil)
|
|
216
|
+
processParams.imageOutputMaxWidth = [options valueForKey:@"imageOutputMaxWidth"];
|
|
217
|
+
if([options valueForKey:@"processAuth"] != nil)
|
|
218
|
+
processParams.processAuth = [options valueForKey:@"processAuth"];
|
|
219
|
+
if([options valueForKey:@"convertCase"] != nil)
|
|
220
|
+
processParams.convertCase = [self textProcessingWithNumber:[options valueForKey:@"convertCase"]];
|
|
221
|
+
|
|
222
|
+
// String
|
|
223
|
+
if([options valueForKey:@"dateFormat"] != nil)
|
|
224
|
+
processParams.dateFormat = [options valueForKey:@"dateFormat"];
|
|
225
|
+
if([options valueForKey:@"scenario"] != nil)
|
|
226
|
+
processParams.scenario = [options valueForKey:@"scenario"];
|
|
227
|
+
if([options valueForKey:@"captureButtonScenario"] != nil)
|
|
228
|
+
processParams.captureButtonScenario = [options valueForKey:@"captureButtonScenario"];
|
|
229
|
+
|
|
230
|
+
// Double
|
|
231
|
+
if([options valueForKey:@"timeout"] != nil)
|
|
232
|
+
processParams.timeout = [options valueForKey:@"timeout"];
|
|
233
|
+
if([options valueForKey:@"timeoutFromFirstDetect"] != nil)
|
|
234
|
+
processParams.timeoutFromFirstDetect = [options valueForKey:@"timeoutFromFirstDetect"];
|
|
235
|
+
if([options valueForKey:@"timeoutFromFirstDocType"] != nil)
|
|
236
|
+
processParams.timeoutFromFirstDocType = [options valueForKey:@"timeoutFromFirstDocType"];
|
|
237
|
+
if([options valueForKey:@"documentAreaMin"] != nil)
|
|
238
|
+
processParams.documentAreaMin = [options valueForKey:@"documentAreaMin"];
|
|
239
|
+
|
|
240
|
+
// JSONArray
|
|
241
|
+
if([options valueForKey:@"documentIDList"] != nil)
|
|
242
|
+
processParams.documentIDList = [options valueForKey:@"documentIDList"];
|
|
243
|
+
if([options valueForKey:@"fieldTypesFilter"] != nil)
|
|
244
|
+
processParams.fieldTypesFilter = [options valueForKey:@"fieldTypesFilter"];
|
|
245
|
+
if([options valueForKey:@"barcodeTypes"] != nil)
|
|
246
|
+
processParams.barcodeTypes = [options valueForKey:@"barcodeTypes"];
|
|
247
|
+
if([options valueForKey:@"resultTypeOutput"] != nil)
|
|
248
|
+
processParams.resultTypeOutput = [options valueForKey:@"resultTypeOutput"];
|
|
249
|
+
if([options valueForKey:@"mrzFormatsFilter"] != nil)
|
|
250
|
+
processParams.mrzFormatsFilter = [options valueForKey:@"mrzFormatsFilter"];
|
|
251
|
+
if([options valueForKey:@"documentGroupFilter"] != nil)
|
|
252
|
+
processParams.documentGroupFilter = [options mutableArrayValueForKey:@"documentGroupFilter"];
|
|
253
|
+
if([options valueForKey:@"lcidIgnoreFilter"] != nil)
|
|
254
|
+
processParams.lcidIgnoreFilter = [options mutableArrayValueForKey:@"lcidIgnoreFilter"];
|
|
255
|
+
if([options valueForKey:@"lcidFilter"] != nil)
|
|
256
|
+
processParams.lcidFilter = [options mutableArrayValueForKey:@"lcidFilter"];
|
|
257
|
+
|
|
258
|
+
// JSONObject
|
|
259
|
+
if([options valueForKey:@"imageQA"] != nil)
|
|
260
|
+
[self setImageQA:processParams.imageQA input:[options valueForKey:@"imageQA"]];
|
|
261
|
+
if([options valueForKey:@"rfidParams"] != nil)
|
|
262
|
+
processParams.rfidParams = [RGLWJSONConstructor rfidParamsFromJson:[options valueForKey:@"rfidParams"]];
|
|
263
|
+
if([options valueForKey:@"faceApiParams"] != nil)
|
|
264
|
+
processParams.faceApiParams = [RGLWJSONConstructor faceAPIParamsFromJson:[options valueForKey:@"faceApiParams"]];
|
|
265
|
+
if([options valueForKey:@"backendProcessingConfig"] != nil)
|
|
266
|
+
processParams.backendProcessingConfig = [RGLWJSONConstructor backendProcessingConfigFromJson:[options valueForKey:@"backendProcessingConfig"]];
|
|
267
|
+
if([options valueForKey:@"authenticityParams"] != nil) {
|
|
268
|
+
if(processParams.authenticityParams == nil) processParams.authenticityParams = [RGLAuthenticityParams defaultParams];
|
|
269
|
+
[self setAuthenticityParams:processParams.authenticityParams input:[options valueForKey:@"authenticityParams"]];
|
|
270
|
+
}
|
|
271
|
+
|
|
272
|
+
// Custom
|
|
273
|
+
if([options valueForKey:@"customParams"] != nil)
|
|
274
|
+
processParams.customParams = [options valueForKey:@"customParams"];
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
+(NSDictionary*)getProcessParams:(RGLProcessParams*)processParams {
|
|
278
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
279
|
+
|
|
280
|
+
// Boolean
|
|
281
|
+
result[@"multipageProcessing"] = processParams.multipageProcessing;
|
|
282
|
+
result[@"logs"] = processParams.logs;
|
|
283
|
+
result[@"debugSaveImages"] = processParams.debugSaveImages;
|
|
284
|
+
result[@"debugSaveLogs"] = processParams.debugSaveLogs;
|
|
285
|
+
result[@"returnUncroppedImage"] = processParams.returnUncroppedImage;
|
|
286
|
+
result[@"debugSaveCroppedImages"] = processParams.debugSaveCroppedImages;
|
|
287
|
+
result[@"disableFocusingCheck"] = processParams.disableFocusingCheck;
|
|
288
|
+
result[@"debugSaveRFIDSession"] = processParams.debugSaveRFIDSession;
|
|
289
|
+
result[@"doublePageSpread"] = processParams.doublePageSpread;
|
|
290
|
+
result[@"manualCrop"] = processParams.manualCrop;
|
|
291
|
+
result[@"integralImage"] = processParams.integralImage;
|
|
292
|
+
result[@"returnCroppedBarcode"] = processParams.returnCroppedBarcode;
|
|
293
|
+
result[@"checkRequiredTextFields"] = processParams.checkRequiredTextFields;
|
|
294
|
+
result[@"depersonalizeLog"] = processParams.depersonalizeLog;
|
|
295
|
+
result[@"generateDoublePageSpreadImage"] = processParams.generateDoublePageSpreadImage;
|
|
296
|
+
result[@"alreadyCropped"] = processParams.alreadyCropped;
|
|
297
|
+
result[@"matchTextFieldMask"] = processParams.matchTextFieldMask;
|
|
298
|
+
result[@"updateOCRValidityByGlare"] = processParams.updateOCRValidityByGlare;
|
|
299
|
+
result[@"noGraphics"] = processParams.noGraphics;
|
|
300
|
+
result[@"multiDocOnImage"] = processParams.multiDocOnImage;
|
|
301
|
+
result[@"forceReadMrzBeforeLocate"] = processParams.forceReadMrzBeforeLocate;
|
|
302
|
+
result[@"parseBarcodes"] = processParams.parseBarcodes;
|
|
303
|
+
result[@"shouldReturnPackageForReprocess"] = processParams.shouldReturnPackageForReprocess;
|
|
304
|
+
result[@"disablePerforationOCR"] = processParams.disablePerforationOCR;
|
|
305
|
+
result[@"respectImageQuality"] = processParams.respectImageQuality;
|
|
306
|
+
result[@"splitNames"] = processParams.splitNames;
|
|
307
|
+
result[@"doDetectCan"] = processParams.doDetectCan;
|
|
308
|
+
result[@"useFaceApi"] = processParams.useFaceApi;
|
|
309
|
+
result[@"useAuthenticityCheck"] = processParams.useAuthenticityCheck;
|
|
310
|
+
result[@"checkHologram"] = processParams.checkHologram;
|
|
311
|
+
|
|
312
|
+
// Int
|
|
313
|
+
result[@"measureSystem"] = [NSNumber numberWithInteger:processParams.measureSystem];
|
|
314
|
+
result[@"barcodeParserType"] = processParams.barcodeParserType;
|
|
315
|
+
result[@"perspectiveAngle"] = processParams.perspectiveAngle;
|
|
316
|
+
result[@"minDPI"] = processParams.minDPI;
|
|
317
|
+
result[@"imageDpiOutMax"] = processParams.imageDpiOutMax;
|
|
318
|
+
result[@"forceDocID"] = processParams.forceDocID;
|
|
319
|
+
result[@"forceDocFormat"] = processParams.forceDocFormat;
|
|
320
|
+
result[@"shiftExpiryDate"] = processParams.shiftExpiryDate;
|
|
321
|
+
result[@"minimalHolderAge"] = processParams.minimalHolderAge;
|
|
322
|
+
result[@"imageOutputMaxHeight"] = processParams.imageOutputMaxHeight;
|
|
323
|
+
result[@"imageOutputMaxWidth"] = processParams.imageOutputMaxWidth;
|
|
324
|
+
result[@"processAuth"] = processParams.processAuth;
|
|
325
|
+
result[@"convertCase"] = [self generateWithTextProcessing:processParams.convertCase];
|
|
326
|
+
|
|
327
|
+
// String
|
|
328
|
+
result[@"dateFormat"] = processParams.dateFormat;
|
|
329
|
+
result[@"scenario"] = processParams.scenario;
|
|
330
|
+
result[@"captureButtonScenario"] = processParams.captureButtonScenario;
|
|
331
|
+
result[@"sessionLogFolder"] = processParams.sessionLogFolder;
|
|
332
|
+
|
|
333
|
+
// Double
|
|
334
|
+
result[@"timeout"] = processParams.timeout;
|
|
335
|
+
result[@"timeoutFromFirstDetect"] = processParams.timeoutFromFirstDetect;
|
|
336
|
+
result[@"timeoutFromFirstDocType"] = processParams.timeoutFromFirstDocType;
|
|
337
|
+
result[@"documentAreaMin"] = processParams.documentAreaMin;
|
|
338
|
+
|
|
339
|
+
// JSONArray
|
|
340
|
+
result[@"documentIDList"] = processParams.documentIDList;
|
|
341
|
+
result[@"barcodeTypes"] = processParams.barcodeTypes;
|
|
342
|
+
result[@"fieldTypesFilter"] = processParams.fieldTypesFilter;
|
|
343
|
+
result[@"documentGroupFilter"] = processParams.documentGroupFilter;
|
|
344
|
+
result[@"lcidIgnoreFilter"] = processParams.lcidIgnoreFilter;
|
|
345
|
+
result[@"lcidFilter"] = processParams.lcidFilter;
|
|
346
|
+
result[@"mrzFormatsFilter"] = processParams.mrzFormatsFilter;
|
|
347
|
+
result[@"resultTypeOutput"] = processParams.resultTypeOutput;
|
|
348
|
+
|
|
349
|
+
// JSONObject
|
|
350
|
+
result[@"imageQA"] = [self getImageQA:processParams.imageQA];
|
|
351
|
+
result[@"rfidParams"] = [RGLWJSONConstructor generateRFIDParams:processParams.rfidParams];
|
|
352
|
+
result[@"faceApiParams"] = [RGLWJSONConstructor generateFaceAPIParams:processParams.faceApiParams];
|
|
353
|
+
result[@"backendProcessingConfig"] = [RGLWJSONConstructor generateBackendProcessingConfig:processParams.backendProcessingConfig];
|
|
354
|
+
result[@"authenticityParams"] = [self getAuthenticityParams:processParams.authenticityParams];
|
|
355
|
+
|
|
356
|
+
// Custom
|
|
357
|
+
result[@"customParams"] = processParams.customParams;
|
|
358
|
+
|
|
359
|
+
return result;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
+(void)setCustomization:(NSDictionary*)options :(RGLCustomization*)customization {
|
|
363
|
+
// Boolean
|
|
364
|
+
if([options valueForKey:@"showStatusMessages"] != nil)
|
|
365
|
+
customization.showStatusMessages = [[options valueForKey:@"showStatusMessages"] boolValue];
|
|
366
|
+
if([options valueForKey:@"showResultStatusMessages"] != nil)
|
|
367
|
+
customization.showResultStatusMessages = [[options valueForKey:@"showResultStatusMessages"] boolValue];
|
|
368
|
+
if([options valueForKey:@"showHelpAnimation"] != nil)
|
|
369
|
+
customization.showHelpAnimation = [[options valueForKey:@"showHelpAnimation"] boolValue];
|
|
370
|
+
if([options valueForKey:@"showNextPageAnimation"] != nil)
|
|
371
|
+
customization.showNextPageAnimation = [[options valueForKey:@"showNextPageAnimation"] boolValue];
|
|
372
|
+
if([options valueForKey:@"showBackgroundMask"] != nil)
|
|
373
|
+
customization.showBackgroundMask = [[options valueForKey:@"showBackgroundMask"] boolValue];
|
|
374
|
+
|
|
375
|
+
// Int
|
|
376
|
+
if([options valueForKey:@"cameraFrameBorderWidth"] != nil)
|
|
377
|
+
customization.cameraFrameBorderWidth = [[options valueForKey:@"cameraFrameBorderWidth"] floatValue];
|
|
378
|
+
if([options valueForKey:@"cameraFrameLineLength"] != nil)
|
|
379
|
+
customization.cameraFrameLineLength = [[options valueForKey:@"cameraFrameLineLength"] floatValue];
|
|
380
|
+
if([options valueForKey:@"cameraFrameShapeType"] != nil)
|
|
381
|
+
customization.cameraFrameShapeType = [[options valueForKey:@"cameraFrameShapeType"] integerValue];
|
|
382
|
+
if([options valueForKey:@"cameraFrameOffsetWidth"] != nil)
|
|
383
|
+
customization.cameraFrameOffsetWidth = [[options valueForKey:@"cameraFrameOffsetWidth"] floatValue];
|
|
384
|
+
|
|
385
|
+
// String
|
|
386
|
+
if([options valueForKey:@"status"] != nil)
|
|
387
|
+
customization.status = [options valueForKey:@"status"];
|
|
388
|
+
if([options valueForKey:@"resultStatus"] != nil)
|
|
389
|
+
customization.resultStatus = [options valueForKey:@"resultStatus"];
|
|
390
|
+
|
|
391
|
+
// Color
|
|
392
|
+
if([options valueForKey:@"cameraFrameDefaultColor"] != nil)
|
|
393
|
+
customization.cameraFrameDefaultColor = [self colorWithInt:[options valueForKey:@"cameraFrameDefaultColor"]];
|
|
394
|
+
if([options valueForKey:@"cameraFrameActiveColor"] != nil)
|
|
395
|
+
customization.cameraFrameActiveColor = [self colorWithInt:[options valueForKey:@"cameraFrameActiveColor"]];
|
|
396
|
+
if([options valueForKey:@"statusTextColor"] != nil)
|
|
397
|
+
customization.statusTextColor = [self colorWithInt:[options valueForKey:@"statusTextColor"]];
|
|
398
|
+
if([options valueForKey:@"resultStatusTextColor"] != nil)
|
|
399
|
+
customization.resultStatusTextColor = [self colorWithInt:[options valueForKey:@"resultStatusTextColor"]];
|
|
400
|
+
if([options valueForKey:@"resultStatusBackgroundColor"] != nil)
|
|
401
|
+
customization.resultStatusBackgroundColor = [self colorWithInt:[options valueForKey:@"resultStatusBackgroundColor"]];
|
|
402
|
+
if([options valueForKey:@"multipageButtonBackgroundColor"] != nil)
|
|
403
|
+
customization.multipageButtonBackgroundColor = [self colorWithInt:[options valueForKey:@"multipageButtonBackgroundColor"]];
|
|
404
|
+
if([options valueForKey:@"tintColor"] != nil)
|
|
405
|
+
customization.tintColor = [self colorWithInt:[options valueForKey:@"tintColor"]];
|
|
406
|
+
if([options valueForKey:@"activityIndicatorColor"] != nil)
|
|
407
|
+
customization.activityIndicatorColor = [self colorWithInt:[options valueForKey:@"activityIndicatorColor"]];
|
|
408
|
+
if([options valueForKey:@"statusBackgroundColor"] != nil)
|
|
409
|
+
customization.statusBackgroundColor = [self colorWithInt:[options valueForKey:@"statusBackgroundColor"]];
|
|
410
|
+
if([options valueForKey:@"cameraPreviewBackgroundColor"] != nil)
|
|
411
|
+
customization.cameraPreviewBackgroundColor = [self colorWithInt:[options valueForKey:@"cameraPreviewBackgroundColor"]];
|
|
412
|
+
|
|
413
|
+
// Float
|
|
414
|
+
if([options valueForKey:@"statusPositionMultiplier"] != nil)
|
|
415
|
+
customization.statusPositionMultiplier = [[options valueForKey:@"statusPositionMultiplier"] floatValue];
|
|
416
|
+
if([options valueForKey:@"resultStatusPositionMultiplier"] != nil)
|
|
417
|
+
customization.resultStatusPositionMultiplier = [[options valueForKey:@"resultStatusPositionMultiplier"] floatValue];
|
|
418
|
+
if([options valueForKey:@"toolbarSize"] != nil)
|
|
419
|
+
customization.toolbarSize = [[options valueForKey:@"toolbarSize"] floatValue];
|
|
420
|
+
if([options valueForKey:@"backgroundMaskAlpha"] != nil)
|
|
421
|
+
customization.backgroundMaskAlpha = [[options valueForKey:@"backgroundMaskAlpha"] floatValue];
|
|
422
|
+
if([options valueForKey:@"customStatusPositionMultiplier"] != nil)
|
|
423
|
+
customization.customStatusPositionMultiplier = [[options valueForKey:@"customStatusPositionMultiplier"] floatValue];
|
|
424
|
+
if([options valueForKey:@"cameraFrameVerticalPositionMultiplier"] != nil)
|
|
425
|
+
customization.cameraFrameVerticalPositionMultiplier = [[options valueForKey:@"cameraFrameVerticalPositionMultiplier"] floatValue];
|
|
426
|
+
if([options valueForKey:@"cameraFrameLandscapeAspectRatio"] != nil)
|
|
427
|
+
customization.cameraFrameLandscapeAspectRatio = [[options valueForKey:@"cameraFrameLandscapeAspectRatio"] floatValue];
|
|
428
|
+
if([options valueForKey:@"cameraFramePortraitAspectRatio"] != nil)
|
|
429
|
+
customization.cameraFramePortraitAspectRatio = [[options valueForKey:@"cameraFramePortraitAspectRatio"] floatValue];
|
|
430
|
+
if([options valueForKey:@"cameraFrameCornerRadius"] != nil)
|
|
431
|
+
customization.cameraFrameCornerRadius = [[options valueForKey:@"cameraFrameCornerRadius"] floatValue];
|
|
432
|
+
if([options valueForKey:@"livenessAnimationPositionMultiplier"] != nil)
|
|
433
|
+
customization.livenessAnimationPositionMultiplier = [[options valueForKey:@"livenessAnimationPositionMultiplier"] floatValue];
|
|
434
|
+
|
|
435
|
+
// Drawable
|
|
436
|
+
if([options valueForKey:@"multipageAnimationFrontImage"] != nil)
|
|
437
|
+
customization.multipageAnimationFrontImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"multipageAnimationFrontImage"]];
|
|
438
|
+
if([options valueForKey:@"multipageAnimationBackImage"] != nil)
|
|
439
|
+
customization.multipageAnimationBackImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"multipageAnimationBackImage"]];
|
|
440
|
+
if([options valueForKey:@"borderBackgroundImage"] != nil)
|
|
441
|
+
customization.borderBackgroundImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"borderBackgroundImage"]];
|
|
442
|
+
if([options valueForKey:@"helpAnimationImage"] != nil)
|
|
443
|
+
customization.helpAnimationImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"helpAnimationImage"]];
|
|
444
|
+
if([options valueForKey:@"closeButtonImage"] != nil)
|
|
445
|
+
customization.closeButtonImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"closeButtonImage"]];
|
|
446
|
+
if([options valueForKey:@"captureButtonImage"] != nil)
|
|
447
|
+
customization.captureButtonImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"captureButtonImage"]];
|
|
448
|
+
if([options valueForKey:@"changeFrameButtonCollapseImage"] != nil)
|
|
449
|
+
customization.changeFrameButtonCollapseImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"changeFrameButtonCollapseImage"]];
|
|
450
|
+
if([options valueForKey:@"changeFrameButtonExpandImage"] != nil)
|
|
451
|
+
customization.changeFrameButtonExpandImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"changeFrameButtonExpandImage"]];
|
|
452
|
+
if([options valueForKey:@"cameraSwitchButtonImage"] != nil)
|
|
453
|
+
customization.cameraSwitchButtonImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"cameraSwitchButtonImage"]];
|
|
454
|
+
if([options valueForKey:@"torchButtonOnImage"] != nil)
|
|
455
|
+
customization.torchButtonOnImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"torchButtonOnImage"]];
|
|
456
|
+
if([options valueForKey:@"torchButtonOffImage"] != nil)
|
|
457
|
+
customization.torchButtonOffImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"torchButtonOffImage"]];
|
|
458
|
+
if([options valueForKey:@"livenessAnimationImage"] != nil)
|
|
459
|
+
customization.livenessAnimationImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"livenessAnimationImage"]];
|
|
460
|
+
|
|
461
|
+
// Font
|
|
462
|
+
if([options valueForKey:@"statusTextFont"] != nil)
|
|
463
|
+
customization.statusTextFont = [self UIFontFromJSON:[options valueForKey:@"statusTextFont"]];
|
|
464
|
+
if([options valueForKey:@"resultStatusTextFont"] != nil)
|
|
465
|
+
customization.resultStatusTextFont = [self UIFontFromJSON:[options valueForKey:@"resultStatusTextFont"]];
|
|
466
|
+
|
|
467
|
+
// Custom
|
|
468
|
+
if([options valueForKey:@"customLabelStatus"] != nil)
|
|
469
|
+
customization.customLabelStatus = [[NSAttributedString alloc]initWithString:[options valueForKey:@"customLabelStatus"]];
|
|
470
|
+
if([options valueForKey:@"cameraFrameLineCap"] != nil)
|
|
471
|
+
customization.cameraFrameLineCap = [self lineCapWithNumber:[options valueForKey:@"cameraFrameLineCap"]];
|
|
472
|
+
if([options valueForKey:@"uiCustomizationLayer"] != nil)
|
|
473
|
+
customization.customUILayerJSON = [options valueForKey:@"uiCustomizationLayer"];
|
|
474
|
+
|
|
475
|
+
// ContentMode
|
|
476
|
+
if([options valueForKey:@"helpAnimationImageContentMode"] != nil)
|
|
477
|
+
customization.helpAnimationImageContentMode = [self viewContentModeWithNumber:[options valueForKey:@"helpAnimationImageContentMode"]];
|
|
478
|
+
if([options valueForKey:@"multipageAnimationFrontImageContentMode"] != nil)
|
|
479
|
+
customization.multipageAnimationFrontImageContentMode = [self viewContentModeWithNumber:[options valueForKey:@"multipageAnimationFrontImageContentMode"]];
|
|
480
|
+
if([options valueForKey:@"multipageAnimationBackImageContentMode"] != nil)
|
|
481
|
+
customization.multipageAnimationBackImageContentMode = [self viewContentModeWithNumber:[options valueForKey:@"multipageAnimationBackImageContentMode"]];
|
|
482
|
+
if([options valueForKey:@"livenessAnimationImageContentMode"] != nil)
|
|
483
|
+
customization.livenessAnimationImageContentMode = [self viewContentModeWithNumber:[options valueForKey:@"livenessAnimationImageContentMode"]];
|
|
484
|
+
if([options valueForKey:@"borderBackgroundImageContentMode"] != nil)
|
|
485
|
+
customization.borderBackgroundImageContentMode = [self viewContentModeWithNumber:[options valueForKey:@"borderBackgroundImageContentMode"]];
|
|
486
|
+
|
|
487
|
+
if([options valueForKey:@"colors"] != nil)
|
|
488
|
+
[self setColors:[customization.uiConfiguration valueForKey:@"colors"] input:[options valueForKey:@"colors"]];
|
|
489
|
+
if([options valueForKey:@"fonts"] != nil)
|
|
490
|
+
[self setFonts:[customization.uiConfiguration valueForKey:@"fonts"] input:[options valueForKey:@"fonts"]];
|
|
491
|
+
if([options valueForKey:@"images"] != nil)
|
|
492
|
+
[self setImages:[customization.uiConfiguration valueForKey:@"images"] input:[options valueForKey:@"images"]];
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
+(NSDictionary*)getCustomization:(RGLCustomization*)customization {
|
|
496
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
497
|
+
|
|
498
|
+
// Boolean
|
|
499
|
+
result[@"showStatusMessages"] = [NSNumber numberWithBool:customization.showStatusMessages];
|
|
500
|
+
result[@"showResultStatusMessages"] = [NSNumber numberWithBool:customization.showResultStatusMessages];
|
|
501
|
+
result[@"showHelpAnimation"] = [NSNumber numberWithBool:customization.showHelpAnimation];
|
|
502
|
+
result[@"showNextPageAnimation"] = [NSNumber numberWithBool:customization.showNextPageAnimation];
|
|
503
|
+
result[@"showBackgroundMask"] = [NSNumber numberWithBool:customization.showBackgroundMask];
|
|
504
|
+
|
|
505
|
+
// Int
|
|
506
|
+
result[@"cameraFrameBorderWidth"] = [NSNumber numberWithFloat:customization.cameraFrameBorderWidth];
|
|
507
|
+
result[@"cameraFrameLineLength"] = [NSNumber numberWithFloat:customization.cameraFrameLineLength];
|
|
508
|
+
result[@"cameraFrameShapeType"] = [NSNumber numberWithFloat:customization.cameraFrameShapeType];
|
|
509
|
+
result[@"cameraFrameOffsetWidth"] = [NSNumber numberWithFloat:customization.cameraFrameOffsetWidth];
|
|
510
|
+
|
|
511
|
+
// String
|
|
512
|
+
result[@"status"] = customization.status;
|
|
513
|
+
result[@"resultStatus"] = customization.resultStatus;
|
|
514
|
+
|
|
515
|
+
// Color
|
|
516
|
+
result[@"cameraFrameDefaultColor"] = [self intWithColor:customization.cameraFrameDefaultColor];
|
|
517
|
+
result[@"cameraFrameActiveColor"] = [self intWithColor:customization.cameraFrameActiveColor];
|
|
518
|
+
result[@"statusTextColor"] = [self intWithColor:customization.statusTextColor];
|
|
519
|
+
result[@"resultStatusTextColor"] = [self intWithColor:customization.resultStatusTextColor];
|
|
520
|
+
result[@"resultStatusBackgroundColor"] = [self intWithColor:customization.resultStatusBackgroundColor];
|
|
521
|
+
result[@"multipageButtonBackgroundColor"] = [self intWithColor:customization.multipageButtonBackgroundColor];
|
|
522
|
+
result[@"tintColor"] = [self intWithColor:customization.tintColor];
|
|
523
|
+
result[@"activityIndicatorColor"] = [self intWithColor:customization.activityIndicatorColor];
|
|
524
|
+
result[@"statusBackgroundColor"] = [self intWithColor:customization.statusBackgroundColor];
|
|
525
|
+
result[@"cameraPreviewBackgroundColor"] = [self intWithColor:customization.cameraPreviewBackgroundColor];
|
|
526
|
+
|
|
527
|
+
// Float
|
|
528
|
+
result[@"statusPositionMultiplier"] = [NSNumber numberWithFloat:customization.statusPositionMultiplier];
|
|
529
|
+
result[@"resultStatusPositionMultiplier"] = [NSNumber numberWithFloat:customization.resultStatusPositionMultiplier];
|
|
530
|
+
result[@"backgroundMaskAlpha"] = [NSNumber numberWithFloat:customization.backgroundMaskAlpha];
|
|
531
|
+
result[@"toolbarSize"] = [NSNumber numberWithFloat:customization.toolbarSize];
|
|
532
|
+
result[@"customStatusPositionMultiplier"] = [NSNumber numberWithFloat:customization.customStatusPositionMultiplier];
|
|
533
|
+
result[@"cameraFrameVerticalPositionMultiplier"] = [NSNumber numberWithFloat:customization.cameraFrameVerticalPositionMultiplier];
|
|
534
|
+
result[@"cameraFrameLandscapeAspectRatio"] = [NSNumber numberWithFloat:customization.cameraFrameLandscapeAspectRatio];
|
|
535
|
+
result[@"cameraFramePortraitAspectRatio"] = [NSNumber numberWithFloat:customization.cameraFramePortraitAspectRatio];
|
|
536
|
+
result[@"cameraFrameCornerRadius"] = [NSNumber numberWithFloat:customization.cameraFrameCornerRadius];
|
|
537
|
+
result[@"livenessAnimationPositionMultiplier"] = [NSNumber numberWithFloat:customization.livenessAnimationPositionMultiplier];
|
|
538
|
+
|
|
539
|
+
// Drawable
|
|
540
|
+
result[@"multipageAnimationFrontImage"] = [RGLWJSONConstructor base64WithImage:customization.multipageAnimationFrontImage];
|
|
541
|
+
result[@"multipageAnimationBackImage"] = [RGLWJSONConstructor base64WithImage:customization.multipageAnimationBackImage];
|
|
542
|
+
result[@"borderBackgroundImage"] = [RGLWJSONConstructor base64WithImage:customization.borderBackgroundImage];
|
|
543
|
+
result[@"helpAnimationImage"] = [RGLWJSONConstructor base64WithImage:customization.helpAnimationImage];
|
|
544
|
+
result[@"closeButtonImage"] = [RGLWJSONConstructor base64WithImage:customization.closeButtonImage];
|
|
545
|
+
result[@"captureButtonImage"] = [RGLWJSONConstructor base64WithImage:customization.captureButtonImage];
|
|
546
|
+
result[@"changeFrameButtonCollapseImage"] = [RGLWJSONConstructor base64WithImage:customization.changeFrameButtonCollapseImage];
|
|
547
|
+
result[@"changeFrameButtonExpandImage"] = [RGLWJSONConstructor base64WithImage:customization.changeFrameButtonExpandImage];
|
|
548
|
+
result[@"cameraSwitchButtonImage"] = [RGLWJSONConstructor base64WithImage:customization.cameraSwitchButtonImage];
|
|
549
|
+
result[@"torchButtonOnImage"] = [RGLWJSONConstructor base64WithImage:customization.torchButtonOnImage];
|
|
550
|
+
result[@"torchButtonOffImage"] = [RGLWJSONConstructor base64WithImage:customization.torchButtonOffImage];
|
|
551
|
+
result[@"livenessAnimationImage"] = [RGLWJSONConstructor base64WithImage:customization.livenessAnimationImage];
|
|
552
|
+
|
|
553
|
+
// Font
|
|
554
|
+
result[@"statusTextFont"] = [self generateUIFont:customization.statusTextFont];
|
|
555
|
+
result[@"resultStatusTextFont"] = [self generateUIFont:customization.resultStatusTextFont];
|
|
556
|
+
|
|
557
|
+
// Custom
|
|
558
|
+
if(customization.customLabelStatus != nil) result[@"customLabelStatus"] = customization.customLabelStatus.string;
|
|
559
|
+
result[@"cameraFrameLineCap"] = [self generateLineCap:customization.cameraFrameLineCap];
|
|
560
|
+
result[@"uiCustomizationLayer"] = customization.customUILayerJSON;
|
|
561
|
+
|
|
562
|
+
// ContentMode
|
|
563
|
+
result[@"helpAnimationImageContentMode"] = [self generateViewContentMode:customization.helpAnimationImageContentMode];
|
|
564
|
+
result[@"multipageAnimationFrontImageContentMode"] = [self generateViewContentMode:customization.multipageAnimationFrontImageContentMode];
|
|
565
|
+
result[@"multipageAnimationBackImageContentMode"] = [self generateViewContentMode:customization.multipageAnimationBackImageContentMode];
|
|
566
|
+
result[@"livenessAnimationImageContentMode"] = [self generateViewContentMode:customization.livenessAnimationImageContentMode];
|
|
567
|
+
result[@"borderBackgroundImageContentMode"] = [self generateViewContentMode:customization.borderBackgroundImageContentMode];
|
|
568
|
+
|
|
569
|
+
result[@"colors"] = [self getColors: [customization.uiConfiguration valueForKey:@"colors"]];
|
|
570
|
+
result[@"fonts"] = [self getFonts: [customization.uiConfiguration valueForKey:@"fonts"]];
|
|
571
|
+
result[@"images"] = [self getImages: [customization.uiConfiguration valueForKey:@"images"]];
|
|
572
|
+
|
|
573
|
+
return result;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
+(void)setRfidScenario:(NSDictionary*)options :(RGLRFIDScenario*)rfidScenario {
|
|
577
|
+
// Boolean
|
|
578
|
+
if([options valueForKey:@"paceStaticBinding"] != nil)
|
|
579
|
+
rfidScenario.paceStaticBinding = [[options valueForKey:@"paceStaticBinding"] boolValue];
|
|
580
|
+
if([options valueForKey:@"onlineTA"] != nil)
|
|
581
|
+
rfidScenario.onlineTA = [[options valueForKey:@"onlineTA"] boolValue];
|
|
582
|
+
if([options valueForKey:@"writeEid"] != nil)
|
|
583
|
+
rfidScenario.writeEid = [[options valueForKey:@"writeEid"] boolValue];
|
|
584
|
+
if([options valueForKey:@"universalAccessRights"] != nil)
|
|
585
|
+
rfidScenario.universalAccessRights = [[options valueForKey:@"universalAccessRights"] boolValue];
|
|
586
|
+
if([options valueForKey:@"authorizedRestrictedIdentification"] != nil)
|
|
587
|
+
rfidScenario.authorizedRestrictedIdentification = [[options valueForKey:@"authorizedRestrictedIdentification"] boolValue];
|
|
588
|
+
if([options valueForKey:@"auxVerificationCommunityID"] != nil)
|
|
589
|
+
rfidScenario.auxVerificationCommunityID = [[options valueForKey:@"auxVerificationCommunityID"] boolValue];
|
|
590
|
+
if([options valueForKey:@"auxVerificationDateOfBirth"] != nil)
|
|
591
|
+
rfidScenario.auxVerificationDateOfBirth = [[options valueForKey:@"auxVerificationDateOfBirth"] boolValue];
|
|
592
|
+
if([options valueForKey:@"skipAA"] != nil)
|
|
593
|
+
rfidScenario.skipAA = [[options valueForKey:@"skipAA"] boolValue];
|
|
594
|
+
if([options valueForKey:@"strictProcessing"] != nil)
|
|
595
|
+
rfidScenario.strictProcessing = [[options valueForKey:@"strictProcessing"] boolValue];
|
|
596
|
+
if([options valueForKey:@"pkdDSCertPriority"] != nil)
|
|
597
|
+
rfidScenario.pkdDSCertPriority = [[options valueForKey:@"pkdDSCertPriority"] boolValue];
|
|
598
|
+
if([options valueForKey:@"pkdUseExternalCSCA"] != nil)
|
|
599
|
+
rfidScenario.pkdUseExternalCSCA = [[options valueForKey:@"pkdUseExternalCSCA"] boolValue];
|
|
600
|
+
if([options valueForKey:@"trustedPKD"] != nil)
|
|
601
|
+
rfidScenario.trustedPKD = [[options valueForKey:@"trustedPKD"] boolValue];
|
|
602
|
+
if([options valueForKey:@"passiveAuth"] != nil)
|
|
603
|
+
rfidScenario.passiveAuth = [[options valueForKey:@"passiveAuth"] boolValue];
|
|
604
|
+
if([options valueForKey:@"useSFI"] != nil)
|
|
605
|
+
rfidScenario.useSFI = [[options valueForKey:@"useSFI"] boolValue];
|
|
606
|
+
if([options valueForKey:@"readEPassport"] != nil)
|
|
607
|
+
rfidScenario.readEPassport = [[options valueForKey:@"readEPassport"] boolValue];
|
|
608
|
+
if([options valueForKey:@"readEID"] != nil)
|
|
609
|
+
rfidScenario.readEID = [[options valueForKey:@"readEID"] boolValue];
|
|
610
|
+
if([options valueForKey:@"readEDL"] != nil)
|
|
611
|
+
rfidScenario.readEDL = [[options valueForKey:@"readEDL"] boolValue];
|
|
612
|
+
if([options valueForKey:@"authorizedSTSignature"] != nil)
|
|
613
|
+
rfidScenario.authorizedSTSignature = [[options valueForKey:@"authorizedSTSignature"] boolValue];
|
|
614
|
+
if([options valueForKey:@"authorizedSTQSignature"] != nil)
|
|
615
|
+
rfidScenario.authorizedSTQSignature = [[options valueForKey:@"authorizedSTQSignature"] boolValue];
|
|
616
|
+
if([options valueForKey:@"authorizedWriteDG17"] != nil)
|
|
617
|
+
rfidScenario.authorizedWriteDG17 = [[options valueForKey:@"authorizedWriteDG17"] boolValue];
|
|
618
|
+
if([options valueForKey:@"authorizedWriteDG18"] != nil)
|
|
619
|
+
rfidScenario.authorizedWriteDG18 = [[options valueForKey:@"authorizedWriteDG18"] boolValue];
|
|
620
|
+
if([options valueForKey:@"authorizedWriteDG19"] != nil)
|
|
621
|
+
rfidScenario.authorizedWriteDG19 = [[options valueForKey:@"authorizedWriteDG19"] boolValue];
|
|
622
|
+
if([options valueForKey:@"authorizedWriteDG20"] != nil)
|
|
623
|
+
rfidScenario.authorizedWriteDG20 = [[options valueForKey:@"authorizedWriteDG20"] boolValue];
|
|
624
|
+
if([options valueForKey:@"authorizedWriteDG21"] != nil)
|
|
625
|
+
rfidScenario.authorizedWriteDG21 = [[options valueForKey:@"authorizedWriteDG21"] boolValue];
|
|
626
|
+
if([options valueForKey:@"authorizedVerifyAge"] != nil)
|
|
627
|
+
rfidScenario.authorizedVerifyAge = [[options valueForKey:@"authorizedVerifyAge"] boolValue];
|
|
628
|
+
if([options valueForKey:@"authorizedVerifyCommunityID"] != nil)
|
|
629
|
+
rfidScenario.authorizedVerifyCommunityID = [[options valueForKey:@"authorizedVerifyCommunityID"] boolValue];
|
|
630
|
+
if([options valueForKey:@"authorizedPrivilegedTerminal"] != nil)
|
|
631
|
+
rfidScenario.authorizedPrivilegedTerminal = [[options valueForKey:@"authorizedPrivilegedTerminal"] boolValue];
|
|
632
|
+
if([options valueForKey:@"authorizedCANAllowed"] != nil)
|
|
633
|
+
rfidScenario.authorizedCANAllowed = [[options valueForKey:@"authorizedCANAllowed"] boolValue];
|
|
634
|
+
if([options valueForKey:@"authorizedPINManagement"] != nil)
|
|
635
|
+
rfidScenario.authorizedPINManagment = [[options valueForKey:@"authorizedPINManagement"] boolValue];
|
|
636
|
+
if([options valueForKey:@"authorizedInstallCert"] != nil)
|
|
637
|
+
rfidScenario.authorizedInstallCert = [[options valueForKey:@"authorizedInstallCert"] boolValue];
|
|
638
|
+
if([options valueForKey:@"authorizedInstallQCert"] != nil)
|
|
639
|
+
rfidScenario.authorizedInstallQCert = [[options valueForKey:@"authorizedInstallQCert"] boolValue];
|
|
640
|
+
if([options valueForKey:@"applyAmendments"] != nil)
|
|
641
|
+
rfidScenario.applyAmendments = [[options valueForKey:@"applyAmendments"] boolValue];
|
|
642
|
+
if([options valueForKey:@"autoSettings"] != nil)
|
|
643
|
+
rfidScenario.autoSettings = [[options valueForKey:@"autoSettings"] boolValue];
|
|
644
|
+
if([options valueForKey:@"proceedReadingAlways"] != nil)
|
|
645
|
+
rfidScenario.proceedReadingAlways = [[options valueForKey:@"proceedReadingAlways"] boolValue];
|
|
646
|
+
|
|
647
|
+
// Int
|
|
648
|
+
if([options valueForKey:@"signManagementAction"] != nil)
|
|
649
|
+
rfidScenario.signManagementAction = [[options valueForKey:@"signManagementAction"] integerValue];
|
|
650
|
+
if([options valueForKey:@"readingBuffer"] != nil)
|
|
651
|
+
rfidScenario.readingBuffer = [[options valueForKey:@"readingBuffer"] intValue];
|
|
652
|
+
if([options valueForKey:@"onlineTAToSignDataType"] != nil)
|
|
653
|
+
rfidScenario.onlineTAToSignDataType = [[options valueForKey:@"onlineTAToSignDataType"] intValue];
|
|
654
|
+
if([options valueForKey:@"profilerType"] != nil)
|
|
655
|
+
rfidScenario.profilerType = [[options valueForKey:@"profilerType"] intValue];
|
|
656
|
+
if([options valueForKey:@"authProcType"] != nil)
|
|
657
|
+
rfidScenario.authProcType = [[options valueForKey:@"authProcType"] integerValue];
|
|
658
|
+
if([options valueForKey:@"baseSMProcedure"] != nil)
|
|
659
|
+
rfidScenario.baseSMProcedure = [[options valueForKey:@"baseSMProcedure"] integerValue];
|
|
660
|
+
if([options valueForKey:@"pacePasswordType"] != nil)
|
|
661
|
+
rfidScenario.pacePasswordType = [[options valueForKey:@"pacePasswordType"] integerValue];
|
|
662
|
+
if([options valueForKey:@"terminalType"] != nil)
|
|
663
|
+
rfidScenario.terminalType = [[options valueForKey:@"terminalType"] integerValue];
|
|
664
|
+
if([options valueForKey:@"defaultReadingBufferSize"] != nil)
|
|
665
|
+
rfidScenario.defaultReadingBufferSize = [[options valueForKey:@"defaultReadingBufferSize"] intValue];
|
|
666
|
+
|
|
667
|
+
// String
|
|
668
|
+
if([options valueForKey:@"password"] != nil)
|
|
669
|
+
rfidScenario.password = [options valueForKey:@"password"];
|
|
670
|
+
if([options valueForKey:@"pkdPA"] != nil)
|
|
671
|
+
rfidScenario.pkdPA = [options valueForKey:@"pkdPA"];
|
|
672
|
+
if([options valueForKey:@"pkdEAC"] != nil)
|
|
673
|
+
rfidScenario.pkdEAC = [options valueForKey:@"pkdEAC"];
|
|
674
|
+
if([options valueForKey:@"mrz"] != nil)
|
|
675
|
+
rfidScenario.mrz = [options valueForKey:@"mrz"];
|
|
676
|
+
if([options valueForKey:@"eSignPINDefault"] != nil)
|
|
677
|
+
rfidScenario.eSignPINDefault = [options valueForKey:@"eSignPINDefault"];
|
|
678
|
+
if([options valueForKey:@"eSignPINNewValue"] != nil)
|
|
679
|
+
rfidScenario.eSignPINNewValue = [options valueForKey:@"eSignPINNewValue"];
|
|
680
|
+
|
|
681
|
+
// DataGroup
|
|
682
|
+
if([options valueForKey:@"ePassportDataGroups"] != nil)
|
|
683
|
+
[self setDataGroups :rfidScenario.ePassportDataGroups dict:[options valueForKey:@"ePassportDataGroups"]];
|
|
684
|
+
if([options valueForKey:@"eIDDataGroups"] != nil)
|
|
685
|
+
[self setDataGroups :rfidScenario.eIDDataGroups dict:[options valueForKey:@"eIDDataGroups"]];
|
|
686
|
+
if([options valueForKey:@"eDLDataGroups"] != nil)
|
|
687
|
+
[self setDataGroups :rfidScenario.eDLDataGroups dict:[options valueForKey:@"eDLDataGroups"]];
|
|
688
|
+
}
|
|
689
|
+
|
|
690
|
+
+(NSDictionary*)getRfidScenario:(RGLRFIDScenario*)rfidScenario {
|
|
691
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
692
|
+
|
|
693
|
+
// Boolean
|
|
694
|
+
result[@"paceStaticBinding"] = [NSNumber numberWithBool:rfidScenario.paceStaticBinding];
|
|
695
|
+
result[@"onlineTA"] = [NSNumber numberWithBool:rfidScenario.onlineTA];
|
|
696
|
+
result[@"writeEid"] = [NSNumber numberWithBool:rfidScenario.writeEid];
|
|
697
|
+
result[@"universalAccessRights"] = [NSNumber numberWithBool:rfidScenario.universalAccessRights];
|
|
698
|
+
result[@"authorizedRestrictedIdentification"] = [NSNumber numberWithBool:rfidScenario.authorizedRestrictedIdentification];
|
|
699
|
+
result[@"auxVerificationCommunityID"] = [NSNumber numberWithBool:rfidScenario.auxVerificationCommunityID];
|
|
700
|
+
result[@"auxVerificationDateOfBirth"] = [NSNumber numberWithBool:rfidScenario.auxVerificationDateOfBirth];
|
|
701
|
+
result[@"skipAA"] = [NSNumber numberWithBool:rfidScenario.skipAA];
|
|
702
|
+
result[@"strictProcessing"] = [NSNumber numberWithBool:rfidScenario.strictProcessing];
|
|
703
|
+
result[@"pkdDSCertPriority"] = [NSNumber numberWithBool:rfidScenario.pkdDSCertPriority];
|
|
704
|
+
result[@"pkdUseExternalCSCA"] = [NSNumber numberWithBool:rfidScenario.pkdUseExternalCSCA];
|
|
705
|
+
result[@"trustedPKD"] = [NSNumber numberWithBool:rfidScenario.trustedPKD];
|
|
706
|
+
result[@"passiveAuth"] = [NSNumber numberWithBool:rfidScenario.passiveAuth];
|
|
707
|
+
result[@"useSFI"] = [NSNumber numberWithBool:rfidScenario.useSFI];
|
|
708
|
+
result[@"readEPassport"] = [NSNumber numberWithBool:rfidScenario.readEPassport];
|
|
709
|
+
result[@"readEID"] = [NSNumber numberWithBool:rfidScenario.readEID];
|
|
710
|
+
result[@"readEDL"] = [NSNumber numberWithBool:rfidScenario.readEDL];
|
|
711
|
+
result[@"authorizedSTSignature"] = [NSNumber numberWithBool:rfidScenario.authorizedSTSignature];
|
|
712
|
+
result[@"authorizedSTQSignature"] = [NSNumber numberWithBool:rfidScenario.authorizedSTQSignature];
|
|
713
|
+
result[@"authorizedWriteDG17"] = [NSNumber numberWithBool:rfidScenario.authorizedWriteDG17];
|
|
714
|
+
result[@"authorizedWriteDG18"] = [NSNumber numberWithBool:rfidScenario.authorizedWriteDG18];
|
|
715
|
+
result[@"authorizedWriteDG19"] = [NSNumber numberWithBool:rfidScenario.authorizedWriteDG19];
|
|
716
|
+
result[@"authorizedWriteDG20"] = [NSNumber numberWithBool:rfidScenario.authorizedWriteDG20];
|
|
717
|
+
result[@"authorizedWriteDG21"] = [NSNumber numberWithBool:rfidScenario.authorizedWriteDG21];
|
|
718
|
+
result[@"authorizedVerifyAge"] = [NSNumber numberWithBool:rfidScenario.authorizedVerifyAge];
|
|
719
|
+
result[@"authorizedVerifyCommunityID"] = [NSNumber numberWithBool:rfidScenario.authorizedVerifyCommunityID];
|
|
720
|
+
result[@"authorizedPrivilegedTerminal"] = [NSNumber numberWithBool:rfidScenario.authorizedPrivilegedTerminal];
|
|
721
|
+
result[@"authorizedCANAllowed"] = [NSNumber numberWithBool:rfidScenario.authorizedCANAllowed];
|
|
722
|
+
result[@"authorizedPINManagement"] = [NSNumber numberWithBool:rfidScenario.authorizedPINManagment];
|
|
723
|
+
result[@"authorizedInstallCert"] = [NSNumber numberWithBool:rfidScenario.authorizedInstallCert];
|
|
724
|
+
result[@"authorizedInstallQCert"] = [NSNumber numberWithBool:rfidScenario.authorizedInstallQCert];
|
|
725
|
+
result[@"applyAmendments"] = [NSNumber numberWithBool:rfidScenario.applyAmendments];
|
|
726
|
+
result[@"autoSettings"] = [NSNumber numberWithBool:rfidScenario.autoSettings];
|
|
727
|
+
result[@"proceedReadingAlways"] = [NSNumber numberWithBool:rfidScenario.proceedReadingAlways];
|
|
728
|
+
|
|
729
|
+
// Int
|
|
730
|
+
result[@"signManagementAction"] = [NSNumber numberWithInteger:rfidScenario.signManagementAction];
|
|
731
|
+
result[@"readingBuffer"] = [NSNumber numberWithInteger:rfidScenario.readingBuffer];
|
|
732
|
+
result[@"onlineTAToSignDataType"] = [NSNumber numberWithInteger:rfidScenario.onlineTAToSignDataType];
|
|
733
|
+
result[@"profilerType"] = [NSNumber numberWithInteger:rfidScenario.profilerType];
|
|
734
|
+
result[@"authProcType"] = [NSNumber numberWithInteger:rfidScenario.authProcType];
|
|
735
|
+
result[@"baseSMProcedure"] = [NSNumber numberWithInteger:rfidScenario.baseSMProcedure];
|
|
736
|
+
result[@"pacePasswordType"] = [NSNumber numberWithInteger:rfidScenario.pacePasswordType];
|
|
737
|
+
result[@"terminalType"] = [NSNumber numberWithInteger:rfidScenario.terminalType];
|
|
738
|
+
result[@"defaultReadingBufferSize"] = [NSNumber numberWithInteger:rfidScenario.defaultReadingBufferSize];
|
|
739
|
+
|
|
740
|
+
// String
|
|
741
|
+
result[@"password"] = rfidScenario.password;
|
|
742
|
+
result[@"pkdPA"] = rfidScenario.pkdPA;
|
|
743
|
+
result[@"pkdEAC"] = rfidScenario.pkdEAC;
|
|
744
|
+
result[@"mrz"] = rfidScenario.mrz;
|
|
745
|
+
result[@"eSignPINDefault"] = rfidScenario.eSignPINDefault;
|
|
746
|
+
result[@"eSignPINNewValue"] = rfidScenario.eSignPINNewValue;
|
|
747
|
+
|
|
748
|
+
// DataGroup
|
|
749
|
+
result[@"eDLDataGroups"] = [self getDataGroups:rfidScenario.eDLDataGroups];
|
|
750
|
+
result[@"ePassportDataGroups"] = [self getDataGroups:rfidScenario.ePassportDataGroups];
|
|
751
|
+
result[@"eIDDataGroups"] = [self getDataGroups:rfidScenario.eIDDataGroups];
|
|
752
|
+
|
|
753
|
+
return result;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
+(void)setDataGroups:(RGLDataGroup*)dataGroup dict:(NSDictionary*)dict {
|
|
757
|
+
|
|
758
|
+
// EDLDataGroups/Common: 1-14
|
|
759
|
+
if([dict valueForKey:@"DG1"] != nil)
|
|
760
|
+
dataGroup.dG1 = [[dict valueForKey:@"DG1"] boolValue];
|
|
761
|
+
if([dict valueForKey:@"DG2"] != nil)
|
|
762
|
+
dataGroup.dG2 = [[dict valueForKey:@"DG2"] boolValue];
|
|
763
|
+
if([dict valueForKey:@"DG3"] != nil)
|
|
764
|
+
dataGroup.dG3 = [[dict valueForKey:@"DG3"] boolValue];
|
|
765
|
+
if([dict valueForKey:@"DG4"] != nil)
|
|
766
|
+
dataGroup.dG4 = [[dict valueForKey:@"DG4"] boolValue];
|
|
767
|
+
if([dict valueForKey:@"DG5"] != nil)
|
|
768
|
+
dataGroup.dG5 = [[dict valueForKey:@"DG5"] boolValue];
|
|
769
|
+
if([dict valueForKey:@"DG6"] != nil)
|
|
770
|
+
dataGroup.dG6 = [[dict valueForKey:@"DG6"] boolValue];
|
|
771
|
+
if([dict valueForKey:@"DG7"] != nil)
|
|
772
|
+
dataGroup.dG7 = [[dict valueForKey:@"DG7"] boolValue];
|
|
773
|
+
if([dict valueForKey:@"DG8"] != nil)
|
|
774
|
+
dataGroup.dG8 = [[dict valueForKey:@"DG8"] boolValue];
|
|
775
|
+
if([dict valueForKey:@"DG9"] != nil)
|
|
776
|
+
dataGroup.dG9 = [[dict valueForKey:@"DG9"] boolValue];
|
|
777
|
+
if([dict valueForKey:@"DG10"] != nil)
|
|
778
|
+
dataGroup.dG10 = [[dict valueForKey:@"DG10"] boolValue];
|
|
779
|
+
if([dict valueForKey:@"DG11"] != nil)
|
|
780
|
+
dataGroup.dG11 = [[dict valueForKey:@"DG11"] boolValue];
|
|
781
|
+
if([dict valueForKey:@"DG12"] != nil)
|
|
782
|
+
dataGroup.dG12 = [[dict valueForKey:@"DG12"] boolValue];
|
|
783
|
+
if([dict valueForKey:@"DG13"] != nil)
|
|
784
|
+
dataGroup.dG13 = [[dict valueForKey:@"DG13"] boolValue];
|
|
785
|
+
if([dict valueForKey:@"DG14"] != nil)
|
|
786
|
+
dataGroup.dG14 = [[dict valueForKey:@"DG14"] boolValue];
|
|
787
|
+
|
|
788
|
+
// EPassportDataGroups: 1-16
|
|
789
|
+
if ([dataGroup class] == [RGLePassportDataGroup class]) {
|
|
790
|
+
if([dict valueForKey:@"DG15"] != nil)
|
|
791
|
+
((RGLePassportDataGroup*)dataGroup).dG15 = [[dict valueForKey:@"DG15"] boolValue];
|
|
792
|
+
if([dict valueForKey:@"DG16"] != nil)
|
|
793
|
+
((RGLePassportDataGroup*)dataGroup).dG16 = [[dict valueForKey:@"DG16"] boolValue];
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
// EIDDataGroups: 1-21
|
|
797
|
+
if ([dataGroup class] == [RGLeIDDataGroup class]) {
|
|
798
|
+
if([dict valueForKey:@"DG15"] != nil)
|
|
799
|
+
((RGLeIDDataGroup*)dataGroup).dG15 = [[dict valueForKey:@"DG15"] boolValue];
|
|
800
|
+
if([dict valueForKey:@"DG16"] != nil)
|
|
801
|
+
((RGLeIDDataGroup*)dataGroup).dG16 = [[dict valueForKey:@"DG16"] boolValue];
|
|
802
|
+
if([dict valueForKey:@"DG17"] != nil)
|
|
803
|
+
((RGLeIDDataGroup*)dataGroup).dG17 = [[dict valueForKey:@"DG17"] boolValue];
|
|
804
|
+
if([dict valueForKey:@"DG18"] != nil)
|
|
805
|
+
((RGLeIDDataGroup*)dataGroup).dG18 = [[dict valueForKey:@"DG18"] boolValue];
|
|
806
|
+
if([dict valueForKey:@"DG19"] != nil)
|
|
807
|
+
((RGLeIDDataGroup*)dataGroup).dG19 = [[dict valueForKey:@"DG19"] boolValue];
|
|
808
|
+
if([dict valueForKey:@"DG20"] != nil)
|
|
809
|
+
((RGLeIDDataGroup*)dataGroup).dG20 = [[dict valueForKey:@"DG20"] boolValue];
|
|
810
|
+
if([dict valueForKey:@"DG21"] != nil)
|
|
811
|
+
((RGLeIDDataGroup*)dataGroup).dG21 = [[dict valueForKey:@"DG21"] boolValue];
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
|
|
815
|
+
+(NSDictionary *)getDataGroups:(RGLDataGroup*)dataGroup {
|
|
816
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
817
|
+
|
|
818
|
+
// EDLDataGroups/Common: 1-14
|
|
819
|
+
result[@"DG1"] = [NSNumber numberWithBool:dataGroup.dG1];
|
|
820
|
+
result[@"DG2"] = [NSNumber numberWithBool:dataGroup.dG2];
|
|
821
|
+
result[@"DG3"] = [NSNumber numberWithBool:dataGroup.dG3];
|
|
822
|
+
result[@"DG4"] = [NSNumber numberWithBool:dataGroup.dG4];
|
|
823
|
+
result[@"DG5"] = [NSNumber numberWithBool:dataGroup.dG5];
|
|
824
|
+
result[@"DG6"] = [NSNumber numberWithBool:dataGroup.dG6];
|
|
825
|
+
result[@"DG7"] = [NSNumber numberWithBool:dataGroup.dG7];
|
|
826
|
+
result[@"DG8"] = [NSNumber numberWithBool:dataGroup.dG8];
|
|
827
|
+
result[@"DG9"] = [NSNumber numberWithBool:dataGroup.dG9];
|
|
828
|
+
result[@"DG10"] = [NSNumber numberWithBool:dataGroup.dG10];
|
|
829
|
+
result[@"DG11"] = [NSNumber numberWithBool:dataGroup.dG11];
|
|
830
|
+
result[@"DG12"] = [NSNumber numberWithBool:dataGroup.dG12];
|
|
831
|
+
result[@"DG13"] = [NSNumber numberWithBool:dataGroup.dG13];
|
|
832
|
+
result[@"DG14"] = [NSNumber numberWithBool:dataGroup.dG14];
|
|
833
|
+
|
|
834
|
+
// EPassportDataGroups: 1-16
|
|
835
|
+
if ([dataGroup class] == [RGLePassportDataGroup class]) {
|
|
836
|
+
result[@"DG15"] = [NSNumber numberWithBool:((RGLePassportDataGroup*)dataGroup).dG15];
|
|
837
|
+
result[@"DG16"] = [NSNumber numberWithBool:((RGLePassportDataGroup*)dataGroup).dG16];
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
// EIDDataGroups: 1-21
|
|
841
|
+
if ([dataGroup class] == [RGLeIDDataGroup class]) {
|
|
842
|
+
result[@"DG15"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG15];
|
|
843
|
+
result[@"DG16"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG16];
|
|
844
|
+
result[@"DG17"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG17];
|
|
845
|
+
result[@"DG18"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG18];
|
|
846
|
+
result[@"DG19"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG19];
|
|
847
|
+
result[@"DG20"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG20];
|
|
848
|
+
result[@"DG21"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG21];
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
return result;
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
+(void)setImageQA:(RGLImageQA*)result input:(NSDictionary*)input {
|
|
855
|
+
if([input valueForKey:@"dpiThreshold"] != nil)
|
|
856
|
+
result.dpiThreshold = [input valueForKey:@"dpiThreshold"];
|
|
857
|
+
if([input valueForKey:@"angleThreshold"] != nil)
|
|
858
|
+
result.angleThreshold = [input valueForKey:@"angleThreshold"];
|
|
859
|
+
if([input valueForKey:@"focusCheck"] != nil)
|
|
860
|
+
result.focusCheck = [input valueForKey:@"focusCheck"];
|
|
861
|
+
if([input valueForKey:@"glaresCheck"] != nil)
|
|
862
|
+
result.glaresCheck = [input valueForKey:@"glaresCheck"];
|
|
863
|
+
if([input valueForKey:@"colornessCheck"] != nil)
|
|
864
|
+
result.colornessCheck = [input valueForKey:@"colornessCheck"];
|
|
865
|
+
if([input valueForKey:@"screenCapture"] != nil)
|
|
866
|
+
result.screenCapture = [input valueForKey:@"screenCapture"];
|
|
867
|
+
if (input[@"expectedPass"]) {
|
|
868
|
+
NSMutableArray<RGLImageQualityCheckType>* expectedPass = @[].mutableCopy;
|
|
869
|
+
for(NSNumber* item in input[@"expectedPass"]) [expectedPass addObject:[self imageQualityCheckTypeWithNumber:item]];
|
|
870
|
+
result.expectedPass = expectedPass;
|
|
871
|
+
}
|
|
872
|
+
if([input valueForKey:@"documentPositionIndent"] != nil)
|
|
873
|
+
result.documentPositionIndent = [input valueForKey:@"documentPositionIndent"];
|
|
874
|
+
if([input valueForKey:@"glaresCheckParams"] != nil)
|
|
875
|
+
result.glaresCheckParams = [RGLWJSONConstructor glaresCheckParamsFromJson:[input valueForKey:@"glaresCheckParams"]];
|
|
876
|
+
if([input valueForKey:@"brightnessThreshold"] != nil)
|
|
877
|
+
result.brightnessThreshold = [input valueForKey:@"brightnessThreshold"];
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
+(NSDictionary*)getImageQA:(RGLImageQA*)input {
|
|
881
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
882
|
+
|
|
883
|
+
result[@"dpiThreshold"] = input.dpiThreshold;
|
|
884
|
+
result[@"angleThreshold"] = input.angleThreshold;
|
|
885
|
+
result[@"focusCheck"] = input.focusCheck;
|
|
886
|
+
result[@"glaresCheck"] = input.glaresCheck;
|
|
887
|
+
result[@"colornessCheck"] = input.colornessCheck;
|
|
888
|
+
result[@"screenCapture"] = input.screenCapture;
|
|
889
|
+
if (input.expectedPass) {
|
|
890
|
+
NSMutableArray<NSNumber*>* expectedPass = @[].mutableCopy;
|
|
891
|
+
for(RGLImageQualityCheckType item in input.expectedPass) [expectedPass addObject:[self generateImageQualityCheckType:item]];
|
|
892
|
+
result[@"expectedPass"] = expectedPass;
|
|
893
|
+
}
|
|
894
|
+
result[@"documentPositionIndent"] = input.documentPositionIndent;
|
|
895
|
+
result[@"glaresCheckParams"] = [RGLWJSONConstructor generateGlaresCheckParams:input.glaresCheckParams];
|
|
896
|
+
result[@"brightnessThreshold"] = input.brightnessThreshold;
|
|
897
|
+
|
|
898
|
+
return result;
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
+(void)setAuthenticityParams:(RGLAuthenticityParams*)result input:(NSDictionary*)input {
|
|
902
|
+
if([input valueForKey:@"useLivenessCheck"] != nil)
|
|
903
|
+
result.useLivenessCheck = [input valueForKey:@"useLivenessCheck"];
|
|
904
|
+
if([input valueForKey:@"livenessParams"] != nil) {
|
|
905
|
+
if(result.livenessParams == nil) result.livenessParams = [RGLLivenessParams defaultParams];
|
|
906
|
+
[self setLivenessParams:result.livenessParams input:[input valueForKey:@"livenessParams"]];
|
|
907
|
+
}
|
|
908
|
+
if([input valueForKey:@"checkUVLuminiscence"] != nil)
|
|
909
|
+
result.checkUVLuminiscence = [input valueForKey:@"checkUVLuminiscence"];
|
|
910
|
+
if([input valueForKey:@"checkIRB900"] != nil)
|
|
911
|
+
result.checkIRB900 = [input valueForKey:@"checkIRB900"];
|
|
912
|
+
if([input valueForKey:@"checkImagePatterns"] != nil)
|
|
913
|
+
result.checkImagePatterns = [input valueForKey:@"checkImagePatterns"];
|
|
914
|
+
if([input valueForKey:@"checkFibers"] != nil)
|
|
915
|
+
result.checkFibers = [input valueForKey:@"checkFibers"];
|
|
916
|
+
if([input valueForKey:@"checkExtMRZ"] != nil)
|
|
917
|
+
result.checkExtMRZ = [input valueForKey:@"checkExtMRZ"];
|
|
918
|
+
if([input valueForKey:@"checkExtOCR"] != nil)
|
|
919
|
+
result.checkExtOCR = [input valueForKey:@"checkExtOCR"];
|
|
920
|
+
if([input valueForKey:@"checkAxial"] != nil)
|
|
921
|
+
result.checkAxial = [input valueForKey:@"checkAxial"];
|
|
922
|
+
if([input valueForKey:@"checkBarcodeFormat"] != nil)
|
|
923
|
+
result.checkBarcodeFormat = [input valueForKey:@"checkBarcodeFormat"];
|
|
924
|
+
if([input valueForKey:@"checkIRVisibility"] != nil)
|
|
925
|
+
result.checkIRVisibility = [input valueForKey:@"checkIRVisibility"];
|
|
926
|
+
if([input valueForKey:@"checkIPI"] != nil)
|
|
927
|
+
result.checkIPI = [input valueForKey:@"checkIPI"];
|
|
928
|
+
if([input valueForKey:@"checkPhotoEmbedding"] != nil)
|
|
929
|
+
result.checkPhotoEmbedding = [input valueForKey:@"checkPhotoEmbedding"];
|
|
930
|
+
if([input valueForKey:@"checkPhotoComparison"] != nil)
|
|
931
|
+
result.checkPhotoComparison = [input valueForKey:@"checkPhotoComparison"];
|
|
932
|
+
if([input valueForKey:@"checkLetterScreen"] != nil)
|
|
933
|
+
result.checkLetterScreen = [input valueForKey:@"checkLetterScreen"];
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
+(NSDictionary*)getAuthenticityParams:(RGLAuthenticityParams*)input {
|
|
937
|
+
if(input == nil) return nil;
|
|
938
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
939
|
+
|
|
940
|
+
result[@"useLivenessCheck"] = input.useLivenessCheck;
|
|
941
|
+
result[@"livenessParams"] = [self getLivenessParams:input.livenessParams];
|
|
942
|
+
result[@"checkUVLuminiscence"] = input.checkUVLuminiscence;
|
|
943
|
+
result[@"checkIRB900"] = input.checkIRB900;
|
|
944
|
+
result[@"checkImagePatterns"] = input.checkImagePatterns;
|
|
945
|
+
result[@"checkFibers"] = input.checkFibers;
|
|
946
|
+
result[@"checkExtMRZ"] = input.checkExtMRZ;
|
|
947
|
+
result[@"checkExtOCR"] = input.checkExtOCR;
|
|
948
|
+
result[@"checkAxial"] = input.checkAxial;
|
|
949
|
+
result[@"checkBarcodeFormat"] = input.checkBarcodeFormat;
|
|
950
|
+
result[@"checkIRVisibility"] = input.checkIRVisibility;
|
|
951
|
+
result[@"checkIPI"] = input.checkIPI;
|
|
952
|
+
result[@"checkPhotoEmbedding"] = input.checkPhotoEmbedding;
|
|
953
|
+
result[@"checkPhotoComparison"] = input.checkPhotoComparison;
|
|
954
|
+
result[@"checkLetterScreen"] = input.checkLetterScreen;
|
|
955
|
+
|
|
956
|
+
return result;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
+(void)setLivenessParams:(RGLLivenessParams*)result input:(NSDictionary*)input {
|
|
960
|
+
if([input valueForKey:@"checkOVI"] != nil)
|
|
961
|
+
result.checkOVI = [input valueForKey:@"checkOVI"];
|
|
962
|
+
if([input valueForKey:@"checkMLI"] != nil)
|
|
963
|
+
result.checkMLI = [input valueForKey:@"checkMLI"];
|
|
964
|
+
if([input valueForKey:@"checkHolo"] != nil)
|
|
965
|
+
result.checkHolo = [input valueForKey:@"checkHolo"];
|
|
966
|
+
if([input valueForKey:@"checkED"] != nil)
|
|
967
|
+
result.checkED = [input valueForKey:@"checkED"];
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
+(NSDictionary*)getLivenessParams:(RGLLivenessParams*)input {
|
|
971
|
+
if(input == nil) return nil;
|
|
972
|
+
NSMutableDictionary *result = [NSMutableDictionary new];
|
|
973
|
+
|
|
974
|
+
result[@"checkOVI"] = input.checkOVI;
|
|
975
|
+
result[@"checkMLI"] = input.checkMLI;
|
|
976
|
+
result[@"checkHolo"] = input.checkHolo;
|
|
977
|
+
result[@"checkED"] = input.checkED;
|
|
978
|
+
|
|
979
|
+
return result;
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
+(void)setColors:(NSMutableDictionary*)result input:(NSDictionary*)input {
|
|
983
|
+
if([input valueForKey:@"rfidProcessingScreenBackground"] != nil)
|
|
984
|
+
result[@(RFIDProcessingScreenBackground)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenBackground"]];
|
|
985
|
+
if([input valueForKey:@"rfidProcessingScreenHintLabelText"] != nil)
|
|
986
|
+
result[@(RFIDProcessingScreenHintLabelText)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenHintLabelText"]];
|
|
987
|
+
if([input valueForKey:@"rfidProcessingScreenHintLabelBackground"] != nil)
|
|
988
|
+
result[@(RFIDProcessingScreenHintLabelBackground)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenHintLabelBackground"]];
|
|
989
|
+
if([input valueForKey:@"rfidProcessingScreenProgressLabelText"] != nil)
|
|
990
|
+
result[@(RFIDProcessingScreenProgressLabelText)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenProgressLabelText"]];
|
|
991
|
+
if([input valueForKey:@"rfidProcessingScreenProgressBar"] != nil)
|
|
992
|
+
result[@(RFIDProcessingScreenProgressBar)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenProgressBar"]];
|
|
993
|
+
if([input valueForKey:@"rfidProcessingScreenProgressBarBackground"] != nil)
|
|
994
|
+
result[@(RFIDProcessingScreenProgressBarBackground)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenProgressBarBackground"]];
|
|
995
|
+
if([input valueForKey:@"rfidProcessingScreenResultLabelText"] != nil)
|
|
996
|
+
result[@(RFIDProcessingScreenResultLabelText)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenResultLabelText"]];
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
+(NSDictionary*)getColors:(NSDictionary*)input {
|
|
1000
|
+
return @{
|
|
1001
|
+
@"rfidProcessingScreenBackground": [self intWithColor:input[@(RFIDProcessingScreenBackground)]],
|
|
1002
|
+
@"rfidProcessingScreenHintLabelText": [self intWithColor:input[@(RFIDProcessingScreenHintLabelText)]],
|
|
1003
|
+
@"rfidProcessingScreenHintLabelBackground": [self intWithColor:input[@(RFIDProcessingScreenHintLabelBackground)]],
|
|
1004
|
+
@"rfidProcessingScreenProgressLabelText": [self intWithColor:input[@(RFIDProcessingScreenProgressLabelText)]],
|
|
1005
|
+
@"rfidProcessingScreenProgressBar": [self intWithColor:input[@(RFIDProcessingScreenProgressBar)]],
|
|
1006
|
+
@"rfidProcessingScreenProgressBarBackground": [self intWithColor:input[@(RFIDProcessingScreenProgressBarBackground)]],
|
|
1007
|
+
@"rfidProcessingScreenResultLabelText": [self intWithColor:input[@(RFIDProcessingScreenResultLabelText)]],
|
|
1008
|
+
};
|
|
1009
|
+
}
|
|
1010
|
+
|
|
1011
|
+
+(void)setFonts:(NSMutableDictionary*)result input:(NSDictionary*)input {
|
|
1012
|
+
if([input valueForKey:@"rfidProcessingScreenHintLabel"] != nil)
|
|
1013
|
+
result[@(RFIDProcessingScreenHintLabel)] = [self UIFontFromJSON:[input valueForKey:@"rfidProcessingScreenHintLabel"]];
|
|
1014
|
+
if([input valueForKey:@"rfidProcessingScreenProgressLabel"] != nil)
|
|
1015
|
+
result[@(RFIDProcessingScreenProgressLabel)] = [self UIFontFromJSON:[input valueForKey:@"rfidProcessingScreenProgressLabel"]];
|
|
1016
|
+
if([input valueForKey:@"rfidProcessingScreenResultLabel"] != nil)
|
|
1017
|
+
result[@(RFIDProcessingScreenResultLabel)] = [self UIFontFromJSON:[input valueForKey:@"rfidProcessingScreenResultLabel"]];
|
|
1018
|
+
}
|
|
1019
|
+
|
|
1020
|
+
+(NSDictionary*)getFonts:(NSDictionary*)input {
|
|
1021
|
+
return @{
|
|
1022
|
+
@"rfidProcessingScreenHintLabel": [self generateUIFont:input[@(RFIDProcessingScreenHintLabel)]],
|
|
1023
|
+
@"rfidProcessingScreenProgressLabel": [self generateUIFont:input[@(RFIDProcessingScreenProgressLabel)]],
|
|
1024
|
+
@"rfidProcessingScreenResultLabel": [self generateUIFont:input[@(RFIDProcessingScreenResultLabel)]],
|
|
1025
|
+
};
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
+(void)setImages:(NSMutableDictionary*)result input:(NSDictionary*)input {
|
|
1029
|
+
if([input valueForKey:@"rfidProcessingScreenFailureImage"] != nil)
|
|
1030
|
+
result[@(RFIDProcessingScreenFailureImage)] = [RGLWJSONConstructor imageWithBase64:[input valueForKey:@"rfidProcessingScreenFailureImage"]];
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
+(NSDictionary*)getImages:(NSDictionary*)input {
|
|
1034
|
+
return @{
|
|
1035
|
+
@"rfidProcessingScreenFailureImage": [RGLWJSONConstructor base64WithImage:input[@(RFIDProcessingScreenFailureImage)]],
|
|
1036
|
+
};
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
+(UIColor*)colorWithInt:(NSNumber*)input {
|
|
1040
|
+
// Convert hex int to hex string
|
|
1041
|
+
NSInteger hexInt = [input integerValue];
|
|
1042
|
+
NSString* numbers = @"0123456789ABCDEF";
|
|
1043
|
+
NSString* hexString = @"";
|
|
1044
|
+
while(hexInt>0){
|
|
1045
|
+
int digit = hexInt % 16;
|
|
1046
|
+
hexString = [NSString stringWithFormat:@"%@%@", [numbers substringWithRange:NSMakeRange(digit, 1)], hexString];
|
|
1047
|
+
hexInt = hexInt/16;
|
|
1048
|
+
}
|
|
1049
|
+
// If we use int, then all the starting zeros are lost: 0x0F123456 == 0xF123456
|
|
1050
|
+
if(hexString.length == 5 || hexString.length == 7)
|
|
1051
|
+
hexString = [NSString stringWithFormat:@"0%@", hexString];
|
|
1052
|
+
hexString = [NSString stringWithFormat:@"#%@", hexString];
|
|
1053
|
+
|
|
1054
|
+
// Convert hex string to UIColor
|
|
1055
|
+
NSString *colorString = [[hexString stringByReplacingOccurrencesOfString: @"#" withString: @""] uppercaseString];
|
|
1056
|
+
CGFloat alpha, red, blue, green;
|
|
1057
|
+
switch ([colorString length]) {
|
|
1058
|
+
case 3: // #RGB
|
|
1059
|
+
alpha = 1.0f;
|
|
1060
|
+
red = [self colorComponentFrom: colorString start: 0 length: 1];
|
|
1061
|
+
green = [self colorComponentFrom: colorString start: 1 length: 1];
|
|
1062
|
+
blue = [self colorComponentFrom: colorString start: 2 length: 1];
|
|
1063
|
+
break;
|
|
1064
|
+
case 4: // #ARGB
|
|
1065
|
+
alpha = [self colorComponentFrom: colorString start: 0 length: 1];
|
|
1066
|
+
red = [self colorComponentFrom: colorString start: 1 length: 1];
|
|
1067
|
+
green = [self colorComponentFrom: colorString start: 2 length: 1];
|
|
1068
|
+
blue = [self colorComponentFrom: colorString start: 3 length: 1];
|
|
1069
|
+
break;
|
|
1070
|
+
case 6: // #RRGGBB
|
|
1071
|
+
alpha = 1.0f;
|
|
1072
|
+
red = [self colorComponentFrom: colorString start: 0 length: 2];
|
|
1073
|
+
green = [self colorComponentFrom: colorString start: 2 length: 2];
|
|
1074
|
+
blue = [self colorComponentFrom: colorString start: 4 length: 2];
|
|
1075
|
+
break;
|
|
1076
|
+
case 8: // #AARRGGBB
|
|
1077
|
+
alpha = [self colorComponentFrom: colorString start: 0 length: 2];
|
|
1078
|
+
red = [self colorComponentFrom: colorString start: 2 length: 2];
|
|
1079
|
+
green = [self colorComponentFrom: colorString start: 4 length: 2];
|
|
1080
|
+
blue = [self colorComponentFrom: colorString start: 6 length: 2];
|
|
1081
|
+
break;
|
|
1082
|
+
default:
|
|
1083
|
+
[NSException raise:@"Invalid color value" format: @"Color value %@ is invalid. It should be a hex value of the form #RBG, #ARGB, #RRGGBB, or #AARRGGBB", hexString];
|
|
1084
|
+
break;
|
|
1085
|
+
}
|
|
1086
|
+
return [UIColor colorWithRed: red green: green blue: blue alpha: alpha];
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
+(CGFloat)colorComponentFrom:(NSString*)string start:(NSUInteger)start length:(NSUInteger)length {
|
|
1090
|
+
NSString *substring = [string substringWithRange: NSMakeRange(start, length)];
|
|
1091
|
+
NSString *fullHex = length == 2 ? substring : [NSString stringWithFormat: @"%@%@", substring, substring];
|
|
1092
|
+
unsigned hexComponent;
|
|
1093
|
+
[[NSScanner scannerWithString: fullHex] scanHexInt: &hexComponent];
|
|
1094
|
+
return hexComponent / 255.0;
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
+(NSNumber*)intWithColor:(UIColor*)color {
|
|
1098
|
+
if(color == nil) return nil;
|
|
1099
|
+
|
|
1100
|
+
const CGFloat *components = CGColorGetComponents(color.CGColor);
|
|
1101
|
+
CGFloat r = components[0];
|
|
1102
|
+
CGFloat g = components[1];
|
|
1103
|
+
CGFloat b = components[2];
|
|
1104
|
+
CGFloat a = components[3];
|
|
1105
|
+
|
|
1106
|
+
NSString* hexString = [NSString stringWithFormat:@"#%02lX%02lX%02lX%02lX",
|
|
1107
|
+
lroundf(a * 255),
|
|
1108
|
+
lroundf(r * 255),
|
|
1109
|
+
lroundf(g * 255),
|
|
1110
|
+
lroundf(b * 255)];
|
|
1111
|
+
|
|
1112
|
+
unsigned int hexInt = 0;
|
|
1113
|
+
NSScanner *scanner = [NSScanner scannerWithString:hexString];
|
|
1114
|
+
[scanner setCharactersToBeSkipped:[NSCharacterSet characterSetWithCharactersInString:@"#"]];
|
|
1115
|
+
[scanner scanHexInt:&hexInt];
|
|
1116
|
+
|
|
1117
|
+
return [NSNumber numberWithInteger:hexInt];
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
+(UIFont*)UIFontFromJSON:(NSDictionary*)input {
|
|
1121
|
+
return [UIFont fontWithName:[input valueForKey:@"name"] size:[[input valueForKey:@"size"] integerValue]];
|
|
1122
|
+
}
|
|
1123
|
+
|
|
1124
|
+
+(NSDictionary*)generateUIFont:(UIFont*)input {
|
|
1125
|
+
return @{
|
|
1126
|
+
@"name": input.fontName,
|
|
1127
|
+
@"size": @(input.pointSize)
|
|
1128
|
+
};
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
+(AVCaptureSessionPreset)captureSessionPresetWithNumber:(NSNumber*)value {
|
|
1132
|
+
int input = [value intValue];
|
|
1133
|
+
if(input == 0) return AVCaptureSessionPresetLow;
|
|
1134
|
+
if(input == 1) return AVCaptureSessionPresetMedium;
|
|
1135
|
+
if(input == 2) return AVCaptureSessionPresetHigh;
|
|
1136
|
+
if(input == 3) return AVCaptureSessionPresetPhoto;
|
|
1137
|
+
if(input == 4) return AVCaptureSessionPresetInputPriority;
|
|
1138
|
+
if(input == 6) return AVCaptureSessionPreset1280x720;
|
|
1139
|
+
if(input == 7) return AVCaptureSessionPreset1920x1080;
|
|
1140
|
+
if(input == 8) return AVCaptureSessionPreset3840x2160;
|
|
1141
|
+
if(input == 9) return AVCaptureSessionPresetiFrame960x540;
|
|
1142
|
+
if(input == 10) return AVCaptureSessionPresetiFrame1280x720;
|
|
1143
|
+
if(input == 12) return AVCaptureSessionPreset640x480;
|
|
1144
|
+
if(input == 13) return AVCaptureSessionPreset352x288;
|
|
1145
|
+
return AVCaptureSessionPreset1920x1080;
|
|
1146
|
+
}
|
|
1147
|
+
|
|
1148
|
+
+(NSNumber*)generateCaptureSessionPreset:(AVCaptureSessionPreset)value {
|
|
1149
|
+
if(value == AVCaptureSessionPresetLow) return @0;
|
|
1150
|
+
if(value == AVCaptureSessionPresetMedium) return @1;
|
|
1151
|
+
if(value == AVCaptureSessionPresetHigh) return @2;
|
|
1152
|
+
if(value == AVCaptureSessionPresetPhoto) return @3;
|
|
1153
|
+
if(value == AVCaptureSessionPresetInputPriority) return @4;
|
|
1154
|
+
if(value == AVCaptureSessionPreset1280x720) return @6;
|
|
1155
|
+
if(value == AVCaptureSessionPreset1920x1080) return @7;
|
|
1156
|
+
if(value == AVCaptureSessionPreset3840x2160) return @8;
|
|
1157
|
+
if(value == AVCaptureSessionPresetiFrame960x540) return @9;
|
|
1158
|
+
if(value == AVCaptureSessionPresetiFrame1280x720) return @10;
|
|
1159
|
+
if(value == AVCaptureSessionPreset640x480) return @12;
|
|
1160
|
+
if(value == AVCaptureSessionPreset352x288) return @13;
|
|
1161
|
+
return @0;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
+(CGLineCap)lineCapWithNumber:(NSNumber*)value {
|
|
1165
|
+
int input = [value intValue];
|
|
1166
|
+
if(input == 0) return kCGLineCapButt;
|
|
1167
|
+
if(input == 1) return kCGLineCapRound;
|
|
1168
|
+
if(input == 2) return kCGLineCapSquare;
|
|
1169
|
+
return kCGLineCapButt;
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
+(NSNumber*)generateLineCap:(CGLineCap)value {
|
|
1173
|
+
if(value == kCGLineCapButt) return @0;
|
|
1174
|
+
if(value == kCGLineCapRound) return @1;
|
|
1175
|
+
if(value == kCGLineCapSquare) return @2;
|
|
1176
|
+
return @0;;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
+(UIInterfaceOrientationMask)interfaceOrientationMaskWithNumber:(NSNumber*)value {
|
|
1180
|
+
int input = [value intValue];
|
|
1181
|
+
if(input == 0) return UIInterfaceOrientationMaskAll;
|
|
1182
|
+
if(input == 1) return UIInterfaceOrientationMaskPortrait;
|
|
1183
|
+
if(input == 2) return UIInterfaceOrientationMaskLandscape;
|
|
1184
|
+
if(input == 3) return UIInterfaceOrientationMaskLandscapeLeft;
|
|
1185
|
+
if(input == 4) return UIInterfaceOrientationMaskLandscapeRight;
|
|
1186
|
+
return UIInterfaceOrientationMaskPortrait;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
+(NSNumber*)generateInterfaceOrientationMask:(UIInterfaceOrientationMask)value {
|
|
1190
|
+
if(value == UIInterfaceOrientationMaskAll) return @0;
|
|
1191
|
+
if(value == UIInterfaceOrientationMaskPortrait) return @1;
|
|
1192
|
+
if(value == UIInterfaceOrientationMaskLandscape) return @2;
|
|
1193
|
+
if(value == UIInterfaceOrientationMaskLandscapeLeft) return @3;
|
|
1194
|
+
if(value == UIInterfaceOrientationMaskLandscapeRight) return @4;
|
|
1195
|
+
return @0;
|
|
1196
|
+
}
|
|
1197
|
+
|
|
1198
|
+
+(UIViewContentMode)viewContentModeWithNumber:(NSNumber*)value {
|
|
1199
|
+
int input = [value intValue];
|
|
1200
|
+
if(input == 0) return UIViewContentModeScaleToFill;
|
|
1201
|
+
if(input == 1) return UIViewContentModeScaleAspectFit;
|
|
1202
|
+
if(input == 2) return UIViewContentModeScaleAspectFill;
|
|
1203
|
+
if(input == 3) return UIViewContentModeRedraw;
|
|
1204
|
+
if(input == 4) return UIViewContentModeCenter;
|
|
1205
|
+
if(input == 5) return UIViewContentModeTop;
|
|
1206
|
+
if(input == 6) return UIViewContentModeBottom;
|
|
1207
|
+
if(input == 7) return UIViewContentModeLeft;
|
|
1208
|
+
if(input == 8) return UIViewContentModeRight;
|
|
1209
|
+
if(input == 9) return UIViewContentModeTopLeft;
|
|
1210
|
+
if(input == 10) return UIViewContentModeTopRight;
|
|
1211
|
+
if(input == 11) return UIViewContentModeBottomLeft;
|
|
1212
|
+
if(input == 12) return UIViewContentModeBottomRight;
|
|
1213
|
+
return UIViewContentModeCenter;
|
|
1214
|
+
}
|
|
1215
|
+
|
|
1216
|
+
+(NSNumber*)generateViewContentMode:(UIViewContentMode)value {
|
|
1217
|
+
if(value == UIViewContentModeScaleToFill) return @0;
|
|
1218
|
+
if(value == UIViewContentModeScaleAspectFit) return @1;
|
|
1219
|
+
if(value == UIViewContentModeScaleAspectFill) return @2;
|
|
1220
|
+
if(value == UIViewContentModeRedraw) return @3;
|
|
1221
|
+
if(value == UIViewContentModeCenter) return @4;
|
|
1222
|
+
if(value == UIViewContentModeTop) return @5;
|
|
1223
|
+
if(value == UIViewContentModeBottom) return @6;
|
|
1224
|
+
if(value == UIViewContentModeLeft) return @7;
|
|
1225
|
+
if(value == UIViewContentModeRight) return @8;
|
|
1226
|
+
if(value == UIViewContentModeTopLeft) return @9;
|
|
1227
|
+
if(value == UIViewContentModeTopRight) return @10;
|
|
1228
|
+
if(value == UIViewContentModeBottomLeft) return @11;
|
|
1229
|
+
if(value == UIViewContentModeBottomRight) return @12;
|
|
1230
|
+
return @4;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
+(RGLDocReaderFrame)docReaderFrameWithString:(NSString*)value {
|
|
1234
|
+
if([value isEqual: @"id1"]) return RGLDocReaderFrameScenarioDefault;
|
|
1235
|
+
if([value isEqual: @"max"]) return RGLDocReaderFrameMax;
|
|
1236
|
+
if([value isEqual: @"none"]) return RGLDocReaderFrameNone;
|
|
1237
|
+
if([value isEqual: @"document"]) return RGLDocReaderFrameDocument;
|
|
1238
|
+
return RGLDocReaderFrameNone;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
+(NSString*)generateDocReaderFrame:(RGLDocReaderFrame)value {
|
|
1242
|
+
if(value == RGLDocReaderFrameScenarioDefault) return @"id1";
|
|
1243
|
+
if(value == RGLDocReaderFrameMax) return @"max";
|
|
1244
|
+
if(value == RGLDocReaderFrameNone) return @"none";
|
|
1245
|
+
if(value == RGLDocReaderFrameDocument) return @"document";
|
|
1246
|
+
return @"none";
|
|
1247
|
+
}
|
|
1248
|
+
|
|
1249
|
+
+(RGLTextProcessing*)textProcessingWithNumber:(NSNumber*)value {
|
|
1250
|
+
int input = [value intValue];
|
|
1251
|
+
if(input == 0) return RGLTextProcessing.noChange;
|
|
1252
|
+
if(input == 1) return RGLTextProcessing.uppercase;
|
|
1253
|
+
if(input == 2) return RGLTextProcessing.lowercase;
|
|
1254
|
+
if(input == 3) return RGLTextProcessing.capital;
|
|
1255
|
+
return RGLTextProcessing.noChange;
|
|
1256
|
+
}
|
|
1257
|
+
|
|
1258
|
+
+(NSNumber*)generateWithTextProcessing:(RGLTextProcessing*)value {
|
|
1259
|
+
return [value valueForKey:@"rawValue"];
|
|
1260
|
+
}
|
|
1261
|
+
|
|
1262
|
+
+(NSNumber*)generateDocReaderAction:(RGLDocReaderAction)value {
|
|
1263
|
+
if(value == RGLDocReaderActionComplete) return @0;
|
|
1264
|
+
if(value == RGLDocReaderActionProcess) return @1;
|
|
1265
|
+
if(value == RGLDocReaderActionMorePagesAvailable) return @2;
|
|
1266
|
+
if(value == RGLDocReaderActionCancel) return @3;
|
|
1267
|
+
if(value == RGLDocReaderActionError) return @4;
|
|
1268
|
+
if(value == RGLDocReaderActionProcessWhiteFlashLight) return @5;
|
|
1269
|
+
if(value == RGLDocReaderActionProcessTimeout) return @6;
|
|
1270
|
+
if(value == RGLDocReaderActionProcessOnServer) return @7;
|
|
1271
|
+
return @4;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
+(NSNumber*)generateRFIDCompleteAction:(RGLRFIDCompleteAction)value {
|
|
1275
|
+
if(value == RGLRFIDCompleteActionComplete) return @0;
|
|
1276
|
+
if(value == RGLRFIDCompleteActionError) return @4;
|
|
1277
|
+
if(value == RGLRFIDCompleteActionCancel) return @3;
|
|
1278
|
+
if(value == RGLRFIDCompleteActionSessionRestarted) return @0;
|
|
1279
|
+
return @0;
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
+(NSNumber*)generateImageQualityCheckType:(RGLImageQualityCheckType)value {
|
|
1283
|
+
if(value == RGLImageQualityCheckTypeImageGlares) return @0;
|
|
1284
|
+
if(value == RGLImageQualityCheckTypeImageFocus) return @1;
|
|
1285
|
+
if(value == RGLImageQualityCheckTypeImageResolution) return @2;
|
|
1286
|
+
if(value == RGLImageQualityCheckTypeImageColorness) return @3;
|
|
1287
|
+
if(value == RGLImageQualityCheckTypeImagePerspective) return @4;
|
|
1288
|
+
if(value == RGLImageQualityCheckTypeImageBounds) return @5;
|
|
1289
|
+
if(value == RGLImageQualityCheckTypeScreenCapture) return @6;
|
|
1290
|
+
if(value == RGLImageQualityCheckTypePortrait) return @7;
|
|
1291
|
+
if(value == RGLImageQualityCheckTypeHandwritten) return @8;
|
|
1292
|
+
if(value == RGLImageQualityCheckTypeBrightness) return @9;
|
|
1293
|
+
return 0;
|
|
1294
|
+
}
|
|
1295
|
+
|
|
1296
|
+
+(RGLImageQualityCheckType)imageQualityCheckTypeWithNumber:(NSNumber*)input {
|
|
1297
|
+
if(input == nil) return nil;
|
|
1298
|
+
int value = [input intValue];
|
|
1299
|
+
if(value == 0) return RGLImageQualityCheckTypeImageGlares;
|
|
1300
|
+
if(value == 1) return RGLImageQualityCheckTypeImageFocus;
|
|
1301
|
+
if(value == 2) return RGLImageQualityCheckTypeImageResolution;
|
|
1302
|
+
if(value == 3) return RGLImageQualityCheckTypeImageColorness;
|
|
1303
|
+
if(value == 4) return RGLImageQualityCheckTypeImagePerspective;
|
|
1304
|
+
if(value == 5) return RGLImageQualityCheckTypeImageBounds;
|
|
1305
|
+
if(value == 6) return RGLImageQualityCheckTypeScreenCapture;
|
|
1306
|
+
if(value == 7) return RGLImageQualityCheckTypePortrait;
|
|
1307
|
+
if(value == 8) return RGLImageQualityCheckTypeHandwritten;
|
|
1308
|
+
if(value == 9) return RGLImageQualityCheckTypeBrightness;
|
|
1309
|
+
return RGLImageQualityCheckTypeImageGlares;
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
@end
|