@regulaforensics/react-native-document-reader-api 9.11.947-rc → 9.11.949-nightly

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.
@@ -0,0 +1,1577 @@
1
+ #import <Foundation/Foundation.h>
2
+ #import "RGLWConfig.h"
3
+
4
+ @implementation RGLWConfig
5
+
6
+ +(void)setFunctionality:(NSDictionary*)options :(RGLFunctionality*)functionality {
7
+ // Boolean
8
+ if([options valueForKey:@"showTorchButton"] != nil)
9
+ functionality.showTorchButton = [[options valueForKey:@"showTorchButton"] boolValue];
10
+ if([options valueForKey:@"showCloseButton"] != nil)
11
+ functionality.showCloseButton = [[options valueForKey:@"showCloseButton"] boolValue];
12
+ if([options valueForKey:@"videoCaptureMotionControl"] != nil)
13
+ functionality.videoCaptureMotionControl = [[options valueForKey:@"videoCaptureMotionControl"] boolValue];
14
+ if([options valueForKey:@"showCaptureButton"] != nil)
15
+ functionality.showCaptureButton = [[options valueForKey:@"showCaptureButton"] boolValue];
16
+ if([options valueForKey:@"showChangeFrameButton"] != nil)
17
+ functionality.showChangeFrameButton = [[options valueForKey:@"showChangeFrameButton"] boolValue];
18
+ if([options valueForKey:@"showSkipNextPageButton"] != nil)
19
+ functionality.showSkipNextPageButton = [[options valueForKey:@"showSkipNextPageButton"] boolValue];
20
+ if([options valueForKey:@"useAuthenticator"] != nil)
21
+ functionality.useAuthenticator = [[options valueForKey:@"useAuthenticator"] boolValue];
22
+ if([options valueForKey:@"skipFocusingFrames"] != nil)
23
+ functionality.skipFocusingFrames = [[options valueForKey:@"skipFocusingFrames"] boolValue];
24
+ if([options valueForKey:@"showCameraSwitchButton"] != nil)
25
+ functionality.showCameraSwitchButton = [[options valueForKey:@"showCameraSwitchButton"] boolValue];
26
+ if([options valueForKey:@"displayMetadata"] != nil)
27
+ functionality.showMetadataInfo = [[options valueForKey:@"displayMetadata"] boolValue];
28
+ if([options valueForKey:@"isZoomEnabled"] != nil)
29
+ functionality.isZoomEnabled = [[options valueForKey:@"isZoomEnabled"] boolValue];
30
+ if([options valueForKey:@"recordScanningProcess"] != nil)
31
+ functionality.recordScanningProcess = [[options valueForKey:@"recordScanningProcess"] boolValue];
32
+ if([options valueForKey:@"manualMultipageMode"] != nil)
33
+ functionality.manualMultipageMode = [[options valueForKey:@"manualMultipageMode"] boolValue];
34
+ if([options valueForKey:@"singleResult"] != nil)
35
+ functionality.singleResult = [[options valueForKey:@"singleResult"] boolValue];
36
+ if(options[@"torchTurnedOn"]) functionality.torchTurnedOn = [options[@"torchTurnedOn"] boolValue];
37
+ if(options[@"preventScreenRecording"]) functionality.preventScreenRecording = [options[@"preventScreenRecording"] boolValue];
38
+ if(options[@"homeIndicatorAutoHide"]) functionality.homeIndicatorAutoHide = [options[@"homeIndicatorAutoHide"] boolValue];
39
+
40
+ // Int
41
+ if([options valueForKey:@"showCaptureButtonDelayFromDetect"] != nil)
42
+ functionality.showCaptureButtonDelayFromDetect = [[options valueForKey:@"showCaptureButtonDelayFromDetect"] doubleValue];
43
+ if([options valueForKey:@"showCaptureButtonDelayFromStart"] != nil)
44
+ functionality.showCaptureButtonDelayFromStart = [[options valueForKey:@"showCaptureButtonDelayFromStart"] doubleValue];
45
+ if([options valueForKey:@"forcePagesCount"] != nil)
46
+ functionality.forcePagesCount = [options valueForKey:@"forcePagesCount"];
47
+ if([options valueForKey:@"orientation"] != nil)
48
+ functionality.orientation = [self interfaceOrientationMaskWithNumber:[options valueForKey:@"orientation"]];
49
+ if([options valueForKey:@"captureMode"] != nil)
50
+ functionality.captureMode = [[options valueForKey:@"captureMode"] integerValue];
51
+ if(options[@"cameraPositionIOS"])
52
+ functionality.cameraPosition = [options[@"cameraPositionIOS"] integerValue];
53
+
54
+ // String
55
+ if([options valueForKey:@"cameraFrame"] != nil)
56
+ functionality.cameraFrame = [self docReaderFrameWithString:[options valueForKey:@"cameraFrame"]];
57
+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
58
+ if([options valueForKey:@"btDeviceName"] != nil)
59
+ functionality.btDeviceName = [options valueForKey:@"btDeviceName"];
60
+ #pragma clang diagnostic pop
61
+
62
+ // Float
63
+ if([options valueForKey:@"zoomFactor"] != nil)
64
+ functionality.zoomFactor = [[options valueForKey:@"zoomFactor"] floatValue];
65
+ if(options[@"mdlTimeout"]) functionality.mDLTimeout = [options[@"mdlTimeout"] doubleValue];
66
+
67
+ // Custom
68
+ // in android - cameraSize
69
+ if([options valueForKey:@"videoSessionPreset"] != nil)
70
+ functionality.videoSessionPreset = [self captureSessionPresetWithNumber:[options valueForKey:@"videoSessionPreset"]];
71
+ if([options valueForKey:@"videoOutputSettings"] != nil)
72
+ functionality.videoOutputSettings = [options valueForKey:@"videoOutputSettings"];
73
+ }
74
+
75
+ +(NSDictionary*)getFunctionality:(RGLFunctionality*)functionality {
76
+ NSMutableDictionary *result = [NSMutableDictionary new];
77
+
78
+ // Boolean
79
+ result[@"showTorchButton"] = [NSNumber numberWithBool:functionality.showTorchButton];
80
+ result[@"showCloseButton"] = [NSNumber numberWithBool:functionality.showCloseButton];
81
+ result[@"videoCaptureMotionControl"] = [NSNumber numberWithBool:functionality.videoCaptureMotionControl];
82
+ result[@"showCaptureButton"] = [NSNumber numberWithBool:functionality.showCaptureButton];
83
+ result[@"showChangeFrameButton"] = [NSNumber numberWithBool:functionality.showChangeFrameButton];
84
+ result[@"showSkipNextPageButton"] = [NSNumber numberWithBool:functionality.showSkipNextPageButton];
85
+ result[@"useAuthenticator"] = [NSNumber numberWithBool:functionality.isUseAuthenticator];
86
+ result[@"skipFocusingFrames"] = [NSNumber numberWithBool:functionality.skipFocusingFrames];
87
+ result[@"showCameraSwitchButton"] = [NSNumber numberWithBool:functionality.showCameraSwitchButton];
88
+ result[@"displayMetadata"] = [NSNumber numberWithBool:functionality.showMetadataInfo];
89
+ result[@"isZoomEnabled"] = [NSNumber numberWithBool:functionality.isZoomEnabled];
90
+ result[@"recordScanningProcess"] = [NSNumber numberWithBool:functionality.recordScanningProcess];
91
+ result[@"manualMultipageMode"] = [NSNumber numberWithBool:functionality.manualMultipageMode];
92
+ result[@"singleResult"] = [NSNumber numberWithBool:functionality.singleResult];
93
+ result[@"torchTurnedOn"] = @(functionality.torchTurnedOn);
94
+ result[@"preventScreenRecording"] = @(functionality.preventScreenRecording);
95
+ result[@"homeIndicatorAutoHide"] = @(functionality.homeIndicatorAutoHide);
96
+
97
+ // Int
98
+ result[@"showCaptureButtonDelayFromDetect"] = [NSNumber numberWithDouble:functionality.showCaptureButtonDelayFromDetect];
99
+ result[@"showCaptureButtonDelayFromStart"] = [NSNumber numberWithDouble:functionality.showCaptureButtonDelayFromStart];
100
+ result[@"forcePagesCount"] = functionality.forcePagesCount;
101
+ result[@"orientation"] = [self generateInterfaceOrientationMask:functionality.orientation];
102
+ result[@"captureMode"] = [NSNumber numberWithInteger:functionality.captureMode];
103
+ result[@"cameraPositionIOS"] = @(functionality.cameraPosition);
104
+
105
+ // String
106
+ result[@"cameraFrame"] = [self generateDocReaderFrame:functionality.cameraFrame];
107
+ #pragma clang diagnostic ignored "-Wdeprecated-declarations"
108
+ result[@"btDeviceName"] = functionality.btDeviceName;
109
+ #pragma clang diagnostic pop
110
+
111
+ // Float
112
+ result[@"zoomFactor"] = [NSNumber numberWithFloat:functionality.zoomFactor];
113
+ result[@"mdlTimeout"] = @(functionality.mDLTimeout);
114
+
115
+ // Custom
116
+ // in android - cameraSize
117
+ result[@"videoSessionPreset"] = [self generateCaptureSessionPreset:functionality.videoSessionPreset];
118
+ result[@"videoOutputSettings"] = functionality.videoOutputSettings;
119
+
120
+ return result;
121
+ }
122
+
123
+ +(void)setProcessParams:(NSDictionary*)options :(RGLProcessParams*)processParams {
124
+
125
+ // Boolean
126
+ if([options valueForKey:@"multipageProcessing"] != nil)
127
+ processParams.multipageProcessing = [options valueForKey:@"multipageProcessing"];
128
+ if([options valueForKey:@"logs"] != nil)
129
+ processParams.logs = [options valueForKey:@"logs"];
130
+ if([options valueForKey:@"debugSaveImages"] != nil)
131
+ processParams.debugSaveImages = [options valueForKey:@"debugSaveImages"];
132
+ if([options valueForKey:@"debugSaveLogs"] != nil)
133
+ processParams.debugSaveLogs = [options valueForKey:@"debugSaveLogs"];
134
+ if([options valueForKey:@"returnUncroppedImage"] != nil)
135
+ processParams.returnUncroppedImage = [options valueForKey:@"returnUncroppedImage"];
136
+ if([options valueForKey:@"debugSaveCroppedImages"] != nil)
137
+ processParams.debugSaveCroppedImages = [options valueForKey:@"debugSaveCroppedImages"];
138
+ if([options valueForKey:@"disableFocusingCheck"] != nil)
139
+ processParams.disableFocusingCheck = [options valueForKey:@"disableFocusingCheck"];
140
+ if([options valueForKey:@"debugSaveRFIDSession"] != nil)
141
+ processParams.debugSaveRFIDSession = [options valueForKey:@"debugSaveRFIDSession"];
142
+ if([options valueForKey:@"doublePageSpread"] != nil)
143
+ processParams.doublePageSpread = [options valueForKey:@"doublePageSpread"];
144
+ if([options valueForKey:@"manualCrop"] != nil)
145
+ processParams.manualCrop = [options valueForKey:@"manualCrop"];
146
+ if([options valueForKey:@"integralImage"] != nil)
147
+ processParams.integralImage = [options valueForKey:@"integralImage"];
148
+ if([options valueForKey:@"returnCroppedBarcode"] != nil)
149
+ processParams.returnCroppedBarcode = [options valueForKey:@"returnCroppedBarcode"];
150
+ if([options valueForKey:@"checkRequiredTextFields"] != nil)
151
+ processParams.checkRequiredTextFields = [options valueForKey:@"checkRequiredTextFields"];
152
+ if([options valueForKey:@"depersonalizeLog"] != nil)
153
+ processParams.depersonalizeLog = [options valueForKey:@"depersonalizeLog"];
154
+ if([options valueForKey:@"generateDoublePageSpreadImage"] != nil)
155
+ processParams.generateDoublePageSpreadImage = [options valueForKey:@"generateDoublePageSpreadImage"];
156
+ if([options valueForKey:@"alreadyCropped"] != nil)
157
+ processParams.alreadyCropped = [options valueForKey:@"alreadyCropped"];
158
+ if([options valueForKey:@"matchTextFieldMask"] != nil)
159
+ processParams.matchTextFieldMask = [options valueForKey:@"matchTextFieldMask"];
160
+ if([options valueForKey:@"updateOCRValidityByGlare"] != nil)
161
+ processParams.updateOCRValidityByGlare = [options valueForKey:@"updateOCRValidityByGlare"];
162
+ if([options valueForKey:@"noGraphics"] != nil)
163
+ processParams.noGraphics = [options valueForKey:@"noGraphics"];
164
+ if([options valueForKey:@"multiDocOnImage"] != nil)
165
+ processParams.multiDocOnImage = [options valueForKey:@"multiDocOnImage"];
166
+ if([options valueForKey:@"parseBarcodes"] != nil)
167
+ processParams.parseBarcodes = [options valueForKey:@"parseBarcodes"];
168
+ if([options valueForKey:@"shouldReturnPackageForReprocess"] != nil)
169
+ processParams.shouldReturnPackageForReprocess = [options valueForKey:@"shouldReturnPackageForReprocess"];
170
+ if([options valueForKey:@"disablePerforationOCR"] != nil)
171
+ processParams.disablePerforationOCR = [options valueForKey:@"disablePerforationOCR"];
172
+ if([options valueForKey:@"respectImageQuality"] != nil)
173
+ processParams.respectImageQuality = [options valueForKey:@"respectImageQuality"];
174
+ if (options[@"strictImageQuality"]) processParams.strictImageQuality = options[@"strictImageQuality"];
175
+ if([options valueForKey:@"splitNames"] != nil)
176
+ processParams.splitNames = [options valueForKey:@"splitNames"];
177
+ if([options valueForKey:@"doDetectCan"] != nil)
178
+ processParams.doDetectCan = [options valueForKey:@"doDetectCan"];
179
+ if([options valueForKey:@"useFaceApi"] != nil)
180
+ processParams.useFaceApi = [options valueForKey:@"useFaceApi"];
181
+ if([options valueForKey:@"useAuthenticityCheck"] != nil)
182
+ processParams.useAuthenticityCheck = [options valueForKey:@"useAuthenticityCheck"];
183
+ if([options valueForKey:@"checkHologram"] != nil)
184
+ processParams.checkHologram = [options valueForKey:@"checkHologram"];
185
+ if (options[@"generateNumericCodes"]) processParams.generateNumericCodes = options[@"generateNumericCodes"];
186
+ if (options[@"strictBarcodeDigitalSignatureCheck"]) processParams.strictBarcodeDigitalSignatureCheck = options[@"strictBarcodeDigitalSignatureCheck"];
187
+ if (options[@"selectLongestNames"]) processParams.selectLongestNames = options[@"selectLongestNames"];
188
+ if (options[@"generateDTCVC"]) processParams.generateDTCVC = options[@"generateDTCVC"];
189
+ if (options[@"strictDLCategoryExpiry"]) processParams.strictDLCategoryExpiry = options[@"strictDLCategoryExpiry"];
190
+ if (options[@"generateAlpha2Codes"]) processParams.generateAlpha2Codes = options[@"generateAlpha2Codes"];
191
+ if (options[@"disableAuthResolutionFilter"]) processParams.disableAuthResolutionFilter = options[@"disableAuthResolutionFilter"];
192
+ if (options[@"strictSecurityChecks"]) processParams.strictSecurityChecks = options[@"strictSecurityChecks"];
193
+ if (options[@"returnTransliteratedFields"]) processParams.returnTransliteratedFields = options[@"returnTransliteratedFields"];
194
+ if (options[@"checkCaptureProcessIntegrity"]) processParams.checkCaptureProcessIntegrity = options[@"checkCaptureProcessIntegrity"];
195
+ if (options[@"strictExpiryDate"]) processParams.strictExpiryDate = options[@"strictExpiryDate"];
196
+ if (options[@"debugSaveBinarySession"]) processParams.debugSaveBinarySession = options[@"debugSaveBinarySession"];
197
+ if (options[@"checkVDS"]) processParams.checkVDS = options[@"checkVDS"];
198
+ if (options[@"strictAgeCheck"]) processParams.strictAgeCheck = options[@"strictAgeCheck"];
199
+
200
+ // Int
201
+ if([options valueForKey:@"measureSystem"] != nil)
202
+ processParams.measureSystem = [[options valueForKey:@"measureSystem"] integerValue];
203
+ if([options valueForKey:@"barcodeParserType"] != nil)
204
+ processParams.barcodeParserType = [options valueForKey:@"barcodeParserType"];
205
+ if([options valueForKey:@"perspectiveAngle"] != nil)
206
+ processParams.perspectiveAngle = [options valueForKey:@"perspectiveAngle"];
207
+ if([options valueForKey:@"minDPI"] != nil)
208
+ processParams.minDPI = [options valueForKey:@"minDPI"];
209
+ if([options valueForKey:@"imageDpiOutMax"] != nil)
210
+ processParams.imageDpiOutMax = [options valueForKey:@"imageDpiOutMax"];
211
+ if([options valueForKey:@"forceDocID"] != nil)
212
+ processParams.forceDocID = [options valueForKey:@"forceDocID"];
213
+ if([options valueForKey:@"forceDocFormat"] != nil)
214
+ processParams.forceDocFormat = [options valueForKey:@"forceDocFormat"];
215
+ if([options valueForKey:@"shiftExpiryDate"] != nil)
216
+ processParams.shiftExpiryDate = [options valueForKey:@"shiftExpiryDate"];
217
+ if([options valueForKey:@"minimalHolderAge"] != nil)
218
+ processParams.minimalHolderAge = [options valueForKey:@"minimalHolderAge"];
219
+ if([options valueForKey:@"imageOutputMaxHeight"] != nil)
220
+ processParams.imageOutputMaxHeight = [options valueForKey:@"imageOutputMaxHeight"];
221
+ if([options valueForKey:@"imageOutputMaxWidth"] != nil)
222
+ processParams.imageOutputMaxWidth = [options valueForKey:@"imageOutputMaxWidth"];
223
+ if([options valueForKey:@"processAuth"] != nil)
224
+ processParams.processAuth = [options valueForKey:@"processAuth"];
225
+ if([options valueForKey:@"convertCase"] != nil)
226
+ processParams.convertCase = [self textProcessingWithNumber:[options valueForKey:@"convertCase"]];
227
+ if(options[@"logLevel"]) processParams.logLevel = options[@"logLevel"];
228
+ if(options[@"mrzDetectMode"]) processParams.mrzDetectMode = options[@"mrzDetectMode"];
229
+ if(options[@"pdfPagesLimit"]) processParams.pdfPagesLimit = options[@"pdfPagesLimit"];
230
+
231
+ // String
232
+ if([options valueForKey:@"dateFormat"] != nil)
233
+ processParams.dateFormat = [options valueForKey:@"dateFormat"];
234
+ if([options valueForKey:@"scenario"] != nil)
235
+ processParams.scenario = [options valueForKey:@"scenario"];
236
+ if([options valueForKey:@"captureButtonScenario"] != nil)
237
+ processParams.captureButtonScenario = [options valueForKey:@"captureButtonScenario"];
238
+
239
+ // Double
240
+ if([options valueForKey:@"timeout"] != nil)
241
+ processParams.timeout = [options valueForKey:@"timeout"];
242
+ if([options valueForKey:@"timeoutFromFirstDetect"] != nil)
243
+ processParams.timeoutFromFirstDetect = [options valueForKey:@"timeoutFromFirstDetect"];
244
+ if([options valueForKey:@"timeoutFromFirstDocType"] != nil)
245
+ processParams.timeoutFromFirstDocType = [options valueForKey:@"timeoutFromFirstDocType"];
246
+ if([options valueForKey:@"documentAreaMin"] != nil)
247
+ processParams.documentAreaMin = [options valueForKey:@"documentAreaMin"];
248
+ if([options valueForKey:@"timeoutLiveness"] != nil)
249
+ processParams.timeoutLiveness = [options valueForKey:@"timeoutLiveness"];
250
+
251
+ // JSONArray
252
+ if([options valueForKey:@"documentIDList"] != nil)
253
+ processParams.documentIDList = [options valueForKey:@"documentIDList"];
254
+ if([options valueForKey:@"fieldTypesFilter"] != nil)
255
+ processParams.fieldTypesFilter = [options valueForKey:@"fieldTypesFilter"];
256
+ if([options valueForKey:@"barcodeTypes"] != nil)
257
+ processParams.barcodeTypes = [options valueForKey:@"barcodeTypes"];
258
+ if([options valueForKey:@"resultTypeOutput"] != nil)
259
+ processParams.resultTypeOutput = [options valueForKey:@"resultTypeOutput"];
260
+ if([options valueForKey:@"mrzFormatsFilter"] != nil)
261
+ processParams.mrzFormatsFilter = [options valueForKey:@"mrzFormatsFilter"];
262
+ if([options valueForKey:@"documentGroupFilter"] != nil)
263
+ processParams.documentGroupFilter = [options mutableArrayValueForKey:@"documentGroupFilter"];
264
+ if([options valueForKey:@"lcidIgnoreFilter"] != nil)
265
+ processParams.lcidIgnoreFilter = [options mutableArrayValueForKey:@"lcidIgnoreFilter"];
266
+ if (options[@"lcidFilter"]) processParams.lcidFilter = options[@"lcidFilter"];
267
+ if (options[@"fieldTypesIgnoreFilter"]) processParams.fieldTypesIgnoreFilter = options[@"fieldTypesIgnoreFilter"];
268
+
269
+ // JSONObject
270
+ if (options[@"customParams"]) processParams.customParams = options[@"customParams"];
271
+ if ([options valueForKey:@"imageQA"] != nil)
272
+ [self setImageQA:processParams.imageQA input:[options valueForKey:@"imageQA"]];
273
+ if ([options valueForKey:@"authenticityParams"] != nil) {
274
+ if(processParams.authenticityParams == nil) processParams.authenticityParams = [RGLAuthenticityParams defaultParams];
275
+ [self setAuthenticityParams:processParams.authenticityParams input:[options valueForKey:@"authenticityParams"]];
276
+ }
277
+ if ([options valueForKey:@"rfidParams"] != nil)
278
+ processParams.rfidParams = [RGLWJSONConstructor rfidParamsFromJson:[options valueForKey:@"rfidParams"]];
279
+ if ([options valueForKey:@"faceApiParams"] != nil)
280
+ processParams.faceApiParams = [RGLWJSONConstructor faceAPIParamsFromJson:[options valueForKey:@"faceApiParams"]];
281
+ if ([options valueForKey:@"backendProcessingConfig"] != nil)
282
+ processParams.backendProcessingConfig = [RGLWJSONConstructor backendProcessingConfigFromJson:[options valueForKey:@"backendProcessingConfig"]];
283
+ if (options[@"bsiTr03135"]) processParams.bsiTr03135 = [RGLWJSONConstructor bsiFromJson:options[@"bsiTr03135"]];
284
+ }
285
+
286
+ +(NSDictionary*)getProcessParams:(RGLProcessParams*)processParams {
287
+ NSMutableDictionary *result = [NSMutableDictionary new];
288
+
289
+ // Boolean
290
+ result[@"multipageProcessing"] = processParams.multipageProcessing;
291
+ result[@"logs"] = processParams.logs;
292
+ result[@"debugSaveImages"] = processParams.debugSaveImages;
293
+ result[@"debugSaveLogs"] = processParams.debugSaveLogs;
294
+ result[@"returnUncroppedImage"] = processParams.returnUncroppedImage;
295
+ result[@"debugSaveCroppedImages"] = processParams.debugSaveCroppedImages;
296
+ result[@"disableFocusingCheck"] = processParams.disableFocusingCheck;
297
+ result[@"debugSaveRFIDSession"] = processParams.debugSaveRFIDSession;
298
+ result[@"doublePageSpread"] = processParams.doublePageSpread;
299
+ result[@"manualCrop"] = processParams.manualCrop;
300
+ result[@"integralImage"] = processParams.integralImage;
301
+ result[@"returnCroppedBarcode"] = processParams.returnCroppedBarcode;
302
+ result[@"checkRequiredTextFields"] = processParams.checkRequiredTextFields;
303
+ result[@"depersonalizeLog"] = processParams.depersonalizeLog;
304
+ result[@"generateDoublePageSpreadImage"] = processParams.generateDoublePageSpreadImage;
305
+ result[@"alreadyCropped"] = processParams.alreadyCropped;
306
+ result[@"matchTextFieldMask"] = processParams.matchTextFieldMask;
307
+ result[@"updateOCRValidityByGlare"] = processParams.updateOCRValidityByGlare;
308
+ result[@"noGraphics"] = processParams.noGraphics;
309
+ result[@"multiDocOnImage"] = processParams.multiDocOnImage;
310
+ result[@"parseBarcodes"] = processParams.parseBarcodes;
311
+ result[@"shouldReturnPackageForReprocess"] = processParams.shouldReturnPackageForReprocess;
312
+ result[@"disablePerforationOCR"] = processParams.disablePerforationOCR;
313
+ result[@"respectImageQuality"] = processParams.respectImageQuality;
314
+ result[@"strictImageQuality"] = processParams.strictImageQuality;
315
+ result[@"splitNames"] = processParams.splitNames;
316
+ result[@"doDetectCan"] = processParams.doDetectCan;
317
+ result[@"useFaceApi"] = processParams.useFaceApi;
318
+ result[@"useAuthenticityCheck"] = processParams.useAuthenticityCheck;
319
+ result[@"checkHologram"] = processParams.checkHologram;
320
+ result[@"generateNumericCodes"] = processParams.generateNumericCodes;
321
+ result[@"strictBarcodeDigitalSignatureCheck"] = processParams.strictBarcodeDigitalSignatureCheck;
322
+ result[@"selectLongestNames"] = processParams.selectLongestNames;
323
+ result[@"generateDTCVC"] = processParams.generateDTCVC;
324
+ result[@"strictDLCategoryExpiry"] = processParams.strictDLCategoryExpiry;
325
+ result[@"generateAlpha2Codes"] = processParams.generateAlpha2Codes;
326
+ result[@"disableAuthResolutionFilter"] = processParams.disableAuthResolutionFilter;
327
+ result[@"strictSecurityChecks"] = processParams.strictSecurityChecks;
328
+ result[@"returnTransliteratedFields"] = processParams.returnTransliteratedFields;
329
+ result[@"checkCaptureProcessIntegrity"] = processParams.checkCaptureProcessIntegrity;
330
+ result[@"strictExpiryDate"] = processParams.strictExpiryDate;
331
+ result[@"debugSaveBinarySession"] = processParams.debugSaveBinarySession;
332
+ result[@"checkVDS"] = processParams.checkVDS;
333
+ result[@"strictAgeCheck"] = processParams.strictAgeCheck;
334
+
335
+ // Int
336
+ result[@"measureSystem"] = [NSNumber numberWithInteger:processParams.measureSystem];
337
+ result[@"barcodeParserType"] = processParams.barcodeParserType;
338
+ result[@"perspectiveAngle"] = processParams.perspectiveAngle;
339
+ result[@"minDPI"] = processParams.minDPI;
340
+ result[@"imageDpiOutMax"] = processParams.imageDpiOutMax;
341
+ result[@"forceDocID"] = processParams.forceDocID;
342
+ result[@"forceDocFormat"] = processParams.forceDocFormat;
343
+ result[@"shiftExpiryDate"] = processParams.shiftExpiryDate;
344
+ result[@"minimalHolderAge"] = processParams.minimalHolderAge;
345
+ result[@"imageOutputMaxHeight"] = processParams.imageOutputMaxHeight;
346
+ result[@"imageOutputMaxWidth"] = processParams.imageOutputMaxWidth;
347
+ result[@"processAuth"] = processParams.processAuth;
348
+ result[@"convertCase"] = [self generateWithTextProcessing:processParams.convertCase];
349
+ result[@"logLevel"] = processParams.logLevel;
350
+ result[@"mrzDetectMode"] = processParams.mrzDetectMode;
351
+ result[@"pdfPagesLimit"] = processParams.pdfPagesLimit;
352
+
353
+ // String
354
+ result[@"dateFormat"] = processParams.dateFormat;
355
+ result[@"scenario"] = processParams.scenario;
356
+ result[@"captureButtonScenario"] = processParams.captureButtonScenario;
357
+
358
+ // Double
359
+ result[@"timeout"] = processParams.timeout;
360
+ result[@"timeoutFromFirstDetect"] = processParams.timeoutFromFirstDetect;
361
+ result[@"timeoutFromFirstDocType"] = processParams.timeoutFromFirstDocType;
362
+ result[@"documentAreaMin"] = processParams.documentAreaMin;
363
+ result[@"timeoutLiveness"] = processParams.timeoutLiveness;
364
+
365
+ // JSONArray
366
+ result[@"documentIDList"] = processParams.documentIDList;
367
+ result[@"barcodeTypes"] = processParams.barcodeTypes;
368
+ result[@"fieldTypesFilter"] = processParams.fieldTypesFilter;
369
+ result[@"documentGroupFilter"] = processParams.documentGroupFilter;
370
+ result[@"lcidIgnoreFilter"] = processParams.lcidIgnoreFilter;
371
+ result[@"lcidFilter"] = processParams.lcidFilter;
372
+ result[@"fieldTypesIgnoreFilter"] = processParams.fieldTypesIgnoreFilter;
373
+ result[@"mrzFormatsFilter"] = processParams.mrzFormatsFilter;
374
+ result[@"resultTypeOutput"] = processParams.resultTypeOutput;
375
+
376
+ // JSONObject
377
+ result[@"imageQA"] = [self getImageQA:processParams.imageQA];
378
+ result[@"authenticityParams"] = [self getAuthenticityParams:processParams.authenticityParams];
379
+ result[@"rfidParams"] = [RGLWJSONConstructor generateRFIDParams:processParams.rfidParams];
380
+ result[@"faceApiParams"] = [RGLWJSONConstructor generateFaceAPIParams:processParams.faceApiParams];
381
+ result[@"backendProcessingConfig"] = [RGLWJSONConstructor generateBackendProcessingConfig:processParams.backendProcessingConfig];
382
+ result[@"bsiTr03135"] = [RGLWJSONConstructor generateBsi:processParams.bsiTr03135];
383
+
384
+ // Custom
385
+ result[@"customParams"] = processParams.customParams;
386
+
387
+ return result;
388
+ }
389
+
390
+ +(void)setCustomization:(NSDictionary*)options :(RGLCustomization*)customization {
391
+ if(options[@"theme"]) customization.theme = [options[@"theme"] integerValue];
392
+
393
+ // Boolean
394
+ if([options valueForKey:@"showStatusMessages"] != nil)
395
+ customization.showStatusMessages = [[options valueForKey:@"showStatusMessages"] boolValue];
396
+ if([options valueForKey:@"showResultStatusMessages"] != nil)
397
+ customization.showResultStatusMessages = [[options valueForKey:@"showResultStatusMessages"] boolValue];
398
+ if([options valueForKey:@"showHelpAnimation"] != nil)
399
+ customization.showHelpAnimation = [[options valueForKey:@"showHelpAnimation"] boolValue];
400
+ if([options valueForKey:@"showNextPageAnimation"] != nil)
401
+ customization.showNextPageAnimation = [[options valueForKey:@"showNextPageAnimation"] boolValue];
402
+ if([options valueForKey:@"showBackgroundMask"] != nil)
403
+ customization.showBackgroundMask = [[options valueForKey:@"showBackgroundMask"] boolValue];
404
+
405
+ // Int
406
+ if([options valueForKey:@"cameraFrameBorderWidth"] != nil)
407
+ customization.cameraFrameBorderWidth = [[options valueForKey:@"cameraFrameBorderWidth"] floatValue];
408
+ if([options valueForKey:@"cameraFrameLineLength"] != nil)
409
+ customization.cameraFrameLineLength = [[options valueForKey:@"cameraFrameLineLength"] floatValue];
410
+ if([options valueForKey:@"cameraFrameShapeType"] != nil)
411
+ customization.cameraFrameShapeType = [[options valueForKey:@"cameraFrameShapeType"] integerValue];
412
+ if([options valueForKey:@"cameraFrameOffsetWidth"] != nil)
413
+ customization.cameraFrameOffsetWidth = [[options valueForKey:@"cameraFrameOffsetWidth"] floatValue];
414
+ if(options[@"nextPageAnimationStartDelay"]) customization.nextPageAnimationStartDelay = [options[@"nextPageAnimationStartDelay"] floatValue];
415
+ if(options[@"nextPageAnimationEndDelay"]) customization.nextPageAnimationEndDelay = [options[@"nextPageAnimationEndDelay"] floatValue];
416
+
417
+ // String
418
+ if([options valueForKey:@"status"] != nil)
419
+ customization.status = [options valueForKey:@"status"];
420
+ if([options valueForKey:@"resultStatus"] != nil)
421
+ customization.resultStatus = [options valueForKey:@"resultStatus"];
422
+ if(options[@"multipageButtonText"]) customization.multipageButtonText = options[@"multipageButtonText"];
423
+
424
+ // Color
425
+ if([options valueForKey:@"cameraFrameDefaultColor"] != nil)
426
+ customization.cameraFrameDefaultColor = [self colorWithInt:[options valueForKey:@"cameraFrameDefaultColor"]];
427
+ if([options valueForKey:@"cameraFrameActiveColor"] != nil)
428
+ customization.cameraFrameActiveColor = [self colorWithInt:[options valueForKey:@"cameraFrameActiveColor"]];
429
+ if([options valueForKey:@"statusTextColor"] != nil)
430
+ customization.statusTextColor = [self colorWithInt:[options valueForKey:@"statusTextColor"]];
431
+ if([options valueForKey:@"resultStatusTextColor"] != nil)
432
+ customization.resultStatusTextColor = [self colorWithInt:[options valueForKey:@"resultStatusTextColor"]];
433
+ if([options valueForKey:@"resultStatusBackgroundColor"] != nil)
434
+ customization.resultStatusBackgroundColor = [self colorWithInt:[options valueForKey:@"resultStatusBackgroundColor"]];
435
+ if([options valueForKey:@"multipageButtonBackgroundColor"] != nil)
436
+ customization.multipageButtonBackgroundColor = [self colorWithInt:[options valueForKey:@"multipageButtonBackgroundColor"]];
437
+ if([options valueForKey:@"tintColor"] != nil)
438
+ customization.tintColor = [self colorWithInt:[options valueForKey:@"tintColor"]];
439
+ if([options valueForKey:@"activityIndicatorColor"] != nil)
440
+ customization.activityIndicatorColor = [self colorWithInt:[options valueForKey:@"activityIndicatorColor"]];
441
+ if([options valueForKey:@"statusBackgroundColor"] != nil)
442
+ customization.statusBackgroundColor = [self colorWithInt:[options valueForKey:@"statusBackgroundColor"]];
443
+ if([options valueForKey:@"cameraPreviewBackgroundColor"] != nil)
444
+ customization.cameraPreviewBackgroundColor = [self colorWithInt:[options valueForKey:@"cameraPreviewBackgroundColor"]];
445
+ if([options valueForKey:@"backgroundMaskColor"] != nil)
446
+ customization.backgroundMaskColor = [self colorWithInt:[options valueForKey:@"backgroundMaskColor"]];
447
+ if(options[@"multipageButtonTextColor"]) customization.multipageButtonTextColor = [self colorWithInt:options[@"multipageButtonTextColor"]];
448
+
449
+ // Float
450
+ if([options valueForKey:@"statusPositionMultiplier"] != nil)
451
+ customization.statusPositionMultiplier = [[options valueForKey:@"statusPositionMultiplier"] floatValue];
452
+ if([options valueForKey:@"resultStatusPositionMultiplier"] != nil)
453
+ customization.resultStatusPositionMultiplier = [[options valueForKey:@"resultStatusPositionMultiplier"] floatValue];
454
+ if([options valueForKey:@"toolbarSize"] != nil)
455
+ customization.toolbarSize = [[options valueForKey:@"toolbarSize"] floatValue];
456
+ if([options valueForKey:@"backgroundMaskAlpha"] != nil)
457
+ customization.backgroundMaskAlpha = [[options valueForKey:@"backgroundMaskAlpha"] floatValue];
458
+ if([options valueForKey:@"customStatusPositionMultiplier"] != nil)
459
+ customization.customStatusPositionMultiplier = [[options valueForKey:@"customStatusPositionMultiplier"] floatValue];
460
+ if([options valueForKey:@"cameraFrameVerticalPositionMultiplier"] != nil)
461
+ customization.cameraFrameVerticalPositionMultiplier = [[options valueForKey:@"cameraFrameVerticalPositionMultiplier"] floatValue];
462
+ if([options valueForKey:@"cameraFrameLandscapeAspectRatio"] != nil)
463
+ customization.cameraFrameLandscapeAspectRatio = [[options valueForKey:@"cameraFrameLandscapeAspectRatio"] floatValue];
464
+ if([options valueForKey:@"cameraFramePortraitAspectRatio"] != nil)
465
+ customization.cameraFramePortraitAspectRatio = [[options valueForKey:@"cameraFramePortraitAspectRatio"] floatValue];
466
+ if([options valueForKey:@"cameraFrameCornerRadius"] != nil)
467
+ customization.cameraFrameCornerRadius = [[options valueForKey:@"cameraFrameCornerRadius"] floatValue];
468
+ if([options valueForKey:@"livenessAnimationPositionMultiplier"] != nil)
469
+ customization.livenessAnimationPositionMultiplier = [[options valueForKey:@"livenessAnimationPositionMultiplier"] floatValue];
470
+ if(options[@"activityIndicatorPortraitPositionMultiplier"]) customization.activityIndicatorPortraitPositionMultiplier = [options[@"activityIndicatorPortraitPositionMultiplier"] floatValue];
471
+ if(options[@"activityIndicatorLandscapePositionMultiplier"]) customization.activityIndicatorLandscapePositionMultiplier = [options[@"activityIndicatorLandscapePositionMultiplier"] floatValue];
472
+ if(options[@"cameraPreviewVerticalPositionMultiplier"]) customization.previewLayerPositionMultiplier = [options[@"cameraPreviewVerticalPositionMultiplier"] floatValue];
473
+ if(options[@"multipageButtonPositionMultiplier"]) customization.multipageButtonPositionMultiplier = [options[@"multipageButtonPositionMultiplier"] floatValue];
474
+
475
+ // Drawable
476
+ if([options valueForKey:@"multipageAnimationFrontImage"] != nil)
477
+ customization.multipageAnimationFrontImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"multipageAnimationFrontImage"]];
478
+ if([options valueForKey:@"multipageAnimationBackImage"] != nil)
479
+ customization.multipageAnimationBackImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"multipageAnimationBackImage"]];
480
+ if([options valueForKey:@"borderBackgroundImage"] != nil)
481
+ customization.borderBackgroundImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"borderBackgroundImage"]];
482
+ if([options valueForKey:@"helpAnimationImage"] != nil)
483
+ customization.helpAnimationImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"helpAnimationImage"]];
484
+ if([options valueForKey:@"closeButtonImage"] != nil)
485
+ customization.closeButtonImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"closeButtonImage"]];
486
+ if([options valueForKey:@"captureButtonImage"] != nil)
487
+ customization.captureButtonImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"captureButtonImage"]];
488
+ if([options valueForKey:@"changeFrameButtonCollapseImage"] != nil)
489
+ customization.changeFrameButtonCollapseImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"changeFrameButtonCollapseImage"]];
490
+ if([options valueForKey:@"changeFrameButtonExpandImage"] != nil)
491
+ customization.changeFrameButtonExpandImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"changeFrameButtonExpandImage"]];
492
+ if([options valueForKey:@"cameraSwitchButtonImage"] != nil)
493
+ customization.cameraSwitchButtonImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"cameraSwitchButtonImage"]];
494
+ if([options valueForKey:@"torchButtonOnImage"] != nil)
495
+ customization.torchButtonOnImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"torchButtonOnImage"]];
496
+ if([options valueForKey:@"torchButtonOffImage"] != nil)
497
+ customization.torchButtonOffImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"torchButtonOffImage"]];
498
+ if([options valueForKey:@"livenessAnimationImage"] != nil)
499
+ customization.livenessAnimationImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"livenessAnimationImage"]];
500
+ if(options[@"multipageButtonImage"]) customization.multipageButtonImage = [RGLWJSONConstructor imageWithBase64:options[@"multipageButtonImage"]];
501
+
502
+ // Font
503
+ if([options valueForKey:@"statusTextFont"] != nil)
504
+ customization.statusTextFont = [self UIFontFromJSON:[options valueForKey:@"statusTextFont"]];
505
+ if([options valueForKey:@"resultStatusTextFont"] != nil)
506
+ customization.resultStatusTextFont = [self UIFontFromJSON:[options valueForKey:@"resultStatusTextFont"]];
507
+ if(options[@"multipageButtonTextFont"]) customization.multipageButtonTextFont = [self UIFontFromJSON:options[@"multipageButtonTextFont"]];
508
+
509
+ // Custom
510
+ if([options valueForKey:@"customLabelStatus"] != nil)
511
+ customization.customLabelStatus = [[NSAttributedString alloc]initWithString:[options valueForKey:@"customLabelStatus"]];
512
+ if([options valueForKey:@"cameraFrameLineCap"] != nil)
513
+ customization.cameraFrameLineCap = [self lineCapWithNumber:[options valueForKey:@"cameraFrameLineCap"]];
514
+ if([options valueForKey:@"uiCustomizationLayer"] != nil)
515
+ customization.customUILayerJSON = [options valueForKey:@"uiCustomizationLayer"];
516
+
517
+ // ContentMode
518
+ if([options valueForKey:@"helpAnimationImageContentMode"] != nil)
519
+ customization.helpAnimationImageContentMode = [self viewContentModeWithNumber:[options valueForKey:@"helpAnimationImageContentMode"]];
520
+ if([options valueForKey:@"multipageAnimationFrontImageContentMode"] != nil)
521
+ customization.multipageAnimationFrontImageContentMode = [self viewContentModeWithNumber:[options valueForKey:@"multipageAnimationFrontImageContentMode"]];
522
+ if([options valueForKey:@"multipageAnimationBackImageContentMode"] != nil)
523
+ customization.multipageAnimationBackImageContentMode = [self viewContentModeWithNumber:[options valueForKey:@"multipageAnimationBackImageContentMode"]];
524
+ if([options valueForKey:@"livenessAnimationImageContentMode"] != nil)
525
+ customization.livenessAnimationImageContentMode = [self viewContentModeWithNumber:[options valueForKey:@"livenessAnimationImageContentMode"]];
526
+ if([options valueForKey:@"borderBackgroundImageContentMode"] != nil)
527
+ customization.borderBackgroundImageContentMode = [self viewContentModeWithNumber:[options valueForKey:@"borderBackgroundImageContentMode"]];
528
+
529
+ if(options[@"colors"]) [self setColors:[customization.uiConfiguration valueForKey:@"colors"] input:options[@"colors"]];
530
+ if(options[@"fonts"]) [self setFonts:[customization.uiConfiguration valueForKey:@"fonts"] input:options[@"fonts"]];
531
+ if(options[@"images"]) [self setImages:[customization.uiConfiguration valueForKey:@"images"] input:options[@"images"]];
532
+ if(options[@"timings"]) [self setTimings:[customization.uiConfiguration valueForKey:@"timings"] input:options[@"timings"]];
533
+ if(options[@"contentModes"]) [self setContentModes:[customization.uiConfiguration valueForKey:@"contentModes"] input:options[@"contentModes"]];
534
+ }
535
+
536
+ +(NSDictionary*)getCustomization:(RGLCustomization*)customization {
537
+ NSMutableDictionary *result = [NSMutableDictionary new];
538
+ result[@"theme"] = [NSNumber numberWithInteger:customization.theme];
539
+
540
+ // Boolean
541
+ result[@"showStatusMessages"] = [NSNumber numberWithBool:customization.showStatusMessages];
542
+ result[@"showResultStatusMessages"] = [NSNumber numberWithBool:customization.showResultStatusMessages];
543
+ result[@"showHelpAnimation"] = [NSNumber numberWithBool:customization.showHelpAnimation];
544
+ result[@"showNextPageAnimation"] = [NSNumber numberWithBool:customization.showNextPageAnimation];
545
+ result[@"showBackgroundMask"] = [NSNumber numberWithBool:customization.showBackgroundMask];
546
+
547
+ // Int
548
+ result[@"cameraFrameBorderWidth"] = [NSNumber numberWithFloat:customization.cameraFrameBorderWidth];
549
+ result[@"cameraFrameLineLength"] = [NSNumber numberWithFloat:customization.cameraFrameLineLength];
550
+ result[@"cameraFrameShapeType"] = [NSNumber numberWithFloat:customization.cameraFrameShapeType];
551
+ result[@"cameraFrameOffsetWidth"] = [NSNumber numberWithFloat:customization.cameraFrameOffsetWidth];
552
+ result[@"nextPageAnimationStartDelay"] = [NSNumber numberWithFloat:customization.nextPageAnimationStartDelay];
553
+ result[@"nextPageAnimationEndDelay"] = [NSNumber numberWithFloat:customization.nextPageAnimationEndDelay];
554
+
555
+ // String
556
+ result[@"status"] = customization.status;
557
+ result[@"resultStatus"] = customization.resultStatus;
558
+ result[@"multipageButtonText"] = customization.multipageButtonText;
559
+
560
+ // Color
561
+ result[@"cameraFrameDefaultColor"] = [self intWithColor:customization.cameraFrameDefaultColor];
562
+ result[@"cameraFrameActiveColor"] = [self intWithColor:customization.cameraFrameActiveColor];
563
+ result[@"statusTextColor"] = [self intWithColor:customization.statusTextColor];
564
+ result[@"resultStatusTextColor"] = [self intWithColor:customization.resultStatusTextColor];
565
+ result[@"resultStatusBackgroundColor"] = [self intWithColor:customization.resultStatusBackgroundColor];
566
+ result[@"multipageButtonBackgroundColor"] = [self intWithColor:customization.multipageButtonBackgroundColor];
567
+ result[@"tintColor"] = [self intWithColor:customization.tintColor];
568
+ result[@"activityIndicatorColor"] = [self intWithColor:customization.activityIndicatorColor];
569
+ result[@"statusBackgroundColor"] = [self intWithColor:customization.statusBackgroundColor];
570
+ result[@"cameraPreviewBackgroundColor"] = [self intWithColor:customization.cameraPreviewBackgroundColor];
571
+ result[@"backgroundMaskColor"] = [self intWithColor:customization.backgroundMaskColor];
572
+ result[@"multipageButtonTextColor"] = [self intWithColor:customization.multipageButtonTextColor];
573
+
574
+ // Float
575
+ result[@"statusPositionMultiplier"] = [NSNumber numberWithFloat:customization.statusPositionMultiplier];
576
+ result[@"resultStatusPositionMultiplier"] = [NSNumber numberWithFloat:customization.resultStatusPositionMultiplier];
577
+ result[@"backgroundMaskAlpha"] = [NSNumber numberWithFloat:customization.backgroundMaskAlpha];
578
+ result[@"toolbarSize"] = [NSNumber numberWithFloat:customization.toolbarSize];
579
+ result[@"customStatusPositionMultiplier"] = [NSNumber numberWithFloat:customization.customStatusPositionMultiplier];
580
+ result[@"cameraFrameVerticalPositionMultiplier"] = [NSNumber numberWithFloat:customization.cameraFrameVerticalPositionMultiplier];
581
+ result[@"cameraFrameLandscapeAspectRatio"] = [NSNumber numberWithFloat:customization.cameraFrameLandscapeAspectRatio];
582
+ result[@"cameraFramePortraitAspectRatio"] = [NSNumber numberWithFloat:customization.cameraFramePortraitAspectRatio];
583
+ result[@"cameraFrameCornerRadius"] = [NSNumber numberWithFloat:customization.cameraFrameCornerRadius];
584
+ result[@"livenessAnimationPositionMultiplier"] = [NSNumber numberWithFloat:customization.livenessAnimationPositionMultiplier];
585
+ result[@"activityIndicatorPortraitPositionMultiplier"] = [NSNumber numberWithFloat:customization.activityIndicatorPortraitPositionMultiplier];
586
+ result[@"activityIndicatorLandscapePositionMultiplier"] = [NSNumber numberWithFloat:customization.activityIndicatorLandscapePositionMultiplier];
587
+ result[@"cameraPreviewVerticalPositionMultiplier"] = [NSNumber numberWithFloat:customization.previewLayerPositionMultiplier];
588
+ result[@"multipageButtonPositionMultiplier"] = [NSNumber numberWithFloat:customization.multipageButtonPositionMultiplier];
589
+
590
+ // Drawable
591
+ result[@"multipageAnimationFrontImage"] = [RGLWJSONConstructor base64WithImage:customization.multipageAnimationFrontImage];
592
+ result[@"multipageAnimationBackImage"] = [RGLWJSONConstructor base64WithImage:customization.multipageAnimationBackImage];
593
+ result[@"borderBackgroundImage"] = [RGLWJSONConstructor base64WithImage:customization.borderBackgroundImage];
594
+ result[@"helpAnimationImage"] = [RGLWJSONConstructor base64WithImage:customization.helpAnimationImage];
595
+ result[@"closeButtonImage"] = [RGLWJSONConstructor base64WithImage:customization.closeButtonImage];
596
+ result[@"captureButtonImage"] = [RGLWJSONConstructor base64WithImage:customization.captureButtonImage];
597
+ result[@"changeFrameButtonCollapseImage"] = [RGLWJSONConstructor base64WithImage:customization.changeFrameButtonCollapseImage];
598
+ result[@"changeFrameButtonExpandImage"] = [RGLWJSONConstructor base64WithImage:customization.changeFrameButtonExpandImage];
599
+ result[@"cameraSwitchButtonImage"] = [RGLWJSONConstructor base64WithImage:customization.cameraSwitchButtonImage];
600
+ result[@"torchButtonOnImage"] = [RGLWJSONConstructor base64WithImage:customization.torchButtonOnImage];
601
+ result[@"torchButtonOffImage"] = [RGLWJSONConstructor base64WithImage:customization.torchButtonOffImage];
602
+ result[@"livenessAnimationImage"] = [RGLWJSONConstructor base64WithImage:customization.livenessAnimationImage];
603
+ result[@"multipageButtonImage"] = [RGLWJSONConstructor base64WithImage:customization.multipageButtonImage];
604
+
605
+ // Font
606
+ result[@"statusTextFont"] = [self generateUIFont:customization.statusTextFont];
607
+ result[@"resultStatusTextFont"] = [self generateUIFont:customization.resultStatusTextFont];
608
+ result[@"multipageButtonTextFont"] = [self generateUIFont:customization.multipageButtonTextFont];
609
+
610
+ // Custom
611
+ if(customization.customLabelStatus != nil) result[@"customLabelStatus"] = customization.customLabelStatus.string;
612
+ result[@"cameraFrameLineCap"] = [self generateLineCap:customization.cameraFrameLineCap];
613
+ result[@"uiCustomizationLayer"] = customization.customUILayerJSON;
614
+
615
+ // ContentMode
616
+ result[@"helpAnimationImageContentMode"] = [self generateViewContentMode:customization.helpAnimationImageContentMode];
617
+ result[@"multipageAnimationFrontImageContentMode"] = [self generateViewContentMode:customization.multipageAnimationFrontImageContentMode];
618
+ result[@"multipageAnimationBackImageContentMode"] = [self generateViewContentMode:customization.multipageAnimationBackImageContentMode];
619
+ result[@"livenessAnimationImageContentMode"] = [self generateViewContentMode:customization.livenessAnimationImageContentMode];
620
+ result[@"borderBackgroundImageContentMode"] = [self generateViewContentMode:customization.borderBackgroundImageContentMode];
621
+
622
+ result[@"colors"] = [self getColors: [customization.uiConfiguration valueForKey:@"colors"]];
623
+ result[@"fonts"] = [self getFonts: [customization.uiConfiguration valueForKey:@"fonts"]];
624
+ result[@"images"] = [self getImages: [customization.uiConfiguration valueForKey:@"images"]];
625
+ result[@"timings"] = [self getTimings: [customization.uiConfiguration valueForKey:@"timings"]];
626
+ result[@"contentModes"] = [self getContentModes: [customization.uiConfiguration valueForKey:@"contentModes"]];
627
+
628
+ return result;
629
+ }
630
+
631
+ +(void)setRfidScenario:(NSDictionary*)options :(RGLRFIDScenario*)rfidScenario {
632
+ // Boolean
633
+ if([options valueForKey:@"paceStaticBinding"] != nil)
634
+ rfidScenario.paceStaticBinding = [[options valueForKey:@"paceStaticBinding"] boolValue];
635
+ if([options valueForKey:@"onlineTA"] != nil)
636
+ rfidScenario.onlineTA = [[options valueForKey:@"onlineTA"] boolValue];
637
+ if([options valueForKey:@"writeEid"] != nil)
638
+ rfidScenario.writeEid = [[options valueForKey:@"writeEid"] boolValue];
639
+ if([options valueForKey:@"universalAccessRights"] != nil)
640
+ rfidScenario.universalAccessRights = [[options valueForKey:@"universalAccessRights"] boolValue];
641
+ if([options valueForKey:@"authorizedRestrictedIdentification"] != nil)
642
+ rfidScenario.authorizedRestrictedIdentification = [[options valueForKey:@"authorizedRestrictedIdentification"] boolValue];
643
+ if([options valueForKey:@"auxVerificationCommunityID"] != nil)
644
+ rfidScenario.auxVerificationCommunityID = [[options valueForKey:@"auxVerificationCommunityID"] boolValue];
645
+ if([options valueForKey:@"auxVerificationDateOfBirth"] != nil)
646
+ rfidScenario.auxVerificationDateOfBirth = [[options valueForKey:@"auxVerificationDateOfBirth"] boolValue];
647
+ if([options valueForKey:@"skipAA"] != nil)
648
+ rfidScenario.skipAA = [[options valueForKey:@"skipAA"] boolValue];
649
+ if([options valueForKey:@"strictProcessing"] != nil)
650
+ rfidScenario.strictProcessing = [[options valueForKey:@"strictProcessing"] boolValue];
651
+ if([options valueForKey:@"pkdDSCertPriority"] != nil)
652
+ rfidScenario.pkdDSCertPriority = [[options valueForKey:@"pkdDSCertPriority"] boolValue];
653
+ if([options valueForKey:@"pkdUseExternalCSCA"] != nil)
654
+ rfidScenario.pkdUseExternalCSCA = [[options valueForKey:@"pkdUseExternalCSCA"] boolValue];
655
+ if([options valueForKey:@"trustedPKD"] != nil)
656
+ rfidScenario.trustedPKD = [[options valueForKey:@"trustedPKD"] boolValue];
657
+ if([options valueForKey:@"passiveAuth"] != nil)
658
+ rfidScenario.passiveAuth = [[options valueForKey:@"passiveAuth"] boolValue];
659
+ if([options valueForKey:@"useSFI"] != nil)
660
+ rfidScenario.useSFI = [[options valueForKey:@"useSFI"] boolValue];
661
+ if([options valueForKey:@"readEPassport"] != nil)
662
+ rfidScenario.readEPassport = [[options valueForKey:@"readEPassport"] boolValue];
663
+ if([options valueForKey:@"readEID"] != nil)
664
+ rfidScenario.readEID = [[options valueForKey:@"readEID"] boolValue];
665
+ if([options valueForKey:@"readEDL"] != nil)
666
+ rfidScenario.readEDL = [[options valueForKey:@"readEDL"] boolValue];
667
+ if([options valueForKey:@"authorizedSTSignature"] != nil)
668
+ rfidScenario.authorizedSTSignature = [[options valueForKey:@"authorizedSTSignature"] boolValue];
669
+ if([options valueForKey:@"authorizedSTQSignature"] != nil)
670
+ rfidScenario.authorizedSTQSignature = [[options valueForKey:@"authorizedSTQSignature"] boolValue];
671
+ if([options valueForKey:@"authorizedWriteDG17"] != nil)
672
+ rfidScenario.authorizedWriteDG17 = [[options valueForKey:@"authorizedWriteDG17"] boolValue];
673
+ if([options valueForKey:@"authorizedWriteDG18"] != nil)
674
+ rfidScenario.authorizedWriteDG18 = [[options valueForKey:@"authorizedWriteDG18"] boolValue];
675
+ if([options valueForKey:@"authorizedWriteDG19"] != nil)
676
+ rfidScenario.authorizedWriteDG19 = [[options valueForKey:@"authorizedWriteDG19"] boolValue];
677
+ if([options valueForKey:@"authorizedWriteDG20"] != nil)
678
+ rfidScenario.authorizedWriteDG20 = [[options valueForKey:@"authorizedWriteDG20"] boolValue];
679
+ if([options valueForKey:@"authorizedWriteDG21"] != nil)
680
+ rfidScenario.authorizedWriteDG21 = [[options valueForKey:@"authorizedWriteDG21"] boolValue];
681
+ if([options valueForKey:@"authorizedVerifyAge"] != nil)
682
+ rfidScenario.authorizedVerifyAge = [[options valueForKey:@"authorizedVerifyAge"] boolValue];
683
+ if([options valueForKey:@"authorizedVerifyCommunityID"] != nil)
684
+ rfidScenario.authorizedVerifyCommunityID = [[options valueForKey:@"authorizedVerifyCommunityID"] boolValue];
685
+ if([options valueForKey:@"authorizedPrivilegedTerminal"] != nil)
686
+ rfidScenario.authorizedPrivilegedTerminal = [[options valueForKey:@"authorizedPrivilegedTerminal"] boolValue];
687
+ if([options valueForKey:@"authorizedCANAllowed"] != nil)
688
+ rfidScenario.authorizedCANAllowed = [[options valueForKey:@"authorizedCANAllowed"] boolValue];
689
+ if([options valueForKey:@"authorizedPINManagement"] != nil)
690
+ rfidScenario.authorizedPINManagment = [[options valueForKey:@"authorizedPINManagement"] boolValue];
691
+ if([options valueForKey:@"authorizedInstallCert"] != nil)
692
+ rfidScenario.authorizedInstallCert = [[options valueForKey:@"authorizedInstallCert"] boolValue];
693
+ if([options valueForKey:@"authorizedInstallQCert"] != nil)
694
+ rfidScenario.authorizedInstallQCert = [[options valueForKey:@"authorizedInstallQCert"] boolValue];
695
+ if([options valueForKey:@"applyAmendments"] != nil)
696
+ rfidScenario.applyAmendments = [[options valueForKey:@"applyAmendments"] boolValue];
697
+ if([options valueForKey:@"autoSettings"] != nil)
698
+ rfidScenario.autoSettings = [[options valueForKey:@"autoSettings"] boolValue];
699
+ if([options valueForKey:@"proceedReadingAlways"] != nil)
700
+ rfidScenario.proceedReadingAlways = [[options valueForKey:@"proceedReadingAlways"] boolValue];
701
+ if(options[@"readDTC"]) rfidScenario.readDTC = [options[@"readDTC"] boolValue];
702
+ if(options[@"mrzStrictCheck"]) rfidScenario.mrzStrictCheck = options[@"mrzStrictCheck"];
703
+ if(options[@"loadCRLFromRemote"]) rfidScenario.loadCRLFromRemote = [options[@"loadCRLFromRemote"] boolValue];
704
+ if(options[@"independentSODStatus"]) rfidScenario.independentSODStatus = options[@"independentSODStatus"];
705
+ if(options[@"readUser"]) rfidScenario.readUser = options[@"readUser"];
706
+
707
+ // Int
708
+ if([options valueForKey:@"signManagementAction"] != nil)
709
+ rfidScenario.signManagementAction = [[options valueForKey:@"signManagementAction"] integerValue];
710
+ if([options valueForKey:@"readingBuffer"] != nil)
711
+ rfidScenario.readingBuffer = [[options valueForKey:@"readingBuffer"] integerValue];
712
+ if([options valueForKey:@"onlineTAToSignDataType"] != nil)
713
+ rfidScenario.onlineTAToSignDataType = [[options valueForKey:@"onlineTAToSignDataType"] intValue];
714
+ if([options valueForKey:@"profilerType"] != nil)
715
+ rfidScenario.profilerType = [[options valueForKey:@"profilerType"] intValue];
716
+ if([options valueForKey:@"authProcType"] != nil)
717
+ rfidScenario.authProcType = [[options valueForKey:@"authProcType"] integerValue];
718
+ if([options valueForKey:@"baseSMProcedure"] != nil)
719
+ rfidScenario.baseSMProcedure = [[options valueForKey:@"baseSMProcedure"] integerValue];
720
+ if([options valueForKey:@"pacePasswordType"] != nil)
721
+ rfidScenario.pacePasswordType = [[options valueForKey:@"pacePasswordType"] integerValue];
722
+ if([options valueForKey:@"terminalType"] != nil)
723
+ rfidScenario.terminalType = [[options valueForKey:@"terminalType"] integerValue];
724
+ if([options valueForKey:@"defaultReadingBufferSize"] != nil)
725
+ rfidScenario.defaultReadingBufferSize = [[options valueForKey:@"defaultReadingBufferSize"] intValue];
726
+
727
+ // String
728
+ if([options valueForKey:@"password"] != nil)
729
+ rfidScenario.password = [options valueForKey:@"password"];
730
+ if([options valueForKey:@"pkdPA"] != nil)
731
+ rfidScenario.pkdPA = [options valueForKey:@"pkdPA"];
732
+ if([options valueForKey:@"pkdEAC"] != nil)
733
+ rfidScenario.pkdEAC = [options valueForKey:@"pkdEAC"];
734
+ if([options valueForKey:@"mrz"] != nil)
735
+ rfidScenario.mrz = [options valueForKey:@"mrz"];
736
+ if([options valueForKey:@"eSignPINDefault"] != nil)
737
+ rfidScenario.eSignPINDefault = [options valueForKey:@"eSignPINDefault"];
738
+ if([options valueForKey:@"eSignPINNewValue"] != nil)
739
+ rfidScenario.eSignPINNewValue = [options valueForKey:@"eSignPINNewValue"];
740
+ if(options[@"cardAccess"]) rfidScenario.cardAccess = options[@"cardAccess"];
741
+ if(options[@"mrzHash"]) rfidScenario.mrzHash = options[@"mrzHash"];
742
+ if(options[@"documentNumber"]) rfidScenario.documentNumber = options[@"documentNumber"];
743
+ if(options[@"dateOfBirth"]) rfidScenario.dateOfBirth = options[@"dateOfBirth"];
744
+ if(options[@"dateOfExpiry"]) rfidScenario.dateOfExpiry = options[@"dateOfExpiry"];
745
+ if(options[@"defaultUserPIN"]) rfidScenario.defaultUserPIN = options[@"defaultUserPIN"];
746
+
747
+ // DataGroup
748
+ if([options valueForKey:@"ePassportDataGroups"] != nil)
749
+ [self setDataGroups :rfidScenario.ePassportDataGroups dict:[options valueForKey:@"ePassportDataGroups"]];
750
+ if([options valueForKey:@"eIDDataGroups"] != nil)
751
+ [self setDataGroups :rfidScenario.eIDDataGroups dict:[options valueForKey:@"eIDDataGroups"]];
752
+ if([options valueForKey:@"eDLDataGroups"] != nil)
753
+ [self setDataGroups :rfidScenario.eDLDataGroups dict:[options valueForKey:@"eDLDataGroups"]];
754
+ if(options[@"dtcDataGroups"]) [self setDTCDataGroup :rfidScenario.DTCDataGroups dict:options[@"dtcDataGroups"]];
755
+ }
756
+
757
+ +(NSDictionary*)getRfidScenario:(RGLRFIDScenario*)rfidScenario {
758
+ NSMutableDictionary *result = [NSMutableDictionary new];
759
+
760
+ // Boolean
761
+ result[@"paceStaticBinding"] = [NSNumber numberWithBool:rfidScenario.paceStaticBinding];
762
+ result[@"onlineTA"] = [NSNumber numberWithBool:rfidScenario.onlineTA];
763
+ result[@"writeEid"] = [NSNumber numberWithBool:rfidScenario.writeEid];
764
+ result[@"universalAccessRights"] = [NSNumber numberWithBool:rfidScenario.universalAccessRights];
765
+ result[@"authorizedRestrictedIdentification"] = [NSNumber numberWithBool:rfidScenario.authorizedRestrictedIdentification];
766
+ result[@"auxVerificationCommunityID"] = [NSNumber numberWithBool:rfidScenario.auxVerificationCommunityID];
767
+ result[@"auxVerificationDateOfBirth"] = [NSNumber numberWithBool:rfidScenario.auxVerificationDateOfBirth];
768
+ result[@"skipAA"] = [NSNumber numberWithBool:rfidScenario.skipAA];
769
+ result[@"strictProcessing"] = [NSNumber numberWithBool:rfidScenario.strictProcessing];
770
+ result[@"pkdDSCertPriority"] = [NSNumber numberWithBool:rfidScenario.pkdDSCertPriority];
771
+ result[@"pkdUseExternalCSCA"] = [NSNumber numberWithBool:rfidScenario.pkdUseExternalCSCA];
772
+ result[@"trustedPKD"] = [NSNumber numberWithBool:rfidScenario.trustedPKD];
773
+ result[@"passiveAuth"] = [NSNumber numberWithBool:rfidScenario.passiveAuth];
774
+ result[@"useSFI"] = [NSNumber numberWithBool:rfidScenario.useSFI];
775
+ result[@"readEPassport"] = [NSNumber numberWithBool:rfidScenario.readEPassport];
776
+ result[@"readEID"] = [NSNumber numberWithBool:rfidScenario.readEID];
777
+ result[@"readEDL"] = [NSNumber numberWithBool:rfidScenario.readEDL];
778
+ result[@"authorizedSTSignature"] = [NSNumber numberWithBool:rfidScenario.authorizedSTSignature];
779
+ result[@"authorizedSTQSignature"] = [NSNumber numberWithBool:rfidScenario.authorizedSTQSignature];
780
+ result[@"authorizedWriteDG17"] = [NSNumber numberWithBool:rfidScenario.authorizedWriteDG17];
781
+ result[@"authorizedWriteDG18"] = [NSNumber numberWithBool:rfidScenario.authorizedWriteDG18];
782
+ result[@"authorizedWriteDG19"] = [NSNumber numberWithBool:rfidScenario.authorizedWriteDG19];
783
+ result[@"authorizedWriteDG20"] = [NSNumber numberWithBool:rfidScenario.authorizedWriteDG20];
784
+ result[@"authorizedWriteDG21"] = [NSNumber numberWithBool:rfidScenario.authorizedWriteDG21];
785
+ result[@"authorizedVerifyAge"] = [NSNumber numberWithBool:rfidScenario.authorizedVerifyAge];
786
+ result[@"authorizedVerifyCommunityID"] = [NSNumber numberWithBool:rfidScenario.authorizedVerifyCommunityID];
787
+ result[@"authorizedPrivilegedTerminal"] = [NSNumber numberWithBool:rfidScenario.authorizedPrivilegedTerminal];
788
+ result[@"authorizedCANAllowed"] = [NSNumber numberWithBool:rfidScenario.authorizedCANAllowed];
789
+ result[@"authorizedPINManagement"] = [NSNumber numberWithBool:rfidScenario.authorizedPINManagment];
790
+ result[@"authorizedInstallCert"] = [NSNumber numberWithBool:rfidScenario.authorizedInstallCert];
791
+ result[@"authorizedInstallQCert"] = [NSNumber numberWithBool:rfidScenario.authorizedInstallQCert];
792
+ result[@"applyAmendments"] = [NSNumber numberWithBool:rfidScenario.applyAmendments];
793
+ result[@"autoSettings"] = [NSNumber numberWithBool:rfidScenario.autoSettings];
794
+ result[@"proceedReadingAlways"] = [NSNumber numberWithBool:rfidScenario.proceedReadingAlways];
795
+ result[@"readDTC"] = [NSNumber numberWithBool:rfidScenario.readDTC];
796
+ result[@"mrzStrictCheck"] = rfidScenario.mrzStrictCheck;
797
+ result[@"loadCRLFromRemote"] = @(rfidScenario.loadCRLFromRemote);
798
+ result[@"independentSODStatus"] = rfidScenario.independentSODStatus;
799
+ result[@"readUser"] = rfidScenario.readUser;
800
+
801
+ // Int
802
+ result[@"signManagementAction"] = [NSNumber numberWithInteger:rfidScenario.signManagementAction];
803
+ result[@"readingBuffer"] = [NSNumber numberWithInteger:rfidScenario.readingBuffer];
804
+ result[@"onlineTAToSignDataType"] = [NSNumber numberWithInteger:rfidScenario.onlineTAToSignDataType];
805
+ result[@"profilerType"] = [NSNumber numberWithInteger:rfidScenario.profilerType];
806
+ result[@"authProcType"] = [NSNumber numberWithInteger:rfidScenario.authProcType];
807
+ result[@"baseSMProcedure"] = [NSNumber numberWithInteger:rfidScenario.baseSMProcedure];
808
+ result[@"pacePasswordType"] = [NSNumber numberWithInteger:rfidScenario.pacePasswordType];
809
+ result[@"terminalType"] = [NSNumber numberWithInteger:rfidScenario.terminalType];
810
+ result[@"defaultReadingBufferSize"] = [NSNumber numberWithInteger:rfidScenario.defaultReadingBufferSize];
811
+
812
+ // String
813
+ result[@"password"] = rfidScenario.password;
814
+ result[@"pkdPA"] = rfidScenario.pkdPA;
815
+ result[@"pkdEAC"] = rfidScenario.pkdEAC;
816
+ result[@"mrz"] = rfidScenario.mrz;
817
+ result[@"eSignPINDefault"] = rfidScenario.eSignPINDefault;
818
+ result[@"eSignPINNewValue"] = rfidScenario.eSignPINNewValue;
819
+ result[@"cardAccess"] = rfidScenario.cardAccess;
820
+ result[@"mrzHash"] = rfidScenario.mrzHash;
821
+ result[@"documentNumber"] = rfidScenario.documentNumber;
822
+ result[@"dateOfBirth"] = rfidScenario.dateOfBirth;
823
+ result[@"dateOfExpiry"] = rfidScenario.dateOfExpiry;
824
+ result[@"defaultUserPIN"] = rfidScenario.defaultUserPIN;
825
+
826
+ // DataGroup
827
+ result[@"eDLDataGroups"] = [self getDataGroups:rfidScenario.eDLDataGroups];
828
+ result[@"ePassportDataGroups"] = [self getDataGroups:rfidScenario.ePassportDataGroups];
829
+ result[@"eIDDataGroups"] = [self getDataGroups:rfidScenario.eIDDataGroups];
830
+ result[@"dtcDataGroups"] = [self getDTCDataGroup:rfidScenario.DTCDataGroups];
831
+
832
+ return result;
833
+ }
834
+
835
+ +(void)setDataGroups:(RGLDataGroup*)dataGroup dict:(NSDictionary*)dict {
836
+
837
+ // EDLDataGroups/Common: 1-14
838
+ if([dict valueForKey:@"DG1"] != nil)
839
+ dataGroup.dG1 = [[dict valueForKey:@"DG1"] boolValue];
840
+ if([dict valueForKey:@"DG2"] != nil)
841
+ dataGroup.dG2 = [[dict valueForKey:@"DG2"] boolValue];
842
+ if([dict valueForKey:@"DG3"] != nil)
843
+ dataGroup.dG3 = [[dict valueForKey:@"DG3"] boolValue];
844
+ if([dict valueForKey:@"DG4"] != nil)
845
+ dataGroup.dG4 = [[dict valueForKey:@"DG4"] boolValue];
846
+ if([dict valueForKey:@"DG5"] != nil)
847
+ dataGroup.dG5 = [[dict valueForKey:@"DG5"] boolValue];
848
+ if([dict valueForKey:@"DG6"] != nil)
849
+ dataGroup.dG6 = [[dict valueForKey:@"DG6"] boolValue];
850
+ if([dict valueForKey:@"DG7"] != nil)
851
+ dataGroup.dG7 = [[dict valueForKey:@"DG7"] boolValue];
852
+ if([dict valueForKey:@"DG8"] != nil)
853
+ dataGroup.dG8 = [[dict valueForKey:@"DG8"] boolValue];
854
+ if([dict valueForKey:@"DG9"] != nil)
855
+ dataGroup.dG9 = [[dict valueForKey:@"DG9"] boolValue];
856
+ if([dict valueForKey:@"DG10"] != nil)
857
+ dataGroup.dG10 = [[dict valueForKey:@"DG10"] boolValue];
858
+ if([dict valueForKey:@"DG11"] != nil)
859
+ dataGroup.dG11 = [[dict valueForKey:@"DG11"] boolValue];
860
+ if([dict valueForKey:@"DG12"] != nil)
861
+ dataGroup.dG12 = [[dict valueForKey:@"DG12"] boolValue];
862
+ if([dict valueForKey:@"DG13"] != nil)
863
+ dataGroup.dG13 = [[dict valueForKey:@"DG13"] boolValue];
864
+ if([dict valueForKey:@"DG14"] != nil)
865
+ dataGroup.dG14 = [[dict valueForKey:@"DG14"] boolValue];
866
+
867
+ // EPassportDataGroups: 1-16
868
+ if ([dataGroup class] == [RGLePassportDataGroup class]) {
869
+ if([dict valueForKey:@"DG15"] != nil)
870
+ ((RGLePassportDataGroup*)dataGroup).dG15 = [[dict valueForKey:@"DG15"] boolValue];
871
+ if([dict valueForKey:@"DG16"] != nil)
872
+ ((RGLePassportDataGroup*)dataGroup).dG16 = [[dict valueForKey:@"DG16"] boolValue];
873
+ }
874
+
875
+ // EIDDataGroups: 1-21
876
+ if ([dataGroup class] == [RGLeIDDataGroup class]) {
877
+ if([dict valueForKey:@"DG15"] != nil)
878
+ ((RGLeIDDataGroup*)dataGroup).dG15 = [[dict valueForKey:@"DG15"] boolValue];
879
+ if([dict valueForKey:@"DG16"] != nil)
880
+ ((RGLeIDDataGroup*)dataGroup).dG16 = [[dict valueForKey:@"DG16"] boolValue];
881
+ if([dict valueForKey:@"DG17"] != nil)
882
+ ((RGLeIDDataGroup*)dataGroup).dG17 = [[dict valueForKey:@"DG17"] boolValue];
883
+ if([dict valueForKey:@"DG18"] != nil)
884
+ ((RGLeIDDataGroup*)dataGroup).dG18 = [[dict valueForKey:@"DG18"] boolValue];
885
+ if([dict valueForKey:@"DG19"] != nil)
886
+ ((RGLeIDDataGroup*)dataGroup).dG19 = [[dict valueForKey:@"DG19"] boolValue];
887
+ if([dict valueForKey:@"DG20"] != nil)
888
+ ((RGLeIDDataGroup*)dataGroup).dG20 = [[dict valueForKey:@"DG20"] boolValue];
889
+ if([dict valueForKey:@"DG21"] != nil)
890
+ ((RGLeIDDataGroup*)dataGroup).dG21 = [[dict valueForKey:@"DG21"] boolValue];
891
+ }
892
+ }
893
+
894
+ +(NSDictionary *)getDataGroups:(RGLDataGroup*)dataGroup {
895
+ NSMutableDictionary *result = [NSMutableDictionary new];
896
+
897
+ // EDLDataGroups/Common: 1-14
898
+ result[@"DG1"] = [NSNumber numberWithBool:dataGroup.dG1];
899
+ result[@"DG2"] = [NSNumber numberWithBool:dataGroup.dG2];
900
+ result[@"DG3"] = [NSNumber numberWithBool:dataGroup.dG3];
901
+ result[@"DG4"] = [NSNumber numberWithBool:dataGroup.dG4];
902
+ result[@"DG5"] = [NSNumber numberWithBool:dataGroup.dG5];
903
+ result[@"DG6"] = [NSNumber numberWithBool:dataGroup.dG6];
904
+ result[@"DG7"] = [NSNumber numberWithBool:dataGroup.dG7];
905
+ result[@"DG8"] = [NSNumber numberWithBool:dataGroup.dG8];
906
+ result[@"DG9"] = [NSNumber numberWithBool:dataGroup.dG9];
907
+ result[@"DG10"] = [NSNumber numberWithBool:dataGroup.dG10];
908
+ result[@"DG11"] = [NSNumber numberWithBool:dataGroup.dG11];
909
+ result[@"DG12"] = [NSNumber numberWithBool:dataGroup.dG12];
910
+ result[@"DG13"] = [NSNumber numberWithBool:dataGroup.dG13];
911
+ result[@"DG14"] = [NSNumber numberWithBool:dataGroup.dG14];
912
+
913
+ // EPassportDataGroups: 1-16
914
+ if ([dataGroup class] == [RGLePassportDataGroup class]) {
915
+ result[@"DG15"] = [NSNumber numberWithBool:((RGLePassportDataGroup*)dataGroup).dG15];
916
+ result[@"DG16"] = [NSNumber numberWithBool:((RGLePassportDataGroup*)dataGroup).dG16];
917
+ }
918
+
919
+ // EIDDataGroups: 1-21
920
+ if ([dataGroup class] == [RGLeIDDataGroup class]) {
921
+ result[@"DG15"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG15];
922
+ result[@"DG16"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG16];
923
+ result[@"DG17"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG17];
924
+ result[@"DG18"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG18];
925
+ result[@"DG19"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG19];
926
+ result[@"DG20"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG20];
927
+ result[@"DG21"] = [NSNumber numberWithBool:((RGLeIDDataGroup*)dataGroup).dG21];
928
+ }
929
+
930
+ return result;
931
+ }
932
+
933
+ +(void)setDTCDataGroup:(RGLDTCDataGroup*)dataGroup dict:(NSDictionary*)dict {
934
+ if(dict[@"DG17"]) dataGroup.dG17 = [dict[@"DG17"] boolValue];
935
+ if(dict[@"DG18"]) dataGroup.dG18 = [dict[@"DG18"] boolValue];
936
+ if(dict[@"DG22"]) dataGroup.dG22 = [dict[@"DG22"] boolValue];
937
+ if(dict[@"DG23"]) dataGroup.dG23 = [dict[@"DG23"] boolValue];
938
+ if(dict[@"DG24"]) dataGroup.dG24 = [dict[@"DG24"] boolValue];
939
+ }
940
+
941
+ +(NSDictionary *)getDTCDataGroup:(RGLDTCDataGroup*)dataGroup {
942
+ NSMutableDictionary *result = [NSMutableDictionary new];
943
+
944
+ result[@"DG17"] = @(dataGroup.dG17);
945
+ result[@"DG18"] = @(dataGroup.dG18);
946
+ result[@"DG22"] = @(dataGroup.dG22);
947
+ result[@"DG23"] = @(dataGroup.dG23);
948
+ result[@"DG24"] = @(dataGroup.dG24);
949
+
950
+ return result;
951
+ }
952
+
953
+ +(void)setImageQA:(RGLImageQA*)result input:(NSDictionary*)input {
954
+ if([input valueForKey:@"dpiThreshold"] != nil)
955
+ result.dpiThreshold = [input valueForKey:@"dpiThreshold"];
956
+ if([input valueForKey:@"angleThreshold"] != nil)
957
+ result.angleThreshold = [input valueForKey:@"angleThreshold"];
958
+ if([input valueForKey:@"focusCheck"] != nil)
959
+ result.focusCheck = [input valueForKey:@"focusCheck"];
960
+ if([input valueForKey:@"glaresCheck"] != nil)
961
+ result.glaresCheck = [input valueForKey:@"glaresCheck"];
962
+ if([input valueForKey:@"colornessCheck"] != nil)
963
+ result.colornessCheck = [input valueForKey:@"colornessCheck"];
964
+ if([input valueForKey:@"screenCapture"] != nil)
965
+ result.screenCapture = [input valueForKey:@"screenCapture"];
966
+ if (input[@"expectedPass"]) {
967
+ NSMutableArray<RGLImageQualityCheckType>* expectedPass = @[].mutableCopy;
968
+ for(NSNumber* item in input[@"expectedPass"]) [expectedPass addObject:[self imageQualityCheckTypeWithNumber:item]];
969
+ result.expectedPass = expectedPass;
970
+ }
971
+ if([input valueForKey:@"documentPositionIndent"] != nil)
972
+ result.documentPositionIndent = [input valueForKey:@"documentPositionIndent"];
973
+ if([input valueForKey:@"glaresCheckParams"] != nil)
974
+ result.glaresCheckParams = [RGLWJSONConstructor glaresCheckParamsFromJson:[input valueForKey:@"glaresCheckParams"]];
975
+ if([input valueForKey:@"brightnessThreshold"] != nil)
976
+ result.brightnessThreshold = [input valueForKey:@"brightnessThreshold"];
977
+ if(input[@"occlusionCheck"]) result.occlusionCheck = input[@"occlusionCheck"];
978
+ if([input valueForKey:@"occlusionCheckParams"] != nil)
979
+ result.occlusionCheckParams = [RGLWJSONConstructor occlusionCheckParamsFromJson:[input valueForKey:@"occlusionCheckParams"]];
980
+ }
981
+
982
+ +(NSDictionary*)getImageQA:(RGLImageQA*)input {
983
+ NSMutableDictionary *result = [NSMutableDictionary new];
984
+
985
+ result[@"dpiThreshold"] = input.dpiThreshold;
986
+ result[@"angleThreshold"] = input.angleThreshold;
987
+ result[@"focusCheck"] = input.focusCheck;
988
+ result[@"glaresCheck"] = input.glaresCheck;
989
+ result[@"colornessCheck"] = input.colornessCheck;
990
+ result[@"screenCapture"] = input.screenCapture;
991
+ if (input.expectedPass) {
992
+ NSMutableArray<NSNumber*>* expectedPass = @[].mutableCopy;
993
+ for(RGLImageQualityCheckType item in input.expectedPass) [expectedPass addObject:[self generateImageQualityCheckType:item]];
994
+ result[@"expectedPass"] = expectedPass;
995
+ }
996
+ result[@"documentPositionIndent"] = input.documentPositionIndent;
997
+ result[@"glaresCheckParams"] = [RGLWJSONConstructor generateGlaresCheckParams:input.glaresCheckParams];
998
+ result[@"brightnessThreshold"] = input.brightnessThreshold;
999
+ result[@"occlusionCheck"] = input.occlusionCheck;
1000
+ result[@"occlusionCheckParams"] = [RGLWJSONConstructor generateOcclusionCheckParams:input.occlusionCheckParams];
1001
+
1002
+ return result;
1003
+ }
1004
+
1005
+ +(void)setAuthenticityParams:(RGLAuthenticityParams*)result input:(NSDictionary*)input {
1006
+ if([input valueForKey:@"useLivenessCheck"] != nil)
1007
+ result.useLivenessCheck = [input valueForKey:@"useLivenessCheck"];
1008
+ if([input valueForKey:@"checkUVLuminiscence"] != nil)
1009
+ result.checkUVLuminiscence = [input valueForKey:@"checkUVLuminiscence"];
1010
+ if([input valueForKey:@"checkIRB900"] != nil)
1011
+ result.checkIRB900 = [input valueForKey:@"checkIRB900"];
1012
+ if([input valueForKey:@"checkImagePatterns"] != nil)
1013
+ result.checkImagePatterns = [input valueForKey:@"checkImagePatterns"];
1014
+ if([input valueForKey:@"checkFibers"] != nil)
1015
+ result.checkFibers = [input valueForKey:@"checkFibers"];
1016
+ if([input valueForKey:@"checkExtMRZ"] != nil)
1017
+ result.checkExtMRZ = [input valueForKey:@"checkExtMRZ"];
1018
+ if([input valueForKey:@"checkExtOCR"] != nil)
1019
+ result.checkExtOCR = [input valueForKey:@"checkExtOCR"];
1020
+ if([input valueForKey:@"checkAxial"] != nil)
1021
+ result.checkAxial = [input valueForKey:@"checkAxial"];
1022
+ if([input valueForKey:@"checkBarcodeFormat"] != nil)
1023
+ result.checkBarcodeFormat = [input valueForKey:@"checkBarcodeFormat"];
1024
+ if([input valueForKey:@"checkIRVisibility"] != nil)
1025
+ result.checkIRVisibility = [input valueForKey:@"checkIRVisibility"];
1026
+ if([input valueForKey:@"checkIPI"] != nil)
1027
+ result.checkIPI = [input valueForKey:@"checkIPI"];
1028
+ if([input valueForKey:@"checkPhotoEmbedding"] != nil)
1029
+ result.checkPhotoEmbedding = [input valueForKey:@"checkPhotoEmbedding"];
1030
+ if([input valueForKey:@"checkPhotoComparison"] != nil)
1031
+ result.checkPhotoComparison = [input valueForKey:@"checkPhotoComparison"];
1032
+ if([input valueForKey:@"checkLetterScreen"] != nil)
1033
+ result.checkLetterScreen = [input valueForKey:@"checkLetterScreen"];
1034
+ if(input[@"checkSecurityText"]) result.checkSecurityText = input[@"checkSecurityText"];
1035
+ if(input[@"checkProperties"]) result.checkProperties = input[@"checkProperties"];
1036
+ if(input[@"livenessParams"]) {
1037
+ if(!result.livenessParams) result.livenessParams = [RGLLivenessParams defaultParams];
1038
+ [self setLivenessParams:result.livenessParams input:input[@"livenessParams"]];
1039
+ }
1040
+ if(input[@"propertiesParams"]) {
1041
+ if(!result.propertiesParams) result.propertiesParams = [RGLAuthenticityPropertiesParams defaultParams];
1042
+ [self setAuthenticityPropertiesParams:result.propertiesParams input:input[@"propertiesParams"]];
1043
+ }
1044
+ }
1045
+
1046
+ +(NSDictionary*)getAuthenticityParams:(RGLAuthenticityParams*)input {
1047
+ if(input == nil) return nil;
1048
+ NSMutableDictionary *result = [NSMutableDictionary new];
1049
+
1050
+ result[@"useLivenessCheck"] = input.useLivenessCheck;
1051
+ result[@"checkUVLuminiscence"] = input.checkUVLuminiscence;
1052
+ result[@"checkIRB900"] = input.checkIRB900;
1053
+ result[@"checkImagePatterns"] = input.checkImagePatterns;
1054
+ result[@"checkFibers"] = input.checkFibers;
1055
+ result[@"checkExtMRZ"] = input.checkExtMRZ;
1056
+ result[@"checkExtOCR"] = input.checkExtOCR;
1057
+ result[@"checkAxial"] = input.checkAxial;
1058
+ result[@"checkBarcodeFormat"] = input.checkBarcodeFormat;
1059
+ result[@"checkIRVisibility"] = input.checkIRVisibility;
1060
+ result[@"checkIPI"] = input.checkIPI;
1061
+ result[@"checkPhotoEmbedding"] = input.checkPhotoEmbedding;
1062
+ result[@"checkPhotoComparison"] = input.checkPhotoComparison;
1063
+ result[@"checkLetterScreen"] = input.checkLetterScreen;
1064
+ result[@"checkSecurityText"] = input.checkSecurityText;
1065
+ result[@"checkProperties"] = input.checkProperties;
1066
+ result[@"livenessParams"] = [self getLivenessParams:input.livenessParams];
1067
+ result[@"propertiesParams"] = [self getAuthenticityPropertiesParams:input.propertiesParams];
1068
+
1069
+ return result;
1070
+ }
1071
+
1072
+ +(void)setLivenessParams:(RGLLivenessParams*)result input:(NSDictionary*)input {
1073
+ if([input valueForKey:@"checkOVI"] != nil)
1074
+ result.checkOVI = [input valueForKey:@"checkOVI"];
1075
+ if([input valueForKey:@"checkMLI"] != nil)
1076
+ result.checkMLI = [input valueForKey:@"checkMLI"];
1077
+ if([input valueForKey:@"checkHolo"] != nil)
1078
+ result.checkHolo = [input valueForKey:@"checkHolo"];
1079
+ if([input valueForKey:@"checkED"] != nil)
1080
+ result.checkED = [input valueForKey:@"checkED"];
1081
+ if(input[@"checkBlackAndWhiteCopy"]) result.checkBlackAndWhiteCopy = input[@"checkBlackAndWhiteCopy"];
1082
+ if(input[@"checkDynaprint"]) result.checkDynaprint = input[@"checkDynaprint"];
1083
+ if(input[@"checkGeometry"]) result.checkGeometry = input[@"checkGeometry"];
1084
+ if(input[@"checkBarcodeBackground"]) result.checkBarcodeBackground = input[@"checkBarcodeBackground"];
1085
+ }
1086
+
1087
+ +(NSDictionary*)getLivenessParams:(RGLLivenessParams*)input {
1088
+ if(input == nil) return nil;
1089
+ NSMutableDictionary *result = [NSMutableDictionary new];
1090
+
1091
+ result[@"checkOVI"] = input.checkOVI;
1092
+ result[@"checkMLI"] = input.checkMLI;
1093
+ result[@"checkHolo"] = input.checkHolo;
1094
+ result[@"checkED"] = input.checkED;
1095
+ result[@"checkBlackAndWhiteCopy"] = input.checkBlackAndWhiteCopy;
1096
+ result[@"checkDynaprint"] = input.checkDynaprint;
1097
+ result[@"checkGeometry"] = input.checkGeometry;
1098
+ result[@"checkBarcodeBackground"] = input.checkBarcodeBackground;
1099
+
1100
+ return result;
1101
+ }
1102
+
1103
+ +(void)setAuthenticityPropertiesParams:(RGLAuthenticityPropertiesParams*)result input:(NSDictionary*)input {
1104
+ if(input[@"checkHoldersSignature"]) result.checkHoldersSignature = input[@"checkHoldersSignature"];
1105
+ if(input[@"checkDocumentDamage"]) result.checkDocumentDamage = input[@"checkDocumentDamage"];
1106
+ }
1107
+
1108
+ +(NSDictionary*)getAuthenticityPropertiesParams:(RGLAuthenticityPropertiesParams*)input {
1109
+ if(input == nil) return nil;
1110
+ NSMutableDictionary *result = [NSMutableDictionary new];
1111
+
1112
+ result[@"checkHoldersSignature"] = input.checkHoldersSignature;
1113
+ result[@"checkDocumentDamage"] = input.checkDocumentDamage;
1114
+
1115
+ return result;
1116
+ }
1117
+
1118
+ +(void)setColors:(NSMutableDictionary*)result input:(NSDictionary*)input {
1119
+ if([input valueForKey:@"rfidProcessingScreenBackground"] != nil)
1120
+ result[@(RFIDProcessingScreenBackground)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenBackground"]];
1121
+ if([input valueForKey:@"rfidProcessingScreenHintLabelText"] != nil)
1122
+ result[@(RFIDProcessingScreenHintLabelText)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenHintLabelText"]];
1123
+ if([input valueForKey:@"rfidProcessingScreenHintLabelBackground"] != nil)
1124
+ result[@(RFIDProcessingScreenHintLabelBackground)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenHintLabelBackground"]];
1125
+ if([input valueForKey:@"rfidProcessingScreenProgressLabelText"] != nil)
1126
+ result[@(RFIDProcessingScreenProgressLabelText)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenProgressLabelText"]];
1127
+ if([input valueForKey:@"rfidProcessingScreenProgressBar"] != nil)
1128
+ result[@(RFIDProcessingScreenProgressBar)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenProgressBar"]];
1129
+ if([input valueForKey:@"rfidProcessingScreenProgressBarBackground"] != nil)
1130
+ result[@(RFIDProcessingScreenProgressBarBackground)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenProgressBarBackground"]];
1131
+ if([input valueForKey:@"rfidProcessingScreenResultLabelText"] != nil)
1132
+ result[@(RFIDProcessingScreenResultLabelText)] = [self colorWithInt:[input valueForKey:@"rfidProcessingScreenResultLabelText"]];
1133
+ if(input[@"rfidProcessingScreenLoadingBar"]) result[@(RFIDProcessingScreenLoadingBar)] = [self colorWithInt:input[@"rfidProcessingScreenLoadingBar"]];
1134
+ if(input[@"mdlProcessingScreenBackground"]) result[@(MDLProcessingScreenBackground)] = [self colorWithInt:input[@"mdlProcessingScreenBackground"]];
1135
+ if(input[@"mdlProcessingScreenHintLabelText"]) result[@(MDLProcessingScreenHintLabelText)] = [self colorWithInt:input[@"mdlProcessingScreenHintLabelText"]];
1136
+ if(input[@"mdlProcessingScreenHintLabelBackground"]) result[@(MDLProcessingScreenHintLabelBackground)] = [self colorWithInt:input[@"mdlProcessingScreenHintLabelBackground"]];
1137
+ if(input[@"mdlProcessingScreenProgressLabelText"]) result[@(MDLProcessingScreenProgressLabelText)] = [self colorWithInt:input[@"mdlProcessingScreenProgressLabelText"]];
1138
+ if(input[@"mdlProcessingScreenResultLabelText"]) result[@(MDLProcessingScreenResultLabelText)] = [self colorWithInt:input[@"mdlProcessingScreenResultLabelText"]];
1139
+ if(input[@"mdlProcessingScreenLoadingBar"]) result[@(MDLProcessingScreenLoadingBar)] = [self colorWithInt:input[@"mdlProcessingScreenLoadingBar"]];
1140
+ if(input[@"nextPageIdCardFront"]) result[@(RGLCustomizationColorNextPageIdCardFront)] = [self colorWithInt:input[@"nextPageIdCardFront"]];
1141
+ if(input[@"nextPageIdCardBack"]) result[@(RGLCustomizationColorNextPageIdCardBack)] = [self colorWithInt:input[@"nextPageIdCardBack"]];
1142
+ if(input[@"nextPagePassportShift"]) result[@(RGLCustomizationColorNextPagePassportShift)] = [self colorWithInt:input[@"nextPagePassportShift"]];
1143
+ if(input[@"nextPagePassportFlip"]) result[@(RGLCustomizationColorNextPagePassportFlip)] = [self colorWithInt:input[@"nextPagePassportFlip"]];
1144
+ }
1145
+
1146
+ +(NSDictionary*)getColors:(NSDictionary*)input {
1147
+ id result = @{}.mutableCopy;
1148
+
1149
+ if(input[@(RFIDProcessingScreenBackground)]) result[@"rfidProcessingScreenBackground"] = [self intWithColor:input[@(RFIDProcessingScreenBackground)]];
1150
+ if(input[@(RFIDProcessingScreenHintLabelText)]) result[@"rfidProcessingScreenHintLabelText"] = [self intWithColor:input[@(RFIDProcessingScreenHintLabelText)]];
1151
+ if(input[@(RFIDProcessingScreenHintLabelBackground)]) result[@"rfidProcessingScreenHintLabelBackground"] = [self intWithColor:input[@(RFIDProcessingScreenHintLabelBackground)]];
1152
+ if(input[@(RFIDProcessingScreenProgressLabelText)]) result[@"rfidProcessingScreenProgressLabelText"] = [self intWithColor:input[@(RFIDProcessingScreenProgressLabelText)]];
1153
+ if(input[@(RFIDProcessingScreenProgressBar)]) result[@"rfidProcessingScreenProgressBar"] = [self intWithColor:input[@(RFIDProcessingScreenProgressBar)]];
1154
+ if(input[@(RFIDProcessingScreenProgressBarBackground)]) result[@"rfidProcessingScreenProgressBarBackground"] = [self intWithColor:input[@(RFIDProcessingScreenProgressBarBackground)]];
1155
+ if(input[@(RFIDProcessingScreenResultLabelText)]) result[@"rfidProcessingScreenResultLabelText"] = [self intWithColor:input[@(RFIDProcessingScreenResultLabelText)]];
1156
+ if(input[@(RFIDProcessingScreenLoadingBar)]) result[@"rfidProcessingScreenLoadingBar"] = [self intWithColor:input[@(RFIDProcessingScreenLoadingBar)]];
1157
+ if(input[@(MDLProcessingScreenBackground)]) result[@"mdlProcessingScreenBackground"] = [self intWithColor:input[@(MDLProcessingScreenBackground)]];
1158
+ if(input[@(MDLProcessingScreenHintLabelText)]) result[@"mdlProcessingScreenHintLabelText"] = [self intWithColor:input[@(MDLProcessingScreenHintLabelText)]];
1159
+ if(input[@(MDLProcessingScreenHintLabelBackground)]) result[@"mdlProcessingScreenHintLabelBackground"] = [self intWithColor:input[@(MDLProcessingScreenHintLabelBackground)]];
1160
+ if(input[@(MDLProcessingScreenProgressLabelText)]) result[@"mdlProcessingScreenProgressLabelText"] = [self intWithColor:input[@(MDLProcessingScreenProgressLabelText)]];
1161
+ if(input[@(MDLProcessingScreenResultLabelText)]) result[@"mdlProcessingScreenResultLabelText"] = [self intWithColor:input[@(MDLProcessingScreenResultLabelText)]];
1162
+ if(input[@(MDLProcessingScreenLoadingBar)]) result[@"mdlProcessingScreenLoadingBar"] = [self intWithColor:input[@(MDLProcessingScreenLoadingBar)]];
1163
+ if(input[@(RGLCustomizationColorNextPageIdCardFront)]) result[@"nextPageIdCardFront"] = [self intWithColor:input[@(RGLCustomizationColorNextPageIdCardFront)]];
1164
+ if(input[@(RGLCustomizationColorNextPageIdCardBack)]) result[@"nextPageIdCardBack"] = [self intWithColor:input[@(RGLCustomizationColorNextPageIdCardBack)]];
1165
+ if(input[@(RGLCustomizationColorNextPagePassportShift)]) result[@"nextPagePassportShift"] = [self intWithColor:input[@(RGLCustomizationColorNextPagePassportShift)]];
1166
+ if(input[@(RGLCustomizationColorNextPagePassportFlip)]) result[@"nextPagePassportFlip"] = [self intWithColor:input[@(RGLCustomizationColorNextPagePassportFlip)]];
1167
+
1168
+ return result;
1169
+ }
1170
+
1171
+ +(void)setFonts:(NSMutableDictionary*)result input:(NSDictionary*)input {
1172
+ if([input valueForKey:@"rfidProcessingScreenHintLabel"] != nil)
1173
+ result[@(RFIDProcessingScreenHintLabel)] = [self UIFontFromJSON:[input valueForKey:@"rfidProcessingScreenHintLabel"]];
1174
+ if([input valueForKey:@"rfidProcessingScreenProgressLabel"] != nil)
1175
+ result[@(RFIDProcessingScreenProgressLabel)] = [self UIFontFromJSON:[input valueForKey:@"rfidProcessingScreenProgressLabel"]];
1176
+ if(input[@"rfidProcessingScreenResultLabel"]) result[@(RFIDProcessingScreenResultLabel)] = [self UIFontFromJSON:input[@"rfidProcessingScreenResultLabel"]];
1177
+ if(input[@"mdlProcessingScreenHintLabel"]) result[@(MDLProcessingScreenHintLabel)] = [self UIFontFromJSON:input[@"mdlProcessingScreenHintLabel"]];
1178
+ if(input[@"mdlProcessingScreenProgressLabel"]) result[@(MDLProcessingScreenProgressLabel)] = [self UIFontFromJSON:input[@"mdlProcessingScreenProgressLabel"]];
1179
+ if(input[@"mdlProcessingScreenResultLabel"]) result[@(MDLProcessingScreenResultLabel)] = [self UIFontFromJSON:input[@"mdlProcessingScreenResultLabel"]];
1180
+ }
1181
+
1182
+ +(NSDictionary*)getFonts:(NSDictionary*)input {
1183
+ return @{
1184
+ @"rfidProcessingScreenHintLabel": [self generateUIFont:input[@(RFIDProcessingScreenHintLabel)]],
1185
+ @"rfidProcessingScreenProgressLabel": [self generateUIFont:input[@(RFIDProcessingScreenProgressLabel)]],
1186
+ @"rfidProcessingScreenResultLabel": [self generateUIFont:input[@(RFIDProcessingScreenResultLabel)]],
1187
+ @"mdlProcessingScreenHintLabel": [self generateUIFont:input[@(MDLProcessingScreenHintLabel)]],
1188
+ @"mdlProcessingScreenProgressLabel": [self generateUIFont:input[@(MDLProcessingScreenProgressLabel)]],
1189
+ @"mdlProcessingScreenResultLabel": [self generateUIFont:input[@(MDLProcessingScreenResultLabel)]],
1190
+ };
1191
+ }
1192
+
1193
+ +(void)setImages:(NSMutableDictionary*)result input:(NSDictionary*)input {
1194
+ if(input[@"helpAnimation"]) result[RGLCustomizationImageHelpAnimation] = [RGLWJSONConstructor imageWithBase64:input[@"helpAnimation"]];
1195
+ if(input[@"livenessAnimation"]) result[RGLCustomizationImageLivenessAnimation] = [RGLWJSONConstructor imageWithBase64:input[@"livenessAnimation"]];
1196
+ if(input[@"borderBackground"]) result[RGLCustomizationImageBorderBackground] = [RGLWJSONConstructor imageWithBase64:input[@"borderBackground"]];
1197
+ if(input[@"torchButtonOn"]) result[RGLCustomizationImageTorchButtonOn] = [RGLWJSONConstructor imageWithBase64:input[@"torchButtonOn"]];
1198
+ if(input[@"torchButtonOff"]) result[RGLCustomizationImageTorchButtonOff] = [RGLWJSONConstructor imageWithBase64:input[@"torchButtonOff"]];
1199
+ if(input[@"captureButton"]) result[RGLCustomizationImageCaptureButton] = [RGLWJSONConstructor imageWithBase64:input[@"captureButton"]];
1200
+ if(input[@"switchButton"]) result[RGLCustomizationImageSwitchButton] = [RGLWJSONConstructor imageWithBase64:input[@"switchButton"]];
1201
+ if(input[@"closeButton"]) result[RGLCustomizationImageCloseButton] = [RGLWJSONConstructor imageWithBase64:input[@"closeButton"]];
1202
+ if(input[@"multipageButton"]) result[RGLCustomizationImageMultipageButton] = [RGLWJSONConstructor imageWithBase64:input[@"multipageButton"]];
1203
+ if(input[@"rfidProcessingScreenFailureImage"]) result[RGLCustomizationImageRFIDProcessingScreenFailure] = [RGLWJSONConstructor imageWithBase64:input[@"rfidProcessingScreenFailureImage"]];
1204
+ if(input[@"mdlProcessingScreenFailureImage"]) result[RGLCustomizationImageMDLProcessingScreenFailure] = [RGLWJSONConstructor imageWithBase64:input[@"mdlProcessingScreenFailureImage"]];
1205
+ if(input[@"nextPageIdCardFront"]) result[RGLCustomizationImageNextPageIdCardFront] = [RGLWJSONConstructor imageWithBase64:input[@"nextPageIdCardFront"]];
1206
+ if(input[@"nextPageIdCardBack"]) result[RGLCustomizationImageNextPageIdCardBack] = [RGLWJSONConstructor imageWithBase64:input[@"nextPageIdCardBack"]];
1207
+ if(input[@"nextPagePassportShift"]) result[RGLCustomizationImageNextPagePassportShift] = [RGLWJSONConstructor imageWithBase64:input[@"nextPagePassportShift"]];
1208
+ if(input[@"nextPagePassportFlipStart"]) result[RGLCustomizationImageNextPagePassportFlipStart] = [RGLWJSONConstructor imageWithBase64:input[@"nextPagePassportFlipStart"]];
1209
+ if(input[@"nextPagePassportFlipClean"]) result[RGLCustomizationImageNextPagePassportFlipClean] = [RGLWJSONConstructor imageWithBase64:input[@"nextPagePassportFlipClean"]];
1210
+ if(input[@"nextPagePassportFlipTop"]) result[RGLCustomizationImageNextPagePassportFlipTop] = [RGLWJSONConstructor imageWithBase64:input[@"nextPagePassportFlipTop"]];
1211
+ if(input[@"nextPagePassportFlipBottom"]) result[RGLCustomizationImageNextPagePassportFlipBottom] = [RGLWJSONConstructor imageWithBase64:input[@"nextPagePassportFlipBottom"]];
1212
+ }
1213
+
1214
+ +(NSDictionary*)getImages:(NSDictionary*)input {
1215
+ id result = @{}.mutableCopy;
1216
+ id i;
1217
+
1218
+ i = RGLCustomizationImageHelpAnimation;
1219
+ if(input[i]) result[@"helpAnimation"] = [RGLWJSONConstructor base64WithImage:input[i]];
1220
+ i = RGLCustomizationImageLivenessAnimation;
1221
+ if(input[i]) result[@"livenessAnimation"] = [RGLWJSONConstructor base64WithImage:input[i]];
1222
+ i = RGLCustomizationImageBorderBackground;
1223
+ if(input[i]) result[@"borderBackground"] = [RGLWJSONConstructor base64WithImage:input[i]];
1224
+ i = RGLCustomizationImageTorchButtonOn;
1225
+ if(input[i]) result[@"torchButtonOn"] = [RGLWJSONConstructor base64WithImage:input[i]];
1226
+ i = RGLCustomizationImageTorchButtonOff;
1227
+ if(input[i]) result[@"torchButtonOff"] = [RGLWJSONConstructor base64WithImage:input[i]];
1228
+ i = RGLCustomizationImageCaptureButton;
1229
+ if(input[i]) result[@"captureButton"] = [RGLWJSONConstructor base64WithImage:input[i]];
1230
+ i = RGLCustomizationImageSwitchButton;
1231
+ if(input[i]) result[@"switchButton"] = [RGLWJSONConstructor base64WithImage:input[i]];
1232
+ i = RGLCustomizationImageCloseButton;
1233
+ if(input[i]) result[@"closeButton"] = [RGLWJSONConstructor base64WithImage:input[i]];
1234
+ i = RGLCustomizationImageMultipageButton;
1235
+ if(input[i]) result[@"multipageButton"] = [RGLWJSONConstructor base64WithImage:input[i]];
1236
+ i = RGLCustomizationImageRFIDProcessingScreenFailure;
1237
+ if(input[i]) result[@"rfidProcessingScreenFailureImage"] = [RGLWJSONConstructor base64WithImage:input[i]];
1238
+ i = RGLCustomizationImageMDLProcessingScreenFailure;
1239
+ if(input[i]) result[@"mdlProcessingScreenFailureImage"] = [RGLWJSONConstructor base64WithImage:input[i]];
1240
+ i = RGLCustomizationImageNextPageIdCardFront;
1241
+ if(input[i]) result[@"nextPageIdCardFront"] = [RGLWJSONConstructor base64WithImage:input[i]];
1242
+ i = RGLCustomizationImageNextPageIdCardBack;
1243
+ if(input[i]) result[@"nextPageIdCardBack"] = [RGLWJSONConstructor base64WithImage:input[i]];
1244
+ i = RGLCustomizationImageNextPagePassportShift;
1245
+ if(input[i]) result[@"nextPagePassportShift"] = [RGLWJSONConstructor base64WithImage:input[i]];
1246
+ i = RGLCustomizationImageNextPagePassportFlipStart;
1247
+ if(input[i]) result[@"nextPagePassportFlipStart"] = [RGLWJSONConstructor base64WithImage:input[i]];
1248
+ i = RGLCustomizationImageNextPagePassportFlipClean;
1249
+ if(input[i]) result[@"nextPagePassportFlipClean"] = [RGLWJSONConstructor base64WithImage:input[i]];
1250
+ i = RGLCustomizationImageNextPagePassportFlipTop;
1251
+ if(input[i]) result[@"nextPagePassportFlipTop"] = [RGLWJSONConstructor base64WithImage:input[i]];
1252
+ i = RGLCustomizationImageNextPagePassportFlipBottom;
1253
+ if(input[i]) result[@"nextPagePassportFlipBottom"] = [RGLWJSONConstructor base64WithImage:input[i]];
1254
+
1255
+ return result;
1256
+ }
1257
+
1258
+ +(void)setTimings:(NSMutableDictionary*)result input:(NSDictionary*)input {
1259
+ if(input[@"nextPageIdCardStartDelay"]) result[@(RGLCustomizationTimingNextPageIdCardStartDelay)] = input[@"nextPageIdCardStartDelay"];
1260
+ if(input[@"nextPageIdCardEndDelay"]) result[@(RGLCustomizationTimingNextPageIdCardEndDelay)] = input[@"nextPageIdCardEndDelay"];
1261
+ if(input[@"nextPagePassportShiftStartDelay"]) result[@(RGLCustomizationTimingNextPagePassportShiftStartDelay)] = input[@"nextPagePassportShiftStartDelay"];
1262
+ if(input[@"nextPagePassportShiftEndDelay"]) result[@(RGLCustomizationTimingNextPagePassportShiftEndDelay)] = input[@"nextPagePassportShiftEndDelay"];
1263
+ if(input[@"nextPagePassportFlipStartDelay"]) result[@(RGLCustomizationTimingNextPagePassportFlipStartDelay)] = input[@"nextPagePassportFlipStartDelay"];
1264
+ if(input[@"nextPagePassportFlipEndDelay"]) result[@(RGLCustomizationTimingNextPagePassportFlipEndDelay)] = input[@"nextPagePassportFlipEndDelay"];
1265
+ }
1266
+
1267
+ +(NSDictionary*)getTimings:(NSDictionary*)input {
1268
+ id result = @{}.mutableCopy;
1269
+ id i;
1270
+
1271
+ i = @(RGLCustomizationTimingNextPageIdCardStartDelay);
1272
+ if(input[i]) result[@"nextPageIdCardStartDelay"] = input[i];
1273
+ i = @(RGLCustomizationTimingNextPageIdCardEndDelay);
1274
+ if(input[i]) result[@"nextPageIdCardEndDelay"] = input[i];
1275
+ i = @(RGLCustomizationTimingNextPagePassportShiftStartDelay);
1276
+ if(input[i]) result[@"nextPagePassportShiftStartDelay"] = input[i];
1277
+ i = @(RGLCustomizationTimingNextPagePassportShiftEndDelay);
1278
+ if(input[i]) result[@"nextPagePassportShiftEndDelay"] = input[i];
1279
+ i = @(RGLCustomizationTimingNextPagePassportFlipStartDelay);
1280
+ if(input[i]) result[@"nextPagePassportFlipStartDelay"] = input[i];
1281
+ i = @(RGLCustomizationTimingNextPagePassportFlipEndDelay);
1282
+ if(input[i]) result[@"nextPagePassportFlipEndDelay"] = input[i];
1283
+
1284
+ return result;
1285
+ }
1286
+
1287
+ +(void)setContentModes:(NSMutableDictionary*)result input:(NSDictionary*)input {
1288
+ if(input[@"nextPageIdCardFront"]) result[@(RGLCustomizationContentModeNextPageIdCardFront)] = input[@"nextPageIdCardFront"];
1289
+ if(input[@"nextPageIdCardBack"]) result[@(RGLCustomizationContentModeNextPageIdCardBack)] = input[@"nextPageIdCardBack"];
1290
+ }
1291
+
1292
+ +(NSDictionary*)getContentModes:(NSDictionary*)input {
1293
+ return @{
1294
+ @"nextPageIdCardFront": input[@(RGLCustomizationContentModeNextPageIdCardFront)],
1295
+ @"nextPageIdCardBack": input[@(RGLCustomizationContentModeNextPageIdCardBack)],
1296
+ };
1297
+ }
1298
+
1299
+ +(UIColor*)colorWithInt:(NSNumber*)input {
1300
+ // Convert hex int to hex string
1301
+ NSInteger hexInt = [input integerValue];
1302
+ NSString* numbers = @"0123456789ABCDEF";
1303
+ NSString* hexString = @"";
1304
+ while(hexInt>0){
1305
+ int digit = hexInt % 16;
1306
+ hexString = [NSString stringWithFormat:@"%@%@", [numbers substringWithRange:NSMakeRange(digit, 1)], hexString];
1307
+ hexInt = hexInt/16;
1308
+ }
1309
+ // If we use int, then all the starting zeros are lost: 0x0F123456 == 0xF123456
1310
+ if(hexString.length == 5 || hexString.length == 7)
1311
+ hexString = [NSString stringWithFormat:@"0%@", hexString];
1312
+ hexString = [NSString stringWithFormat:@"#%@", hexString];
1313
+
1314
+ // Convert hex string to UIColor
1315
+ NSString *colorString = [[hexString stringByReplacingOccurrencesOfString: @"#" withString: @""] uppercaseString];
1316
+ CGFloat alpha, red, blue, green;
1317
+ switch ([colorString length]) {
1318
+ case 3: // #RGB
1319
+ alpha = 1.0f;
1320
+ red = [self colorComponentFrom: colorString start: 0 length: 1];
1321
+ green = [self colorComponentFrom: colorString start: 1 length: 1];
1322
+ blue = [self colorComponentFrom: colorString start: 2 length: 1];
1323
+ break;
1324
+ case 4: // #ARGB
1325
+ alpha = [self colorComponentFrom: colorString start: 0 length: 1];
1326
+ red = [self colorComponentFrom: colorString start: 1 length: 1];
1327
+ green = [self colorComponentFrom: colorString start: 2 length: 1];
1328
+ blue = [self colorComponentFrom: colorString start: 3 length: 1];
1329
+ break;
1330
+ case 6: // #RRGGBB
1331
+ alpha = 1.0f;
1332
+ red = [self colorComponentFrom: colorString start: 0 length: 2];
1333
+ green = [self colorComponentFrom: colorString start: 2 length: 2];
1334
+ blue = [self colorComponentFrom: colorString start: 4 length: 2];
1335
+ break;
1336
+ case 8: // #AARRGGBB
1337
+ alpha = [self colorComponentFrom: colorString start: 0 length: 2];
1338
+ red = [self colorComponentFrom: colorString start: 2 length: 2];
1339
+ green = [self colorComponentFrom: colorString start: 4 length: 2];
1340
+ blue = [self colorComponentFrom: colorString start: 6 length: 2];
1341
+ break;
1342
+ default:
1343
+ [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];
1344
+ break;
1345
+ }
1346
+ return [UIColor colorWithRed: red green: green blue: blue alpha: alpha];
1347
+ }
1348
+
1349
+ +(CGFloat)colorComponentFrom:(NSString*)string start:(NSUInteger)start length:(NSUInteger)length {
1350
+ NSString *substring = [string substringWithRange: NSMakeRange(start, length)];
1351
+ NSString *fullHex = length == 2 ? substring : [NSString stringWithFormat: @"%@%@", substring, substring];
1352
+ unsigned hexComponent;
1353
+ [[NSScanner scannerWithString: fullHex] scanHexInt: &hexComponent];
1354
+ return hexComponent / 255.0;
1355
+ }
1356
+
1357
+ +(NSNumber*)intWithColor:(UIColor*)color {
1358
+ if(color == nil) return nil;
1359
+
1360
+ const CGFloat *components = CGColorGetComponents(color.CGColor);
1361
+ CGFloat r = components[0];
1362
+ CGFloat g = components[1];
1363
+ CGFloat b = components[2];
1364
+ CGFloat a = components[3];
1365
+
1366
+ NSString* hexString = [NSString stringWithFormat:@"#%02lX%02lX%02lX%02lX",
1367
+ lroundf(a * 255),
1368
+ lroundf(r * 255),
1369
+ lroundf(g * 255),
1370
+ lroundf(b * 255)];
1371
+
1372
+ unsigned int hexInt = 0;
1373
+ NSScanner *scanner = [NSScanner scannerWithString:hexString];
1374
+ [scanner setCharactersToBeSkipped:[NSCharacterSet characterSetWithCharactersInString:@"#"]];
1375
+ [scanner scanHexInt:&hexInt];
1376
+
1377
+ return [NSNumber numberWithInteger:hexInt];
1378
+ }
1379
+
1380
+ +(UIFont*)UIFontFromJSON:(NSDictionary*)input {
1381
+ UIFont* result = [UIFont fontWithName:[input valueForKey:@"name"] size:[[input valueForKey:@"size"] integerValue]];
1382
+ if (!result || !result.fontName) return nil;
1383
+ return result;
1384
+ }
1385
+
1386
+ +(NSDictionary*)generateUIFont:(UIFont*)input {
1387
+ if (!input || !input.fontName) return nil;
1388
+ return @{
1389
+ @"name": input.fontName,
1390
+ @"size": @(input.pointSize)
1391
+ };
1392
+ }
1393
+
1394
+ +(AVCaptureSessionPreset)captureSessionPresetWithNumber:(NSNumber*)value {
1395
+ int input = [value intValue];
1396
+ if(input == 0) return AVCaptureSessionPresetLow;
1397
+ if(input == 1) return AVCaptureSessionPresetMedium;
1398
+ if(input == 2) return AVCaptureSessionPresetHigh;
1399
+ if(input == 3) return AVCaptureSessionPresetPhoto;
1400
+ if(input == 4) return AVCaptureSessionPresetInputPriority;
1401
+ if(input == 6) return AVCaptureSessionPreset1280x720;
1402
+ if(input == 7) return AVCaptureSessionPreset1920x1080;
1403
+ if(input == 8) return AVCaptureSessionPreset3840x2160;
1404
+ if(input == 9) return AVCaptureSessionPresetiFrame960x540;
1405
+ if(input == 10) return AVCaptureSessionPresetiFrame1280x720;
1406
+ if(input == 12) return AVCaptureSessionPreset640x480;
1407
+ if(input == 13) return AVCaptureSessionPreset352x288;
1408
+ return AVCaptureSessionPreset1920x1080;
1409
+ }
1410
+
1411
+ +(NSNumber*)generateCaptureSessionPreset:(AVCaptureSessionPreset)value {
1412
+ if(value == AVCaptureSessionPresetLow) return @0;
1413
+ if(value == AVCaptureSessionPresetMedium) return @1;
1414
+ if(value == AVCaptureSessionPresetHigh) return @2;
1415
+ if(value == AVCaptureSessionPresetPhoto) return @3;
1416
+ if(value == AVCaptureSessionPresetInputPriority) return @4;
1417
+ if(value == AVCaptureSessionPreset1280x720) return @6;
1418
+ if(value == AVCaptureSessionPreset1920x1080) return @7;
1419
+ if(value == AVCaptureSessionPreset3840x2160) return @8;
1420
+ if(value == AVCaptureSessionPresetiFrame960x540) return @9;
1421
+ if(value == AVCaptureSessionPresetiFrame1280x720) return @10;
1422
+ if(value == AVCaptureSessionPreset640x480) return @12;
1423
+ if(value == AVCaptureSessionPreset352x288) return @13;
1424
+ return @0;
1425
+ }
1426
+
1427
+ +(CGLineCap)lineCapWithNumber:(NSNumber*)value {
1428
+ int input = [value intValue];
1429
+ if(input == 0) return kCGLineCapButt;
1430
+ if(input == 1) return kCGLineCapRound;
1431
+ if(input == 2) return kCGLineCapSquare;
1432
+ return kCGLineCapButt;
1433
+ }
1434
+
1435
+ +(NSNumber*)generateLineCap:(CGLineCap)value {
1436
+ if(value == kCGLineCapButt) return @0;
1437
+ if(value == kCGLineCapRound) return @1;
1438
+ if(value == kCGLineCapSquare) return @2;
1439
+ return @0;;
1440
+ }
1441
+
1442
+ +(UIInterfaceOrientationMask)interfaceOrientationMaskWithNumber:(NSNumber*)value {
1443
+ int input = [value intValue];
1444
+ if(input == 0) return UIInterfaceOrientationMaskAll;
1445
+ if(input == 1) return UIInterfaceOrientationMaskPortrait;
1446
+ if(input == 2) return UIInterfaceOrientationMaskLandscape;
1447
+ if(input == 3) return UIInterfaceOrientationMaskLandscapeLeft;
1448
+ if(input == 4) return UIInterfaceOrientationMaskLandscapeRight;
1449
+ return UIInterfaceOrientationMaskPortrait;
1450
+ }
1451
+
1452
+ +(NSNumber*)generateInterfaceOrientationMask:(UIInterfaceOrientationMask)value {
1453
+ if(value == UIInterfaceOrientationMaskAll) return @0;
1454
+ if(value == UIInterfaceOrientationMaskPortrait) return @1;
1455
+ if(value == UIInterfaceOrientationMaskLandscape) return @2;
1456
+ if(value == UIInterfaceOrientationMaskLandscapeLeft) return @3;
1457
+ if(value == UIInterfaceOrientationMaskLandscapeRight) return @4;
1458
+ return @0;
1459
+ }
1460
+
1461
+ +(UIViewContentMode)viewContentModeWithNumber:(NSNumber*)value {
1462
+ int input = [value intValue];
1463
+ if(input == 0) return UIViewContentModeScaleToFill;
1464
+ if(input == 1) return UIViewContentModeScaleAspectFit;
1465
+ if(input == 2) return UIViewContentModeScaleAspectFill;
1466
+ if(input == 3) return UIViewContentModeRedraw;
1467
+ if(input == 4) return UIViewContentModeCenter;
1468
+ if(input == 5) return UIViewContentModeTop;
1469
+ if(input == 6) return UIViewContentModeBottom;
1470
+ if(input == 7) return UIViewContentModeLeft;
1471
+ if(input == 8) return UIViewContentModeRight;
1472
+ if(input == 9) return UIViewContentModeTopLeft;
1473
+ if(input == 10) return UIViewContentModeTopRight;
1474
+ if(input == 11) return UIViewContentModeBottomLeft;
1475
+ if(input == 12) return UIViewContentModeBottomRight;
1476
+ return UIViewContentModeCenter;
1477
+ }
1478
+
1479
+ +(NSNumber*)generateViewContentMode:(UIViewContentMode)value {
1480
+ if(value == UIViewContentModeScaleToFill) return @0;
1481
+ if(value == UIViewContentModeScaleAspectFit) return @1;
1482
+ if(value == UIViewContentModeScaleAspectFill) return @2;
1483
+ if(value == UIViewContentModeRedraw) return @3;
1484
+ if(value == UIViewContentModeCenter) return @4;
1485
+ if(value == UIViewContentModeTop) return @5;
1486
+ if(value == UIViewContentModeBottom) return @6;
1487
+ if(value == UIViewContentModeLeft) return @7;
1488
+ if(value == UIViewContentModeRight) return @8;
1489
+ if(value == UIViewContentModeTopLeft) return @9;
1490
+ if(value == UIViewContentModeTopRight) return @10;
1491
+ if(value == UIViewContentModeBottomLeft) return @11;
1492
+ if(value == UIViewContentModeBottomRight) return @12;
1493
+ return @4;
1494
+ }
1495
+
1496
+ +(RGLDocReaderFrame)docReaderFrameWithString:(NSString*)value {
1497
+ if([value isEqual: @"id1"]) return RGLDocReaderFrameScenarioDefault;
1498
+ if([value isEqual: @"max"]) return RGLDocReaderFrameMax;
1499
+ if([value isEqual: @"none"]) return RGLDocReaderFrameNone;
1500
+ if([value isEqual: @"document"]) return RGLDocReaderFrameDocument;
1501
+ return RGLDocReaderFrameNone;
1502
+ }
1503
+
1504
+ +(NSString*)generateDocReaderFrame:(RGLDocReaderFrame)value {
1505
+ if(value == RGLDocReaderFrameScenarioDefault) return @"id1";
1506
+ if(value == RGLDocReaderFrameMax) return @"max";
1507
+ if(value == RGLDocReaderFrameNone) return @"none";
1508
+ if(value == RGLDocReaderFrameDocument) return @"document";
1509
+ return @"none";
1510
+ }
1511
+
1512
+ +(RGLTextProcessing*)textProcessingWithNumber:(NSNumber*)value {
1513
+ int input = [value intValue];
1514
+ if(input == 0) return RGLTextProcessing.noChange;
1515
+ if(input == 1) return RGLTextProcessing.uppercase;
1516
+ if(input == 2) return RGLTextProcessing.lowercase;
1517
+ if(input == 3) return RGLTextProcessing.capital;
1518
+ return RGLTextProcessing.noChange;
1519
+ }
1520
+
1521
+ +(NSNumber*)generateWithTextProcessing:(RGLTextProcessing*)value {
1522
+ return [value valueForKey:@"rawValue"];
1523
+ }
1524
+
1525
+ +(NSNumber*)generateDocReaderAction:(RGLDocReaderAction)value {
1526
+ if(value == RGLDocReaderActionComplete) return @0;
1527
+ if(value == RGLDocReaderActionProcess) return @1;
1528
+ if(value == RGLDocReaderActionMorePagesAvailable) return @2;
1529
+ if(value == RGLDocReaderActionCancel) return @3;
1530
+ if(value == RGLDocReaderActionError) return @4;
1531
+ if(value == RGLDocReaderActionProcessWhiteFlashLight) return @5;
1532
+ if(value == RGLDocReaderActionProcessTimeout) return @6;
1533
+ if(value == RGLDocReaderActionProcessOnServer) return @7;
1534
+ return @4;
1535
+ }
1536
+
1537
+ +(NSNumber*)generateRFIDCompleteAction:(RGLRFIDCompleteAction)value {
1538
+ if(value == RGLRFIDCompleteActionComplete) return @0;
1539
+ if(value == RGLRFIDCompleteActionError) return @4;
1540
+ if(value == RGLRFIDCompleteActionCancel) return @3;
1541
+ if(value == RGLRFIDCompleteActionSessionRestarted) return @0;
1542
+ return @0;
1543
+ }
1544
+
1545
+ +(NSNumber*)generateImageQualityCheckType:(RGLImageQualityCheckType)value {
1546
+ if(value == RGLImageQualityCheckTypeImageGlares) return @0;
1547
+ if(value == RGLImageQualityCheckTypeImageFocus) return @1;
1548
+ if(value == RGLImageQualityCheckTypeImageResolution) return @2;
1549
+ if(value == RGLImageQualityCheckTypeImageColorness) return @3;
1550
+ if(value == RGLImageQualityCheckTypeImagePerspective) return @4;
1551
+ if(value == RGLImageQualityCheckTypeImageBounds) return @5;
1552
+ if(value == RGLImageQualityCheckTypeScreenCapture) return @6;
1553
+ if(value == RGLImageQualityCheckTypePortrait) return @7;
1554
+ if(value == RGLImageQualityCheckTypeHandwritten) return @8;
1555
+ if(value == RGLImageQualityCheckTypeBrightness) return @9;
1556
+ if(value == RGLImageQualityCheckTypeOcclusion) return @10;
1557
+ return 0;
1558
+ }
1559
+
1560
+ +(RGLImageQualityCheckType)imageQualityCheckTypeWithNumber:(NSNumber*)input {
1561
+ if(input == nil) return nil;
1562
+ int value = [input intValue];
1563
+ if(value == 0) return RGLImageQualityCheckTypeImageGlares;
1564
+ if(value == 1) return RGLImageQualityCheckTypeImageFocus;
1565
+ if(value == 2) return RGLImageQualityCheckTypeImageResolution;
1566
+ if(value == 3) return RGLImageQualityCheckTypeImageColorness;
1567
+ if(value == 4) return RGLImageQualityCheckTypeImagePerspective;
1568
+ if(value == 5) return RGLImageQualityCheckTypeImageBounds;
1569
+ if(value == 6) return RGLImageQualityCheckTypeScreenCapture;
1570
+ if(value == 7) return RGLImageQualityCheckTypePortrait;
1571
+ if(value == 8) return RGLImageQualityCheckTypeHandwritten;
1572
+ if(value == 9) return RGLImageQualityCheckTypeBrightness;
1573
+ if(value == 10) return RGLImageQualityCheckTypeOcclusion;
1574
+ return RGLImageQualityCheckTypeImageGlares;
1575
+ }
1576
+
1577
+ @end