@regulaforensics/cordova-plugin-document-reader-api 6.9.1 → 7.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,1152 +0,0 @@
1
- #import <Foundation/Foundation.h>
2
- #import "RGLWRegulaConfig.h"
3
-
4
- @implementation RGLWRegulaConfig
5
- +(void)setConfig:(NSDictionary*)options :(RGLDocReader*)reader {
6
- if([options valueForKey:@"customization"] != nil)
7
- [self setCustomization: [options valueForKey:@"customization"]: reader.customization];
8
- if([options valueForKey:@"functionality"] != nil)
9
- [self setFunctionality: [options valueForKey:@"functionality"]: reader.functionality];
10
- if([options valueForKey:@"processParams"] != nil)
11
- [self setProcessParams: [options valueForKey:@"processParams"]: reader.processParams];
12
- }
13
-
14
- +(NSMutableDictionary *)getConfig:(RGLDocReader*)reader{
15
- NSMutableDictionary *result = [[NSMutableDictionary alloc] init];
16
-
17
- result[@"customization"] = [self getCustomization: reader.customization];
18
- result[@"functionality"] = [self getFunctionality: reader.functionality];
19
- result[@"processParams"] = [self getProcessParams: reader.processParams];
20
-
21
- return result;
22
- }
23
-
24
- +(AVCaptureSessionPreset)AVCaptureSessionPresetWithNSInteger:(NSInteger)value {
25
- switch(value){
26
- case 0:
27
- return AVCaptureSessionPresetLow;
28
- case 1:
29
- return AVCaptureSessionPresetMedium;
30
- case 2:
31
- return AVCaptureSessionPresetHigh;
32
- case 3:
33
- return AVCaptureSessionPresetPhoto;
34
- case 4:
35
- return AVCaptureSessionPresetInputPriority;
36
- case 6:
37
- return AVCaptureSessionPreset1280x720;
38
- case 7:
39
- return AVCaptureSessionPreset1920x1080;
40
- case 8:
41
- return AVCaptureSessionPreset3840x2160;
42
- case 9:
43
- return AVCaptureSessionPresetiFrame960x540;
44
- case 10:
45
- return AVCaptureSessionPresetiFrame1280x720;
46
- case 12:
47
- return AVCaptureSessionPreset640x480;
48
- case 13:
49
- return AVCaptureSessionPreset352x288;
50
- default:
51
- return AVCaptureSessionPresetLow;
52
- }
53
- }
54
-
55
- +(NSInteger)NSIntegerWithAVCaptureSessionPreset:(AVCaptureSessionPreset)value {
56
- if(value == AVCaptureSessionPresetLow)
57
- return (NSInteger)0;
58
- else if(value == AVCaptureSessionPresetMedium)
59
- return (NSInteger)1;
60
- else if(value == AVCaptureSessionPresetHigh)
61
- return (NSInteger)2;
62
- else if(value == AVCaptureSessionPresetPhoto)
63
- return (NSInteger)3;
64
- else if(value == AVCaptureSessionPresetInputPriority)
65
- return (NSInteger)4;
66
- else if(value == AVCaptureSessionPreset1280x720)
67
- return (NSInteger)6;
68
- else if(value == AVCaptureSessionPreset1920x1080)
69
- return (NSInteger)7;
70
- else if(value == AVCaptureSessionPreset3840x2160)
71
- return (NSInteger)8;
72
- else if(value == AVCaptureSessionPresetiFrame960x540)
73
- return (NSInteger)9;
74
- else if(value == AVCaptureSessionPresetiFrame1280x720)
75
- return (NSInteger)10;
76
- else if(value == AVCaptureSessionPreset640x480)
77
- return (NSInteger)12;
78
- else if(value == AVCaptureSessionPreset352x288)
79
- return (NSInteger)13;
80
- else
81
- return (NSInteger)0;
82
- }
83
-
84
- +(UIColor *)getUIColorObjectFromHexString:(NSString *)hexStr alpha:(CGFloat)alpha {
85
- unsigned int hexInt = [self intFromHexString:hexStr];
86
- UIColor *color =
87
- [UIColor colorWithRed:((CGFloat) ((hexInt & 0xFF0000) >> 16))/255
88
- green:((CGFloat) ((hexInt & 0xFF00) >> 8))/255
89
- blue:((CGFloat) (hexInt & 0xFF))/255
90
- alpha:alpha];
91
-
92
- return color;
93
- }
94
-
95
- + (NSString *)hexStringFromUIColor:(UIColor *)color {
96
- const CGFloat *components = CGColorGetComponents(color.CGColor);
97
-
98
- CGFloat r = components[0];
99
- CGFloat g = components[1];
100
- CGFloat b = components[2];
101
-
102
- return [NSString stringWithFormat:@"#%02lX%02lX%02lX",
103
- lroundf(r * 255),
104
- lroundf(g * 255),
105
- lroundf(b * 255)];
106
- }
107
-
108
- + (unsigned int)intFromHexString:(NSString *)hexStr {
109
- unsigned int hexInt = 0;
110
- NSScanner *scanner = [NSScanner scannerWithString:hexStr];
111
- [scanner setCharactersToBeSkipped:[NSCharacterSet characterSetWithCharactersInString:@"#"]];
112
- [scanner scanHexInt:&hexInt];
113
-
114
- return hexInt;
115
- }
116
-
117
- +(CGLineCap)CGLineCapWithNSInteger:(NSInteger)value {
118
- switch(value){
119
- case 0:
120
- return kCGLineCapButt;
121
- case 1:
122
- return kCGLineCapRound;
123
- case 2:
124
- return kCGLineCapSquare;
125
- default:
126
- return kCGLineCapButt;
127
- }
128
- }
129
-
130
- +(NSInteger)NSIntegerWithCGLineCap:(CGLineCap)value {
131
- switch(value){
132
- case kCGLineCapButt:
133
- return (NSInteger)0;
134
- case kCGLineCapRound:
135
- return (NSInteger)1;
136
- case kCGLineCapSquare:
137
- return (NSInteger)2;
138
- default:
139
- return (NSInteger)0;
140
- }
141
- }
142
-
143
- +(UIInterfaceOrientationMask)UIInterfaceOrientationMaskWithNSInteger:(NSInteger)value {
144
- switch(value){
145
- case 0:
146
- return UIInterfaceOrientationMaskPortrait;
147
- case 1:
148
- return UIInterfaceOrientationMaskLandscapeLeft;
149
- case 2:
150
- return UIInterfaceOrientationMaskLandscapeRight;
151
- case 3:
152
- return UIInterfaceOrientationMaskPortraitUpsideDown;
153
- case 4:
154
- return UIInterfaceOrientationMaskLandscape;
155
- case 5:
156
- return UIInterfaceOrientationMaskAll;
157
- case 6:
158
- return UIInterfaceOrientationMaskAllButUpsideDown;
159
- default:
160
- return UIInterfaceOrientationMaskPortrait;
161
- }
162
- }
163
-
164
- +(NSInteger)NSIntegerWithUIInterfaceOrientationMask:(UIInterfaceOrientationMask)value {
165
- switch(value){
166
- case UIInterfaceOrientationMaskPortrait:
167
- return (NSInteger)0;
168
- case UIInterfaceOrientationMaskLandscapeLeft:
169
- return (NSInteger)1;
170
- case UIInterfaceOrientationMaskLandscapeRight:
171
- return (NSInteger)2;
172
- case UIInterfaceOrientationMaskPortraitUpsideDown:
173
- return (NSInteger)3;
174
- case UIInterfaceOrientationMaskLandscape:
175
- return (NSInteger)4;
176
- case UIInterfaceOrientationMaskAll:
177
- return (NSInteger)5;
178
- case UIInterfaceOrientationMaskAllButUpsideDown:
179
- return (NSInteger)6;
180
- default:
181
- return (NSInteger)0;
182
- }
183
- }
184
-
185
- +(AVCaptureDevicePosition)AVCaptureDevicePositionWithNSInteger:(NSInteger)value {
186
- switch(value){
187
- case 0:
188
- return AVCaptureDevicePositionFront;
189
- case 1:
190
- return AVCaptureDevicePositionBack;
191
- case 2:
192
- return AVCaptureDevicePositionUnspecified;
193
- default:
194
- return AVCaptureDevicePositionFront;
195
- }
196
- }
197
-
198
- +(NSNumber*)NSNumberWithRGLTextProcessing:(RGLTextProcessing*)value {
199
- if(value == RGLTextProcessing.noChange)
200
- return @0;
201
- if(value == RGLTextProcessing.uppercase)
202
- return @1;
203
- if(value == RGLTextProcessing.lowercase)
204
- return @2;
205
- if(value == RGLTextProcessing.capital)
206
- return @3;
207
- return @0;
208
- }
209
-
210
- +(RGLTextProcessing*)RGLTextProcessingWithNSInteger:(NSNumber*)value {
211
- switch([value integerValue]){
212
- case 0:
213
- return RGLTextProcessing.noChange;
214
- case 1:
215
- return RGLTextProcessing.uppercase;
216
- case 2:
217
- return RGLTextProcessing.lowercase;
218
- case 3:
219
- return RGLTextProcessing.capital;
220
- default:
221
- return RGLTextProcessing.noChange;
222
- }
223
- }
224
-
225
- +(NSInteger)NSIntegerWithAVCaptureDevicePosition:(AVCaptureDevicePosition)value {
226
- switch(value){
227
- case AVCaptureDevicePositionFront:
228
- return (NSInteger)0;
229
- case AVCaptureDevicePositionBack:
230
- return (NSInteger)1;
231
- case AVCaptureDevicePositionUnspecified:
232
- return (NSInteger)2;
233
- default:
234
- return (NSInteger)0;
235
- }
236
- }
237
-
238
- +(UIViewContentMode)UIViewContentModeWithNSInteger:(NSInteger)value {
239
- switch(value){
240
- case 0:
241
- return UIViewContentModeScaleToFill;
242
- case 1:
243
- return UIViewContentModeScaleAspectFit;
244
- case 2:
245
- return UIViewContentModeScaleAspectFill;
246
- case 3:
247
- return UIViewContentModeRedraw;
248
- case 4:
249
- return UIViewContentModeCenter;
250
- case 5:
251
- return UIViewContentModeTop;
252
- case 6:
253
- return UIViewContentModeBottom;
254
- case 7:
255
- return UIViewContentModeLeft;
256
- case 8:
257
- return UIViewContentModeRight;
258
- case 9:
259
- return UIViewContentModeTopLeft;
260
- case 10:
261
- return UIViewContentModeTopRight;
262
- case 11:
263
- return UIViewContentModeBottomLeft;
264
- case 12:
265
- return UIViewContentModeBottomRight;
266
- default:
267
- return UIViewContentModeScaleToFill;
268
- }
269
- }
270
-
271
- +(NSInteger)NSIntegerWithUIViewContentMode:(UIViewContentMode)value {
272
- switch(value){
273
- case UIViewContentModeScaleToFill:
274
- return (NSInteger)0;
275
- case UIViewContentModeScaleAspectFit:
276
- return (NSInteger)1;
277
- case UIViewContentModeScaleAspectFill:
278
- return (NSInteger)2;
279
- case UIViewContentModeRedraw:
280
- return (NSInteger)3;
281
- case UIViewContentModeCenter:
282
- return (NSInteger)4;
283
- case UIViewContentModeTop:
284
- return (NSInteger)5;
285
- case UIViewContentModeBottom:
286
- return (NSInteger)6;
287
- case UIViewContentModeLeft:
288
- return (NSInteger)7;
289
- case UIViewContentModeRight:
290
- return (NSInteger)8;
291
- case UIViewContentModeTopLeft:
292
- return (NSInteger)9;
293
- case UIViewContentModeTopRight:
294
- return (NSInteger)10;
295
- case UIViewContentModeBottomLeft:
296
- return (NSInteger)11;
297
- case UIViewContentModeBottomRight:
298
- return (NSInteger)12;
299
- default:
300
- return (NSInteger)0;
301
- }
302
- }
303
-
304
- +(RGLImageQA*)ImageQAFromJson:(NSDictionary*)dict {
305
- RGLImageQA *image = [RGLImageQA new];
306
-
307
- if([dict valueForKey:@"dpiThreshold"] != nil)
308
- image.dpiThreshold = [dict valueForKey:@"dpiThreshold"];
309
- if([dict valueForKey:@"angleThreshold"] != nil)
310
- image.angleThreshold = [dict valueForKey:@"angleThreshold"];
311
- if([dict valueForKey:@"focusCheck"] != nil)
312
- image.focusCheck = [dict valueForKey:@"focusCheck"];
313
- if([dict valueForKey:@"glaresCheck"] != nil)
314
- image.glaresCheck = [dict valueForKey:@"glaresCheck"];
315
- if([dict valueForKey:@"colornessCheck"] != nil)
316
- image.colornessCheck = [dict valueForKey:@"colornessCheck"];
317
- if([dict valueForKey:@"moireCheck"] != nil)
318
- image.moireCheck = [dict valueForKey:@"moireCheck"];
319
- if([dict valueForKey:@"expectedPass"] != nil){
320
- NSMutableArray<RGLImageQualityCheckType> *expectedPass = [NSMutableArray new];
321
- for(NSNumber* item in [dict valueForKey:@"expectedPass"])
322
- [expectedPass addObject:[self RGLImageQualityCheckTypeWithNSNumber: item]];
323
- image.expectedPass = expectedPass;
324
- }
325
- if([dict valueForKey:@"documentPositionIndent"] != nil)
326
- image.documentPositionIndent = [dict valueForKey:@"documentPositionIndent"];
327
-
328
- return image;
329
- }
330
-
331
- +(NSDictionary*)ImageQAToJson:(RGLImageQA*)input {
332
- NSMutableDictionary *result = [NSMutableDictionary new];
333
- if(input == nil) return result;
334
-
335
- result[@"dpiThreshold"] = input.dpiThreshold;
336
- result[@"angleThreshold"] = input.angleThreshold;
337
- result[@"focusCheck"] = input.focusCheck;
338
- result[@"glaresCheck"] = input.glaresCheck;
339
- result[@"colornessCheck"] = input.colornessCheck;
340
- result[@"moireCheck"] = input.moireCheck;
341
- if(input.expectedPass != nil) {
342
- NSMutableArray* array = [NSMutableArray new];
343
- for(RGLImageQualityCheckType item in input.expectedPass)
344
- [array addObject:[self NSNumberWithRGLImageQualityCheckType:item]];
345
- result[@"expectedPass"] = array;
346
- } else result[@"expectedPass"] = nil;
347
- result[@"documentPositionIndent"] = input.documentPositionIndent;
348
-
349
- return result;
350
- }
351
-
352
- +(NSNumber*)NSNumberWithRGLImageQualityCheckType:(RGLImageQualityCheckType)value {
353
- if(value == RGLImageQualityCheckTypeImageGlares) return @0;
354
- if(value == RGLImageQualityCheckTypeImageFocus) return @1;
355
- if(value == RGLImageQualityCheckTypeImageResolution) return @2;
356
- if(value == RGLImageQualityCheckTypeImageColorness) return @3;
357
- if(value == RGLImageQualityCheckTypeImagePerspective) return @4;
358
- if(value == RGLImageQualityCheckTypeImageBounds) return @5;
359
- if(value == RGLImageQualityCheckTypeScreenCapture) return @6;
360
- if(value == RGLImageQualityCheckTypePortrait) return @7;
361
- if(value == RGLImageQualityCheckTypeHandwritten) return @8;
362
- return 0;
363
- }
364
-
365
- +(RGLImageQualityCheckType)RGLImageQualityCheckTypeWithNSNumber:(NSNumber*)input {
366
- int value = [input intValue];
367
- if(value == 0) return RGLImageQualityCheckTypeImageGlares;
368
- if(value == 1) return RGLImageQualityCheckTypeImageFocus;
369
- if(value == 2) return RGLImageQualityCheckTypeImageResolution;
370
- if(value == 3) return RGLImageQualityCheckTypeImageColorness;
371
- if(value == 4) return RGLImageQualityCheckTypeImagePerspective;
372
- if(value == 5) return RGLImageQualityCheckTypeImageBounds;
373
- if(value == 6) return RGLImageQualityCheckTypeScreenCapture;
374
- if(value == 7) return RGLImageQualityCheckTypePortrait;
375
- if(value == 8) return RGLImageQualityCheckTypeHandwritten;
376
- return RGLImageQualityCheckTypeImageGlares;
377
- }
378
-
379
- +(RGLePassportDataGroup*)RGLePassportDataGroupFromJson:(NSDictionary*)dict {
380
- RGLePassportDataGroup *group = [[RGLePassportDataGroup alloc] init];
381
-
382
- if([dict valueForKey:@"DG1"] != nil)
383
- group.dG1 = [[dict valueForKey:@"DG1"] boolValue];
384
- if([dict valueForKey:@"DG2"] != nil)
385
- group.dG2 = [[dict valueForKey:@"DG2"] boolValue];
386
- if([dict valueForKey:@"DG3"] != nil)
387
- group.dG3 = [[dict valueForKey:@"DG3"] boolValue];
388
- if([dict valueForKey:@"DG4"] != nil)
389
- group.dG4 = [[dict valueForKey:@"DG4"] boolValue];
390
- if([dict valueForKey:@"DG5"] != nil)
391
- group.dG5 = [[dict valueForKey:@"DG5"] boolValue];
392
- if([dict valueForKey:@"DG6"] != nil)
393
- group.dG6 = [[dict valueForKey:@"DG6"] boolValue];
394
- if([dict valueForKey:@"DG7"] != nil)
395
- group.dG7 = [[dict valueForKey:@"DG7"] boolValue];
396
- if([dict valueForKey:@"DG8"] != nil)
397
- group.dG8 = [[dict valueForKey:@"DG8"] boolValue];
398
- if([dict valueForKey:@"DG9"] != nil)
399
- group.dG9 = [[dict valueForKey:@"DG9"] boolValue];
400
- if([dict valueForKey:@"DG10"] != nil)
401
- group.dG10 = [[dict valueForKey:@"DG10"] boolValue];
402
- if([dict valueForKey:@"DG11"] != nil)
403
- group.dG11 = [[dict valueForKey:@"DG11"] boolValue];
404
- if([dict valueForKey:@"DG12"] != nil)
405
- group.dG12 = [[dict valueForKey:@"DG12"] boolValue];
406
- if([dict valueForKey:@"DG13"] != nil)
407
- group.dG13 = [[dict valueForKey:@"DG13"] boolValue];
408
- if([dict valueForKey:@"DG14"] != nil)
409
- group.dG14 = [[dict valueForKey:@"DG14"] boolValue];
410
- if([dict valueForKey:@"DG15"] != nil)
411
- group.dG15 = [[dict valueForKey:@"DG15"] boolValue];
412
- if([dict valueForKey:@"DG16"] != nil)
413
- group.dG16 = [[dict valueForKey:@"DG16"] boolValue];
414
-
415
- return group;
416
- }
417
-
418
- +(RGLeIDDataGroup*)RGLeIDDataGroupFromJson:(NSDictionary*)dict {
419
- RGLeIDDataGroup *group = [[RGLeIDDataGroup alloc] init];
420
-
421
- if([dict valueForKey:@"DG1"] != nil)
422
- group.dG1 = [[dict valueForKey:@"DG1"] boolValue];
423
- if([dict valueForKey:@"DG2"] != nil)
424
- group.dG2 = [[dict valueForKey:@"DG2"] boolValue];
425
- if([dict valueForKey:@"DG3"] != nil)
426
- group.dG3 = [[dict valueForKey:@"DG3"] boolValue];
427
- if([dict valueForKey:@"DG4"] != nil)
428
- group.dG4 = [[dict valueForKey:@"DG4"] boolValue];
429
- if([dict valueForKey:@"DG5"] != nil)
430
- group.dG5 = [[dict valueForKey:@"DG5"] boolValue];
431
- if([dict valueForKey:@"DG6"] != nil)
432
- group.dG6 = [[dict valueForKey:@"DG6"] boolValue];
433
- if([dict valueForKey:@"DG7"] != nil)
434
- group.dG7 = [[dict valueForKey:@"DG7"] boolValue];
435
- if([dict valueForKey:@"DG8"] != nil)
436
- group.dG8 = [[dict valueForKey:@"DG8"] boolValue];
437
- if([dict valueForKey:@"DG9"] != nil)
438
- group.dG9 = [[dict valueForKey:@"DG9"] boolValue];
439
- if([dict valueForKey:@"DG10"] != nil)
440
- group.dG10 = [[dict valueForKey:@"DG10"] boolValue];
441
- if([dict valueForKey:@"DG11"] != nil)
442
- group.dG11 = [[dict valueForKey:@"DG11"] boolValue];
443
- if([dict valueForKey:@"DG12"] != nil)
444
- group.dG12 = [[dict valueForKey:@"DG12"] boolValue];
445
- if([dict valueForKey:@"DG13"] != nil)
446
- group.dG13 = [[dict valueForKey:@"DG13"] boolValue];
447
- if([dict valueForKey:@"DG14"] != nil)
448
- group.dG14 = [[dict valueForKey:@"DG14"] boolValue];
449
- if([dict valueForKey:@"DG15"] != nil)
450
- group.dG15 = [[dict valueForKey:@"DG15"] boolValue];
451
- if([dict valueForKey:@"DG16"] != nil)
452
- group.dG16 = [[dict valueForKey:@"DG16"] boolValue];
453
- if([dict valueForKey:@"DG17"] != nil)
454
- group.dG17 = [[dict valueForKey:@"DG17"] boolValue];
455
- if([dict valueForKey:@"DG18"] != nil)
456
- group.dG18 = [[dict valueForKey:@"DG18"] boolValue];
457
- if([dict valueForKey:@"DG19"] != nil)
458
- group.dG19 = [[dict valueForKey:@"DG19"] boolValue];
459
- if([dict valueForKey:@"DG20"] != nil)
460
- group.dG20 = [[dict valueForKey:@"DG20"] boolValue];
461
- if([dict valueForKey:@"DG21"] != nil)
462
- group.dG21 = [[dict valueForKey:@"DG21"] boolValue];
463
-
464
- return group;
465
- }
466
-
467
- +(RGLeDLDataGroup*)RGLeDLDataGroupFromJson:(NSDictionary*)dict {
468
- RGLeDLDataGroup *group = [[RGLeDLDataGroup alloc] init];
469
-
470
- if([dict valueForKey:@"DG1"] != nil)
471
- group.dG1 = [[dict valueForKey:@"DG1"] boolValue];
472
- if([dict valueForKey:@"DG2"] != nil)
473
- group.dG2 = [[dict valueForKey:@"DG2"] boolValue];
474
- if([dict valueForKey:@"DG3"] != nil)
475
- group.dG3 = [[dict valueForKey:@"DG3"] boolValue];
476
- if([dict valueForKey:@"DG4"] != nil)
477
- group.dG4 = [[dict valueForKey:@"DG4"] boolValue];
478
- if([dict valueForKey:@"DG5"] != nil)
479
- group.dG5 = [[dict valueForKey:@"DG5"] boolValue];
480
- if([dict valueForKey:@"DG6"] != nil)
481
- group.dG6 = [[dict valueForKey:@"DG6"] boolValue];
482
- if([dict valueForKey:@"DG7"] != nil)
483
- group.dG7 = [[dict valueForKey:@"DG7"] boolValue];
484
- if([dict valueForKey:@"DG8"] != nil)
485
- group.dG8 = [[dict valueForKey:@"DG8"] boolValue];
486
- if([dict valueForKey:@"DG9"] != nil)
487
- group.dG9 = [[dict valueForKey:@"DG9"] boolValue];
488
- if([dict valueForKey:@"DG10"] != nil)
489
- group.dG10 = [[dict valueForKey:@"DG10"] boolValue];
490
- if([dict valueForKey:@"DG11"] != nil)
491
- group.dG11 = [[dict valueForKey:@"DG11"] boolValue];
492
- if([dict valueForKey:@"DG12"] != nil)
493
- group.dG12 = [[dict valueForKey:@"DG12"] boolValue];
494
- if([dict valueForKey:@"DG13"] != nil)
495
- group.dG13 = [[dict valueForKey:@"DG13"] boolValue];
496
- if([dict valueForKey:@"DG14"] != nil)
497
- group.dG14 = [[dict valueForKey:@"DG14"] boolValue];
498
-
499
- return group;
500
- }
501
-
502
- +(RGLOnlineProcessingConfig*)RGLOnlineProcessingConfigFromJSON:(NSDictionary*)dict {
503
- if(dict == nil) return nil;
504
- if([dict valueForKey:@"mode"] == nil) return nil;
505
-
506
- RGLOnlineProcessingConfig *result = [[RGLOnlineProcessingConfig alloc] initWithMode:[[dict valueForKey:@"mode"] integerValue]];
507
- if([dict valueForKey:@"url"] != nil)
508
- result.serviceURL = [dict valueForKey:@"url"];
509
-
510
- if([dict valueForKey:@"imageFormat"] != nil)
511
- result.imageFormat = [[dict valueForKey:@"imageFormat"] integerValue];
512
- if([dict valueForKey:@"url"] != nil)
513
- result.serviceURL = [dict valueForKey:@"url"];
514
- if([dict valueForKey:@"imageCompressionQuality"] != nil)
515
- result.imageCompressionQuality = [[dict valueForKey:@"imageCompressionQuality"] floatValue];
516
- if([dict valueForKey:@"processParams"] != nil) {
517
- RGLProcessParams *params = [RGLProcessParams new];
518
- [self setProcessParams:[dict valueForKey:@"processParams"] :params];
519
- result.processParams = params;
520
- }
521
-
522
- return result;
523
- }
524
-
525
- +(RGLReprocParams*)RGLReprocParamsFromJSON:(NSDictionary*)dict {
526
- RGLReprocParams *result = [RGLReprocParams new];
527
-
528
- if([dict valueForKey:@"serviceUrl"] != nil)
529
- result.serviceURL = [dict valueForKey:@"serviceUrl"];
530
- if([dict valueForKey:@"failIfNoService"] != nil)
531
- result.failIfNoService = [dict valueForKey:@"failIfNoService"];
532
- if([dict valueForKey:@"httpHeaders"] != nil)
533
- result.httpHeaders = [dict valueForKey:@"httpHeaders"];
534
-
535
- return result;
536
- }
537
-
538
- +(void)setCustomization:(NSDictionary*)options :(RGLCustomization*)customization {
539
- if([options valueForKey:@"cameraFrameBorderWidth"] != nil)
540
- customization.cameraFrameBorderWidth = [[options valueForKey:@"cameraFrameBorderWidth"] floatValue];
541
- if([options valueForKey:@"cameraFrameDefaultColor"] != nil)
542
- customization.cameraFrameDefaultColor = [self getUIColorObjectFromHexString:[options valueForKey:@"cameraFrameDefaultColor"] alpha:1];
543
- if([options valueForKey:@"cameraFrameActiveColor"] != nil)
544
- customization.cameraFrameActiveColor = [self getUIColorObjectFromHexString:[options valueForKey:@"cameraFrameActiveColor"] alpha:1];
545
- if([options valueForKey:@"cameraFrameShapeType"] != nil)
546
- customization.cameraFrameShapeType = [[options valueForKey:@"cameraFrameShapeType"] integerValue];
547
- if([options valueForKey:@"cameraFrameLineLength"] != nil)
548
- customization.cameraFrameLineLength = [[options valueForKey:@"cameraFrameLineLength"] integerValue];
549
- if([options valueForKey:@"status"] != nil)
550
- customization.status = [options valueForKey:@"status"];
551
- if([options valueForKey:@"showStatusMessages"] != nil)
552
- customization.showStatusMessages = [[options valueForKey:@"showStatusMessages"] boolValue];
553
- if([options valueForKey:@"statusTextFont"] != nil)
554
- customization.statusTextFont = [UIFont fontWithName:[options valueForKey:@"statusTextFont"] size:[options valueForKey:@"statusTextSize"] == nil ? 17 : [[options valueForKey:@"statusTextSize"] floatValue]];
555
- if([options valueForKey:@"statusTextColor"] != nil)
556
- customization.statusTextColor = [self getUIColorObjectFromHexString:[options valueForKey:@"statusTextColor"] alpha:1];
557
- if([options valueForKey:@"statusPositionMultiplier"] != nil)
558
- customization.statusPositionMultiplier = [[options valueForKey:@"statusPositionMultiplier"] doubleValue];
559
- if([options valueForKey:@"showResultStatusMessages"] != nil)
560
- customization.showResultStatusMessages = [[options valueForKey:@"showResultStatusMessages"] boolValue];
561
- if([options valueForKey:@"resultStatus"] != nil)
562
- customization.resultStatus = [options valueForKey:@"resultStatus"];
563
- if([options valueForKey:@"resultStatusTextFont"] != nil)
564
- customization.resultStatusTextFont = [UIFont fontWithName:[options valueForKey:@"resultStatusTextFont"] size:[options valueForKey:@"resultStatusTextSize"] == nil ? 17 : [[options valueForKey:@"resultStatusTextSize"] floatValue]];
565
- if([options valueForKey:@"resultStatusTextColor"] != nil)
566
- customization.resultStatusTextColor = [self getUIColorObjectFromHexString:[options valueForKey:@"resultStatusTextColor"] alpha:1];
567
- if([options valueForKey:@"resultStatusBackgroundColor"] != nil)
568
- customization.resultStatusBackgroundColor = [self getUIColorObjectFromHexString:[options valueForKey:@"resultStatusBackgroundColor"] alpha:1];
569
- if([options valueForKey:@"resultStatusPositionMultiplier"] != nil)
570
- customization.resultStatusPositionMultiplier = [[options valueForKey:@"resultStatusPositionMultiplier"] doubleValue];
571
- if([options valueForKey:@"showHelpAnimation"] != nil)
572
- customization.showHelpAnimation = [[options valueForKey:@"showHelpAnimation"] boolValue];
573
- if([options valueForKey:@"showNextPageAnimation"] != nil)
574
- customization.showNextPageAnimation = [[options valueForKey:@"showNextPageAnimation"] boolValue];
575
- if([options valueForKey:@"helpAnimationImage"] != nil)
576
- customization.helpAnimationImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"helpAnimationImage"]];
577
- if([options valueForKey:@"multipageAnimationFrontImage"] != nil)
578
- customization.multipageAnimationFrontImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"multipageAnimationFrontImage"]];
579
- if([options valueForKey:@"multipageAnimationBackImage"] != nil)
580
- customization.multipageAnimationBackImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"multipageAnimationBackImage"]];
581
- if([options valueForKey:@"tintColor"] != nil)
582
- customization.tintColor = [self getUIColorObjectFromHexString:[options valueForKey:@"tintColor"] alpha:1];
583
- if([options valueForKey:@"multipageButtonBackgroundColor"] != nil)
584
- customization.multipageButtonBackgroundColor = [self getUIColorObjectFromHexString:[options valueForKey:@"multipageButtonBackgroundColor"] alpha:1];
585
- if([options valueForKey:@"activityIndicatorColor"] != nil)
586
- customization.activityIndicatorColor = [self getUIColorObjectFromHexString:[options valueForKey:@"activityIndicatorColor"] alpha:1];
587
- if([options valueForKey:@"showBackgroundMask"] != nil)
588
- customization.showBackgroundMask = [[options valueForKey:@"showBackgroundMask"] boolValue];
589
- if([options valueForKey:@"borderBackgroundImage"] != nil)
590
- customization.borderBackgroundImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"borderBackgroundImage"]];
591
- if([options valueForKey:@"backgroundMaskAlpha"] != nil)
592
- customization.backgroundMaskAlpha = [[options valueForKey:@"backgroundMaskAlpha"] floatValue];
593
- if([options valueForKey:@"helpAnimationImageContentMode"] != nil)
594
- customization.helpAnimationImageContentMode = [self UIViewContentModeWithNSInteger:[[options valueForKey:@"helpAnimationImageContentMode"] integerValue]];
595
- if([options valueForKey:@"multipageAnimationFrontImageContentMode"] != nil)
596
- customization.multipageAnimationFrontImageContentMode = [self UIViewContentModeWithNSInteger:[[options valueForKey:@"multipageAnimationFrontImageContentMode"] integerValue]];
597
- if([options valueForKey:@"multipageAnimationBackImageContentMode"] != nil)
598
- customization.multipageAnimationBackImageContentMode = [self UIViewContentModeWithNSInteger:[[options valueForKey:@"multipageAnimationBackImageContentMode"] integerValue]];
599
- if([options valueForKey:@"borderBackgroundImageContentMode"] != nil)
600
- customization.borderBackgroundImageContentMode = [self UIViewContentModeWithNSInteger:[[options valueForKey:@"borderBackgroundImageContentMode"] integerValue]];
601
- if([options valueForKey:@"cameraFrameVerticalPositionMultiplier"] != nil)
602
- customization.cameraFrameVerticalPositionMultiplier = [[options valueForKey:@"cameraFrameVerticalPositionMultiplier"] floatValue];
603
- if([options valueForKey:@"customStatusPositionMultiplier"] != nil)
604
- customization.customStatusPositionMultiplier = [[options valueForKey:@"customStatusPositionMultiplier"] floatValue];
605
- if([options valueForKey:@"customLabelStatus"] != nil)
606
- customization.customLabelStatus = [[NSAttributedString alloc]initWithString:[options valueForKey:@"customLabelStatus"]];
607
- if([options valueForKey:@"cameraFrameCornerRadius"] != nil)
608
- customization.cameraFrameCornerRadius = [[options valueForKey:@"cameraFrameCornerRadius"] floatValue];
609
- if([options valueForKey:@"torchButtonOnImage"] != nil)
610
- customization.torchButtonOnImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"torchButtonOnImage"]];
611
- if([options valueForKey:@"torchButtonOffImage"] != nil)
612
- customization.torchButtonOffImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"torchButtonOffImage"]];
613
- if([options valueForKey:@"closeButtonImage"] != nil)
614
- customization.closeButtonImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"closeButtonImage"]];
615
- if([options valueForKey:@"captureButtonImage"] != nil)
616
- customization.captureButtonImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"captureButtonImage"]];
617
- if([options valueForKey:@"changeFrameButtonCollapseImage"] != nil)
618
- customization.changeFrameButtonCollapseImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"changeFrameButtonCollapseImage"]];
619
- if([options valueForKey:@"changeFrameButtonExpandImage"] != nil)
620
- customization.changeFrameButtonExpandImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"changeFrameButtonExpandImage"]];
621
- if([options valueForKey:@"cameraSwitchButtonImage"] != nil)
622
- customization.cameraSwitchButtonImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"cameraSwitchButtonImage"]];
623
- if([options valueForKey:@"cameraFrameLineCap"] != nil)
624
- customization.cameraFrameLineCap = [self CGLineCapWithNSInteger:[[options valueForKey:@"cameraFrameLineCap"] integerValue]];
625
- if([options valueForKey:@"cameraFrameOffsetWidth"] != nil)
626
- customization.cameraFrameOffsetWidth = [[options valueForKey:@"cameraFrameOffsetWidth"] floatValue];
627
- if([options valueForKey:@"cameraFramePortraitAspectRatio"] != nil)
628
- customization.cameraFramePortraitAspectRatio = [[options valueForKey:@"cameraFramePortraitAspectRatio"] floatValue];
629
- if([options valueForKey:@"cameraFrameLandscapeAspectRatio"] != nil)
630
- customization.cameraFrameLandscapeAspectRatio = [[options valueForKey:@"cameraFrameLandscapeAspectRatio"] floatValue];
631
- if([options valueForKey:@"toolbarSize"] != nil)
632
- customization.toolbarSize = [[options valueForKey:@"toolbarSize"] floatValue];
633
- if([options valueForKey:@"statusBackgroundColor"] != nil)
634
- customization.statusBackgroundColor = [self getUIColorObjectFromHexString:[options valueForKey:@"statusBackgroundColor"] alpha:1];
635
- if([options valueForKey:@"cameraPreviewBackgroundColor"] != nil)
636
- customization.cameraPreviewBackgroundColor = [self getUIColorObjectFromHexString:[options valueForKey:@"cameraPreviewBackgroundColor"] alpha:1];
637
- if([options valueForKey:@"hologramAnimationImageContentMode"] != nil)
638
- customization.hologramAnimationImageContentMode = [self UIViewContentModeWithNSInteger:[[options valueForKey:@"hologramAnimationImageContentMode"] integerValue]];
639
- if([options valueForKey:@"hologramAnimationPositionMultiplier"] != nil)
640
- customization.hologramAnimationPositionMultiplier = [[options valueForKey:@"hologramAnimationPositionMultiplier"] floatValue];
641
- if([options valueForKey:@"hologramAnimationImage"] != nil)
642
- customization.hologramAnimationImage = [RGLWJSONConstructor imageWithBase64:[options valueForKey:@"hologramAnimationImage"]];
643
- if([options valueForKey:@"uiCustomizationLayer"] != nil)
644
- customization.customUILayerJSON = [options valueForKey:@"uiCustomizationLayer"];
645
- }
646
-
647
- +(void)setFunctionality:(NSDictionary*)options :(RGLFunctionality*)functionality {
648
- if([options valueForKey:@"cameraFrame"] != nil){
649
- NSString *enumFromAndroid = [options valueForKey:@"cameraFrame"];
650
- if([enumFromAndroid isEqual: @"id1"])
651
- functionality.cameraFrame = 0;
652
- if([enumFromAndroid isEqual: @"max"])
653
- functionality.cameraFrame = 1;
654
- if([enumFromAndroid isEqual: @"none"])
655
- functionality.cameraFrame = 2;
656
- if([enumFromAndroid isEqual: @"document"])
657
- functionality.cameraFrame = 3;
658
- }
659
- if([options valueForKey:@"showTorchButton"] != nil)
660
- functionality.showTorchButton = [[options valueForKey:@"showTorchButton"] boolValue];
661
- if([options valueForKey:@"showCloseButton"] != nil)
662
- functionality.showCloseButton = [[options valueForKey:@"showCloseButton"] boolValue];
663
- if([options valueForKey:@"showCaptureButton"] != nil)
664
- functionality.showCaptureButton = [[options valueForKey:@"showCaptureButton"] boolValue];
665
- if([options valueForKey:@"showChangeFrameButton"] != nil)
666
- functionality.showChangeFrameButton = [[options valueForKey:@"showChangeFrameButton"] boolValue];
667
- if([options valueForKey:@"showSkipNextPageButton"] != nil)
668
- functionality.showSkipNextPageButton = [[options valueForKey:@"showSkipNextPageButton"] boolValue];
669
- if([options valueForKey:@"showCameraSwitchButton"] != nil)
670
- functionality.showCameraSwitchButton = [[options valueForKey:@"showCameraSwitchButton"] boolValue];
671
- if([options valueForKey:@"videoCaptureMotionControl"] != nil)
672
- functionality.videoCaptureMotionControl = [[options valueForKey:@"videoCaptureMotionControl"] boolValue];
673
- if([options valueForKey:@"skipFocusingFrames"] != nil)
674
- functionality.skipFocusingFrames = [[options valueForKey:@"skipFocusingFrames"] boolValue];
675
- if([options valueForKey:@"orientation"] != nil)
676
- functionality.orientation = [self UIInterfaceOrientationMaskWithNSInteger:[[options valueForKey:@"orientation"] integerValue]];
677
- if([options valueForKey:@"videoSessionPreset"] != nil)
678
- functionality.videoSessionPreset = [self AVCaptureSessionPresetWithNSInteger:[[options valueForKey:@"videoSessionPreset"] integerValue]];
679
- if([options valueForKey:@"singleResult"] != nil)
680
- functionality.singleResult = [[options valueForKey:@"singleResult"] boolValue];
681
- if([options valueForKey:@"cameraPosition"] != nil)
682
- functionality.cameraPosition = [self AVCaptureDevicePositionWithNSInteger:[[options valueForKey:@"cameraPosition"] integerValue]];
683
- if([options valueForKey:@"btDeviceName"] != nil)
684
- #pragma clang diagnostic ignored "-Wdeprecated-declarations"
685
- functionality.btDeviceName = [options valueForKey:@"btDeviceName"];
686
- #pragma clang diagnostic pop
687
- if([options valueForKey:@"useAuthenticator"] != nil)
688
- functionality.useAuthenticator = [[options valueForKey:@"useAuthenticator"] boolValue];
689
- if([options valueForKey:@"showCaptureButtonDelayFromDetect"] != nil)
690
- functionality.showCaptureButtonDelayFromDetect = [[options valueForKey:@"showCaptureButtonDelayFromDetect"] doubleValue];
691
- if([options valueForKey:@"showCaptureButtonDelayFromStart"] != nil)
692
- functionality.showCaptureButtonDelayFromStart = [[options valueForKey:@"showCaptureButtonDelayFromStart"] doubleValue];
693
- if([options valueForKey:@"captureMode"] != nil)
694
- functionality.captureMode = [[options valueForKey:@"captureMode"] intValue];
695
- if([options valueForKey:@"displayMetadata"] != nil)
696
- functionality.showMetadataInfo = [[options valueForKey:@"displayMetadata"] boolValue];
697
- if([options valueForKey:@"isZoomEnabled"] != nil)
698
- functionality.isZoomEnabled = [[options valueForKey:@"isZoomEnabled"] boolValue];
699
- if([options valueForKey:@"zoomFactor"] != nil)
700
- functionality.zoomFactor = [[options valueForKey:@"zoomFactor"] floatValue];
701
- if([options valueForKey:@"recordScanningProcess"] != nil)
702
- functionality.recordScanningProcess = [[options valueForKey:@"recordScanningProcess"] boolValue];
703
- if([options valueForKey:@"manualMultipageMode"] != nil)
704
- functionality.manualMultipageMode = [[options valueForKey:@"manualMultipageMode"] boolValue];
705
- if([options valueForKey:@"videoOutputSettings"] != nil)
706
- functionality.videoOutputSettings = [options valueForKey:@"videoOutputSettings"];
707
- if([options valueForKey:@"onlineProcessingConfiguration"] != nil)
708
- functionality.onlineProcessingConfig = [self RGLOnlineProcessingConfigFromJSON:[options valueForKey:@"onlineProcessingConfiguration"]];;
709
- }
710
-
711
- +(void)setProcessParams:(NSDictionary*)options :(RGLProcessParams*)processParams {
712
- if([options valueForKey:@"multipageProcessing"] != nil)
713
- processParams.multipageProcessing = [NSNumber numberWithBool:[[options valueForKey:@"multipageProcessing"] boolValue]];
714
- if([options valueForKey:@"dateFormat"] != nil)
715
- processParams.dateFormat = [options valueForKey:@"dateFormat"];
716
- if([options valueForKey:@"logs"] != nil)
717
- processParams.logs = [NSNumber numberWithBool:[[options valueForKey:@"logs"] boolValue]];
718
- if([options valueForKey:@"debugSaveImages"] != nil)
719
- processParams.debugSaveImages = [NSNumber numberWithBool:[[options valueForKey:@"debugSaveImages"] boolValue]];
720
- if([options valueForKey:@"debugSaveCroppedImages"] != nil)
721
- processParams.debugSaveCroppedImages = [NSNumber numberWithBool:[[options valueForKey:@"debugSaveCroppedImages"] boolValue]];
722
- if([options valueForKey:@"debugSaveLogs"] != nil)
723
- processParams.debugSaveLogs = [NSNumber numberWithBool:[[options valueForKey:@"debugSaveLogs"] boolValue]];
724
- if([options valueForKey:@"scenario"] != nil)
725
- processParams.scenario = [options valueForKey:@"scenario"];
726
- if([options valueForKey:@"barcodeTypes"] != nil)
727
- processParams.barcodeTypes = [options valueForKey:@"barcodeTypes"];
728
- if([options valueForKey:@"documentIDList"] != nil)
729
- processParams.documentIDList = [options valueForKey:@"documentIDList"];
730
- if([options valueForKey:@"fieldTypesFilter"] != nil)
731
- processParams.fieldTypesFilter = [options valueForKey:@"fieldTypesFilter"];
732
- if([options valueForKey:@"disableFocusingCheck"] != nil)
733
- processParams.disableFocusingCheck = [NSNumber numberWithBool:[[options valueForKey:@"disableFocusingCheck"] boolValue]];
734
- if([options valueForKey:@"captureButtonScenario"] != nil)
735
- processParams.captureButtonScenario = [options valueForKey:@"captureButtonScenario"];
736
- if([options valueForKey:@"measureSystem"] != nil)
737
- processParams.measureSystem = [[options valueForKey:@"measureSystem"] integerValue];
738
- if([options valueForKey:@"returnUncroppedImage"] != nil)
739
- processParams.returnUncroppedImage = [NSNumber numberWithBool:[[options valueForKey:@"returnUncroppedImage"] boolValue]];
740
- if([options valueForKey:@"customParams"] != nil)
741
- processParams.customParams = [options objectForKey:@"customParams"];
742
- if([options valueForKey:@"debugSaveRFIDSession"] != nil)
743
- processParams.debugSaveRFIDSession = [NSNumber numberWithBool:[[options valueForKey:@"debugSaveRFIDSession"] boolValue]];
744
- if([options valueForKey:@"doublePageSpread"] != nil)
745
- processParams.doublePageSpread = [NSNumber numberWithBool:[[options valueForKey:@"doublePageSpread"] boolValue]];
746
- if([options valueForKey:@"barcodeParserType"] != nil)
747
- processParams.barcodeParserType = [NSNumber numberWithInteger:[[options valueForKey:@"barcodeParserType"] integerValue]];
748
- if([options valueForKey:@"timeout"] != nil)
749
- processParams.timeout = [NSNumber numberWithDouble:[[options valueForKey:@"timeout"] doubleValue]];
750
- if([options valueForKey:@"timeoutFromFirstDetect"] != nil)
751
- processParams.timeoutFromFirstDetect = [NSNumber numberWithDouble:[[options valueForKey:@"timeoutFromFirstDetect"] doubleValue]];
752
- if([options valueForKey:@"timeoutFromFirstDocType"] != nil)
753
- processParams.timeoutFromFirstDocType = [NSNumber numberWithDouble:[[options valueForKey:@"timeoutFromFirstDocType"] doubleValue]];
754
- if([options valueForKey:@"manualCrop"] != nil)
755
- processParams.manualCrop = [NSNumber numberWithBool:[[options valueForKey:@"manualCrop"] boolValue]];
756
- if([options valueForKey:@"perspectiveAngle"] != nil)
757
- processParams.perspectiveAngle = [NSNumber numberWithInteger:[[options valueForKey:@"perspectiveAngle"] integerValue]];
758
- if([options valueForKey:@"minDPI"] != nil)
759
- processParams.minDPI = [NSNumber numberWithInteger:[[options valueForKey:@"minDPI"] integerValue]];
760
- if([options valueForKey:@"integralImage"] != nil)
761
- processParams.integralImage = [NSNumber numberWithBool:[[options valueForKey:@"integralImage"] boolValue]];
762
- if([options valueForKey:@"returnCroppedBarcode"] != nil)
763
- processParams.returnCroppedBarcode = [NSNumber numberWithBool:[[options valueForKey:@"returnCroppedBarcode"] boolValue]];
764
- if([options valueForKey:@"checkHologram"] != nil)
765
- processParams.checkHologram = [NSNumber numberWithBool:[[options valueForKey:@"checkHologram"] boolValue]];
766
- if([options valueForKey:@"checkRequiredTextFields"] != nil)
767
- processParams.checkRequiredTextFields = [NSNumber numberWithBool:[[options valueForKey:@"checkRequiredTextFields"] boolValue]];
768
- if([options valueForKey:@"depersonalizeLog"] != nil)
769
- processParams.depersonalizeLog = [options valueForKey:@"depersonalizeLog"];
770
- if([options valueForKey:@"resultTypeOutput"] != nil)
771
- processParams.resultTypeOutput = [options valueForKey:@"resultTypeOutput"];
772
- if([options valueForKey:@"generateDoublePageSpreadImage"] != nil)
773
- processParams.generateDoublePageSpreadImage = [options valueForKey:@"generateDoublePageSpreadImage"];
774
- if([options valueForKey:@"imageDpiOutMax"] != nil)
775
- processParams.imageDpiOutMax = [options valueForKey:@"imageDpiOutMax"];
776
- if([options valueForKey:@"alreadyCropped"] != nil)
777
- processParams.alreadyCropped = [options valueForKey:@"alreadyCropped"];
778
- if([options valueForKey:@"forceDocID"] != nil)
779
- processParams.forceDocID = [options valueForKey:@"forceDocID"];
780
- if([options valueForKey:@"matchTextFieldMask"] != nil)
781
- processParams.matchTextFieldMask = [options valueForKey:@"matchTextFieldMask"];
782
- if([options valueForKey:@"fastDocDetect"] != nil)
783
- processParams.fastDocDetect = [options valueForKey:@"fastDocDetect"];
784
- if([options valueForKey:@"updateOCRValidityByGlare"] != nil)
785
- processParams.updateOCRValidityByGlare = [options valueForKey:@"updateOCRValidityByGlare"];
786
- if([options valueForKey:@"imageQA"] != nil)
787
- processParams.imageQA = [RGLWRegulaConfig ImageQAFromJson:[options valueForKey:@"imageQA"]];
788
- if([options valueForKey:@"forceDocFormat"] != nil)
789
- processParams.forceDocFormat = [options valueForKey:@"forceDocFormat"];
790
- if([options valueForKey:@"noGraphics"] != nil)
791
- processParams.noGraphics = [options valueForKey:@"noGraphics"];
792
- if([options valueForKey:@"documentAreaMin"] != nil)
793
- processParams.documentAreaMin = [options valueForKey:@"documentAreaMin"];
794
- if([options valueForKey:@"multiDocOnImage"] != nil)
795
- processParams.multiDocOnImage = [options valueForKey:@"multiDocOnImage"];
796
- if([options valueForKey:@"shiftExpiryDate"] != nil)
797
- processParams.shiftExpiryDate = [options valueForKey:@"shiftExpiryDate"];
798
- if([options valueForKey:@"minimalHolderAge"] != nil)
799
- processParams.minimalHolderAge = [options valueForKey:@"minimalHolderAge"];
800
- if([options valueForKey:@"mrzFormatsFilter"] != nil)
801
- processParams.mrzFormatsFilter = [options valueForKey:@"mrzFormatsFilter"];
802
- if([options valueForKey:@"forceReadMrzBeforeLocate"] != nil)
803
- processParams.forceReadMrzBeforeLocate = [options valueForKey:@"forceReadMrzBeforeLocate"];
804
- if([options valueForKey:@"parseBarcodes"] != nil)
805
- processParams.parseBarcodes = [options valueForKey:@"parseBarcodes"];
806
- if([options valueForKey:@"shouldReturnPackageForReprocess"] != nil)
807
- processParams.shouldReturnPackageForReprocess = [options valueForKey:@"shouldReturnPackageForReprocess"];
808
- if([options valueForKey:@"imageOutputMaxWidth"] != nil)
809
- processParams.imageOutputMaxWidth = [options valueForKey:@"imageOutputMaxWidth"];
810
- if([options valueForKey:@"imageOutputMaxHeight"] != nil)
811
- processParams.imageOutputMaxHeight = [options valueForKey:@"imageOutputMaxHeight"];
812
- if([options valueForKey:@"disablePerforationOCR"] != nil)
813
- processParams.disablePerforationOCR = [options valueForKey:@"disablePerforationOCR"];
814
- if([options valueForKey:@"respectImageQuality"] != nil)
815
- processParams.respectImageQuality = [options valueForKey:@"respectImageQuality"];
816
- if([options valueForKey:@"splitNames"] != nil)
817
- processParams.splitNames = [options valueForKey:@"splitNames"];
818
- if([options valueForKey:@"processAuth"] != nil)
819
- processParams.processAuth = [options valueForKey:@"processAuth"];
820
- if([options valueForKey:@"documentGroupFilter"] != nil)
821
- processParams.documentGroupFilter = [options valueForKey:@"documentGroupFilter"];
822
- if([options valueForKey:@"convertCase"] != nil)
823
- processParams.convertCase = [RGLWRegulaConfig RGLTextProcessingWithNSInteger:[options valueForKey:@"convertCase"]];
824
- if([options valueForKey:@"rfidParams"] != nil)
825
- processParams.rfidParams = [self RGLRFIDParamsFromJSON:[options valueForKey:@"rfidParams"]];
826
- if([options valueForKey:@"doDetectCan"] != nil)
827
- processParams.doDetectCan = [NSNumber numberWithBool:[[options valueForKey:@"doDetectCan"] boolValue]];
828
- if([options valueForKey:@"useFaceApi"] != nil)
829
- processParams.useFaceApi = [NSNumber numberWithBool:[[options valueForKey:@"useFaceApi"] boolValue]];
830
- if([options valueForKey:@"faceApiParams"] != nil)
831
- processParams.faceApiParams = [self RGLFaceAPIParamsFromJSON:[options valueForKey:@"faceApiParams"]];
832
- }
833
-
834
- +(NSMutableDictionary *)getCustomization:(RGLCustomization*)customization {
835
- NSMutableDictionary *result = [[NSMutableDictionary alloc] init];
836
-
837
- result[@"showHelpAnimation"] = [NSNumber numberWithBool:customization.showHelpAnimation];
838
- result[@"helpAnimationImage"] = [RGLWJSONConstructor base64WithImage:customization.helpAnimationImage];
839
- result[@"showStatusMessages"] = [NSNumber numberWithBool:customization.showStatusMessages];
840
- result[@"status"] = customization.status;
841
- result[@"resultStatus"] = customization.resultStatus;
842
- result[@"statusPositionMultiplier"] = [NSNumber numberWithFloat:customization.statusPositionMultiplier];
843
- result[@"resultStatusPositionMultiplier"] = [NSNumber numberWithFloat:customization.resultStatusPositionMultiplier];
844
- result[@"cameraFrameShapeType"] = [NSNumber numberWithFloat:customization.cameraFrameShapeType];
845
- result[@"resultStatusTextFont"] = customization.resultStatusTextFont.fontName;
846
- result[@"cameraFrameBorderWidth"] = [NSNumber numberWithFloat:customization.cameraFrameBorderWidth];
847
- result[@"statusTextFont"] = customization.statusTextFont.fontName;
848
- result[@"multipageAnimationFrontImage"] = [RGLWJSONConstructor base64WithImage:customization.multipageAnimationFrontImage];
849
- result[@"multipageAnimationBackImage"] = [RGLWJSONConstructor base64WithImage:customization.multipageAnimationBackImage];
850
- result[@"cameraFrameLineLength"] = [NSNumber numberWithFloat:customization.cameraFrameLineLength];
851
- result[@"showNextPageAnimation"] = [NSNumber numberWithBool:customization.showNextPageAnimation];
852
- result[@"showBackgroundMask"] = [NSNumber numberWithBool:customization.showBackgroundMask];
853
- result[@"borderBackgroundImage"] = [RGLWJSONConstructor base64WithImage:customization.borderBackgroundImage];
854
- result[@"backgroundMaskAlpha"] = [NSNumber numberWithFloat:customization.backgroundMaskAlpha];
855
- result[@"helpAnimationImageContentMode"] = [NSNumber numberWithInteger:[self NSIntegerWithUIViewContentMode:customization.helpAnimationImageContentMode]];
856
- result[@"multipageAnimationFrontImageContentMode"] = [NSNumber numberWithInteger:[self NSIntegerWithUIViewContentMode:customization.multipageAnimationFrontImageContentMode]];
857
- result[@"multipageAnimationBackImageContentMode"] = [NSNumber numberWithInteger:[self NSIntegerWithUIViewContentMode:customization.multipageAnimationBackImageContentMode]];
858
- result[@"borderBackgroundImageContentMode"] = [NSNumber numberWithInteger:[self NSIntegerWithUIViewContentMode:customization.borderBackgroundImageContentMode]];
859
- result[@"cameraFrameVerticalPositionMultiplier"] = [NSNumber numberWithFloat:customization.cameraFrameVerticalPositionMultiplier];
860
- result[@"customStatusPositionMultiplier"] = [NSNumber numberWithFloat:customization.customStatusPositionMultiplier];
861
- result[@"cameraFrameCornerRadius"] = [NSNumber numberWithFloat:customization.cameraFrameCornerRadius];
862
- result[@"torchButtonOnImage"] = [RGLWJSONConstructor base64WithImage:customization.torchButtonOnImage];
863
- result[@"torchButtonOffImage"] = [RGLWJSONConstructor base64WithImage:customization.torchButtonOffImage];
864
- result[@"closeButtonImage"] = [RGLWJSONConstructor base64WithImage:customization.closeButtonImage];
865
- result[@"captureButtonImage"] = [RGLWJSONConstructor base64WithImage:customization.captureButtonImage];
866
- result[@"changeFrameButtonCollapseImage"] = [RGLWJSONConstructor base64WithImage:customization.changeFrameButtonCollapseImage];
867
- result[@"changeFrameButtonExpandImage"] = [RGLWJSONConstructor base64WithImage:customization.changeFrameButtonExpandImage];
868
- result[@"cameraSwitchButtonImage"] = [RGLWJSONConstructor base64WithImage:customization.cameraSwitchButtonImage];
869
- result[@"cameraFrameLineCap"] = [NSNumber numberWithInteger:[self NSIntegerWithCGLineCap:customization.cameraFrameLineCap]];
870
- result[@"cameraFrameOffsetWidth"] = [NSNumber numberWithFloat:customization.cameraFrameOffsetWidth];
871
- result[@"cameraFramePortraitAspectRatio"] = [NSNumber numberWithFloat:customization.cameraFramePortraitAspectRatio];
872
- result[@"cameraFrameLandscapeAspectRatio"] = [NSNumber numberWithFloat:customization.cameraFrameLandscapeAspectRatio];
873
- result[@"toolbarSize"] = [NSNumber numberWithFloat:customization.toolbarSize];
874
- result[@"hologramAnimationImageContentMode"] = [NSNumber numberWithInteger:[self NSIntegerWithUIViewContentMode:customization.hologramAnimationImageContentMode]];
875
- result[@"hologramAnimationPositionMultiplier"] = [NSNumber numberWithFloat:customization.hologramAnimationPositionMultiplier];
876
- result[@"uiCustomizationLayer"] = customization.customUILayerJSON;
877
- result[@"hologramAnimationImage"] = [RGLWJSONConstructor base64WithImage:customization.hologramAnimationImage];
878
- if(customization.customLabelStatus != nil)
879
- result[@"customLabelStatus"] = customization.customLabelStatus.string;
880
- if(customization.activityIndicatorColor != nil)
881
- result[@"activityIndicatorColor"] = [self hexStringFromUIColor:customization.activityIndicatorColor];
882
- if(customization.multipageButtonBackgroundColor != nil)
883
- result[@"multipageButtonBackgroundColor"] = [self hexStringFromUIColor:customization.multipageButtonBackgroundColor];
884
- if(customization.statusTextColor != nil)
885
- result[@"statusTextColor"] = [self hexStringFromUIColor:customization.statusTextColor];
886
- if(customization.resultStatusBackgroundColor != nil)
887
- result[@"resultStatusBackgroundColor"] = [self hexStringFromUIColor:customization.resultStatusBackgroundColor];
888
- if(customization.cameraPreviewBackgroundColor != nil)
889
- result[@"cameraPreviewBackgroundColor"] = [self hexStringFromUIColor:customization.cameraPreviewBackgroundColor];
890
- if(customization.cameraFrameDefaultColor != nil)
891
- result[@"cameraFrameDefaultColor"] = [self hexStringFromUIColor:customization.cameraFrameDefaultColor];
892
- if(customization.cameraFrameActiveColor != nil)
893
- result[@"cameraFrameActiveColor"] = [self hexStringFromUIColor:customization.cameraFrameActiveColor];
894
- if(customization.tintColor != nil)
895
- result[@"tintColor"] = [self hexStringFromUIColor:customization.tintColor];
896
- if(customization.resultStatusTextColor != nil)
897
- result[@"resultStatusTextColor"] = [self hexStringFromUIColor:customization.resultStatusTextColor];
898
- if(customization.statusBackgroundColor != nil)
899
- result[@"statusBackgroundColor"] = [self hexStringFromUIColor:customization.statusBackgroundColor];
900
-
901
- return result;
902
- }
903
-
904
- +(NSMutableDictionary *)getFunctionality:(RGLFunctionality*)functionality {
905
- NSMutableDictionary *result = [[NSMutableDictionary alloc] init];
906
-
907
- result[@"cameraFrame"] = [NSNumber numberWithInteger:functionality.cameraFrame];
908
- result[@"showTorchButton"] = [NSNumber numberWithBool:functionality.showTorchButton];
909
- result[@"showCloseButton"] = [NSNumber numberWithBool:functionality.showCloseButton];
910
- result[@"showCaptureButton"] = [NSNumber numberWithBool:functionality.showCaptureButton];
911
- result[@"showChangeFrameButton"] = [NSNumber numberWithBool:functionality.showChangeFrameButton];
912
- result[@"showCameraSwitchButton"] = [NSNumber numberWithBool:functionality.showCameraSwitchButton];
913
- result[@"showSkipNextPageButton"] = [NSNumber numberWithBool:functionality.showSkipNextPageButton];
914
- result[@"skipFocusingFrames"] = [NSNumber numberWithBool:functionality.skipFocusingFrames];
915
- result[@"videoSessionPreset"] = [NSNumber numberWithInteger:[self NSIntegerWithAVCaptureSessionPreset:functionality.videoSessionPreset]];
916
- result[@"videoCaptureMotionControl"] = [NSNumber numberWithBool:functionality.videoCaptureMotionControl];
917
- result[@"orientation"] = [NSNumber numberWithInteger:[self NSIntegerWithUIInterfaceOrientationMask:functionality.orientation]];
918
- result[@"cameraPosition"] = [NSNumber numberWithInteger:[self NSIntegerWithAVCaptureDevicePosition:functionality.cameraPosition]];
919
- #pragma clang diagnostic ignored "-Wdeprecated-declarations"
920
- result[@"btDeviceName"] = functionality.btDeviceName;
921
- #pragma clang diagnostic pop
922
- result[@"useAuthenticator"] = [NSNumber numberWithBool:functionality.isUseAuthenticator];
923
- result[@"showCaptureButtonDelayFromDetect"] = [NSNumber numberWithDouble:functionality.showCaptureButtonDelayFromDetect];
924
- result[@"showCaptureButtonDelayFromStart"] = [NSNumber numberWithDouble:functionality.showCaptureButtonDelayFromStart];
925
- result[@"captureMode"] = [NSNumber numberWithInteger:functionality.captureMode];
926
- result[@"displayMetadata"] = [NSNumber numberWithBool:functionality.showMetadataInfo];
927
- result[@"isZoomEnabled"] = [NSNumber numberWithBool:functionality.isZoomEnabled];
928
- result[@"zoomFactor"] = [NSNumber numberWithBool:functionality.zoomFactor];
929
- result[@"recordScanningProcess"] = [NSNumber numberWithBool:functionality.recordScanningProcess];
930
- result[@"manualMultipageMode"] = [NSNumber numberWithBool:functionality.manualMultipageMode];
931
- result[@"videoOutputSettings"] = functionality.videoOutputSettings;
932
-
933
- return result;
934
- }
935
-
936
- +(NSMutableDictionary *)getProcessParams:(RGLProcessParams*)processParams {
937
- NSMutableDictionary *result = [[NSMutableDictionary alloc] init];
938
-
939
- result[@"scenario"] = processParams.scenario;
940
- result[@"captureButtonScenario"] = processParams.captureButtonScenario;
941
- result[@"logs"] = [NSNumber numberWithBool:processParams.logs];
942
- result[@"multipageProcessing"] = [NSNumber numberWithBool:processParams.multipageProcessing];
943
- result[@"disableFocusingCheck"] = [NSNumber numberWithBool:processParams.disableFocusingCheck];
944
- result[@"debugSaveImages"] = [NSNumber numberWithBool:processParams.debugSaveImages];
945
- result[@"debugSaveCroppedImages"] = [NSNumber numberWithBool:processParams.debugSaveCroppedImages];
946
- result[@"debugSaveLogs"] = [NSNumber numberWithBool:processParams.debugSaveLogs];
947
- result[@"dateFormat"] = processParams.dateFormat;
948
- result[@"documentIDList"] = processParams.documentIDList;
949
- result[@"sessionLogFolder"] = processParams.sessionLogFolder;
950
- result[@"fieldTypesFilter"] = processParams.fieldTypesFilter;
951
- result[@"barcodeTypes"] = processParams.barcodeTypes;
952
- result[@"measureSystem"] = [NSNumber numberWithInteger:processParams.measureSystem];
953
- result[@"returnUncroppedImage"] = [NSNumber numberWithBool:processParams.returnUncroppedImage];
954
- result[@"customParams"] = processParams.customParams;
955
- result[@"debugSaveRFIDSession"] = [NSNumber numberWithBool:processParams.debugSaveRFIDSession];
956
- result[@"doublePageSpread"] = [NSNumber numberWithBool:processParams.doublePageSpread];
957
- result[@"barcodeParserType"] = processParams.barcodeParserType;
958
- result[@"timeout"] = processParams.timeout;
959
- result[@"timeoutFromFirstDetect"] = processParams.timeoutFromFirstDetect;
960
- result[@"timeoutFromFirstDocType"] = processParams.timeoutFromFirstDocType;
961
- result[@"manualCrop"] = [NSNumber numberWithBool:processParams.manualCrop];
962
- result[@"perspectiveAngle"] = processParams.perspectiveAngle;
963
- result[@"minDPI"] = processParams.minDPI;
964
- result[@"integralImage"] = [NSNumber numberWithBool:processParams.integralImage];
965
- result[@"returnCroppedBarcode"] = [NSNumber numberWithBool:processParams.returnCroppedBarcode];
966
- result[@"checkHologram"] = [NSNumber numberWithBool:processParams.checkHologram];
967
- result[@"checkRequiredTextFields"] = [NSNumber numberWithBool:processParams.checkRequiredTextFields];
968
- result[@"depersonalizeLog"] = processParams.depersonalizeLog;
969
- result[@"resultTypeOutput"] = processParams.resultTypeOutput;
970
- result[@"generateDoublePageSpreadImage"] = processParams.generateDoublePageSpreadImage;
971
- result[@"imageDpiOutMax"] = processParams.imageDpiOutMax;
972
- result[@"alreadyCropped"] = processParams.alreadyCropped;
973
- result[@"forceDocID"] = processParams.forceDocID;
974
- result[@"matchTextFieldMask"] = processParams.matchTextFieldMask;
975
- result[@"fastDocDetect"] = processParams.fastDocDetect;
976
- result[@"updateOCRValidityByGlare"] = processParams.updateOCRValidityByGlare;
977
- result[@"imageQA"] = [RGLWRegulaConfig ImageQAToJson:processParams.imageQA];
978
- result[@"forceDocFormat"] = processParams.forceDocFormat;
979
- result[@"noGraphics"] = processParams.noGraphics;
980
- result[@"documentAreaMin"] = processParams.documentAreaMin;
981
- result[@"multiDocOnImage"] = processParams.multiDocOnImage;
982
- result[@"shiftExpiryDate"] = processParams.shiftExpiryDate;
983
- result[@"minimalHolderAge"] = processParams.minimalHolderAge;
984
- result[@"mrzFormatsFilter"] = processParams.mrzFormatsFilter;
985
- result[@"forceReadMrzBeforeLocate"] = processParams.forceReadMrzBeforeLocate;
986
- result[@"parseBarcodes"] = processParams.parseBarcodes;
987
- result[@"shouldReturnPackageForReprocess"] = processParams.shouldReturnPackageForReprocess;
988
- result[@"imageOutputMaxWidth"] = processParams.imageOutputMaxWidth;
989
- result[@"imageOutputMaxHeight"] = processParams.imageOutputMaxHeight;
990
- result[@"disablePerforationOCR"] = processParams.disablePerforationOCR;
991
- result[@"respectImageQuality"] = processParams.respectImageQuality;
992
- result[@"splitNames"] = processParams.splitNames;
993
- result[@"processAuth"] = processParams.processAuth;
994
- result[@"documentGroupFilter"] = processParams.documentGroupFilter;
995
- result[@"convertCase"] = [RGLWRegulaConfig NSNumberWithRGLTextProcessing:processParams.convertCase];
996
- result[@"doDetectCan"] = [NSNumber numberWithBool:processParams.doDetectCan];
997
- result[@"useFaceApi"] = [NSNumber numberWithBool:processParams.useFaceApi];
998
-
999
- return result;
1000
- }
1001
-
1002
- +(void)setRfidScenario:(NSDictionary*)options :(RGLRFIDScenario*)rfidScenario {
1003
- if([options valueForKey:@"autoSettings"] != nil)
1004
- rfidScenario.autoSettings = [[options valueForKey:@"autoSettings"] boolValue];
1005
- if([options valueForKey:@"signManagementAction"] != nil)
1006
- rfidScenario.signManagementAction = [[options valueForKey:@"signManagementAction"] integerValue];
1007
- if([options valueForKey:@"readingBuffer"] != nil)
1008
- rfidScenario.readingBuffer = [[options valueForKey:@"readingBuffer"] intValue];
1009
- if([options valueForKey:@"onlineTAToSignDataType"] != nil)
1010
- rfidScenario.onlineTAToSignDataType = [[options valueForKey:@"onlineTAToSignDataType"] intValue];
1011
- if([options valueForKey:@"onlineTA"] != nil)
1012
- rfidScenario.onlineTA = [[options valueForKey:@"onlineTA"] boolValue];
1013
- if([options valueForKey:@"writeEid"] != nil)
1014
- rfidScenario.writeEid = [[options valueForKey:@"writeEid"] boolValue];
1015
- if([options valueForKey:@"profilerType"] != nil)
1016
- rfidScenario.profilerType = [[options valueForKey:@"profilerType"] intValue];
1017
- if([options valueForKey:@"authProcType"] != nil)
1018
- rfidScenario.authProcType = [[options valueForKey:@"authProcType"] integerValue];
1019
- if([options valueForKey:@"baseSMProcedure"] != nil)
1020
- rfidScenario.baseSMProcedure = [[options valueForKey:@"baseSMProcedure"] integerValue];
1021
- if([options valueForKey:@"pacePasswordType"] != nil)
1022
- rfidScenario.pacePasswordType = [[options valueForKey:@"pacePasswordType"] integerValue];
1023
- if([options valueForKey:@"terminalType"] != nil)
1024
- rfidScenario.terminalType = [[options valueForKey:@"terminalType"] integerValue];
1025
- if([options valueForKey:@"universalAccessRights"] != nil)
1026
- rfidScenario.universalAccessRights = [[options valueForKey:@"universalAccessRights"] boolValue];
1027
- if([options valueForKey:@"authorizedRestrictedIdentification"] != nil)
1028
- rfidScenario.authorizedRestrictedIdentification = [[options valueForKey:@"authorizedRestrictedIdentification"] boolValue];
1029
- if([options valueForKey:@"auxVerificationCommunityID"] != nil)
1030
- rfidScenario.auxVerificationCommunityID = [[options valueForKey:@"auxVerificationCommunityID"] boolValue];
1031
- if([options valueForKey:@"auxVerificationDateOfBirth"] != nil)
1032
- rfidScenario.auxVerificationDateOfBirth = [[options valueForKey:@"auxVerificationDateOfBirth"] boolValue];
1033
- if([options valueForKey:@"skipAA"] != nil)
1034
- rfidScenario.skipAA = [[options valueForKey:@"skipAA"] boolValue];
1035
- if([options valueForKey:@"strictProcessing"] != nil)
1036
- rfidScenario.strictProcessing = [[options valueForKey:@"strictProcessing"] boolValue];
1037
- if([options valueForKey:@"pkdDSCertPriority"] != nil)
1038
- rfidScenario.pkdDSCertPriority = [[options valueForKey:@"pkdDSCertPriority"] boolValue];
1039
- if([options valueForKey:@"pkdUseExternalCSCA"] != nil)
1040
- rfidScenario.pkdUseExternalCSCA = [[options valueForKey:@"pkdUseExternalCSCA"] boolValue];
1041
- if([options valueForKey:@"trustedPKD"] != nil)
1042
- rfidScenario.trustedPKD = [[options valueForKey:@"trustedPKD"] boolValue];
1043
- if([options valueForKey:@"passiveAuth"] != nil)
1044
- rfidScenario.passiveAuth = [[options valueForKey:@"passiveAuth"] boolValue];
1045
- if([options valueForKey:@"paceStaticBinding"] != nil)
1046
- rfidScenario.paceStaticBinding = [[options valueForKey:@"paceStaticBinding"] boolValue];
1047
- if([options valueForKey:@"password"] != nil)
1048
- rfidScenario.password = [options valueForKey:@"password"];
1049
- if([options valueForKey:@"useSFI"] != nil)
1050
- rfidScenario.useSFI = [[options valueForKey:@"useSFI"] boolValue];
1051
- if([options valueForKey:@"pkdPA"] != nil)
1052
- rfidScenario.pkdPA = [options valueForKey:@"pkdPA"];
1053
- if([options valueForKey:@"pkdEAC"] != nil)
1054
- rfidScenario.pkdEAC = [options valueForKey:@"pkdEAC"];
1055
- if([options valueForKey:@"readEPassport"] != nil)
1056
- rfidScenario.readEPassport = [[options valueForKey:@"readEPassport"] boolValue];
1057
- if([options valueForKey:@"readEID"] != nil)
1058
- rfidScenario.readEID = [[options valueForKey:@"readEID"] boolValue];
1059
- if([options valueForKey:@"readEDL"] != nil)
1060
- rfidScenario.readEDL = [[options valueForKey:@"readEDL"] boolValue];
1061
- if([options valueForKey:@"ePassportDataGroups"] != nil)
1062
- rfidScenario.ePassportDataGroups = [self RGLePassportDataGroupFromJson:[options valueForKey:@"ePassportDataGroups"]];
1063
- if([options valueForKey:@"eIDDataGroups"] != nil)
1064
- rfidScenario.eIDDataGroups = [self RGLeIDDataGroupFromJson:[options valueForKey:@"eIDDataGroups"]];
1065
- if([options valueForKey:@"eDLDataGroups"] != nil)
1066
- rfidScenario.eDLDataGroups = [self RGLeDLDataGroupFromJson:[options valueForKey:@"eDLDataGroups"]];
1067
- if([options valueForKey:@"mrz"] != nil)
1068
- rfidScenario.mrz = [options valueForKey:@"mrz"];
1069
- if([options valueForKey:@"eSignPINDefault"] != nil)
1070
- rfidScenario.eSignPINDefault = [options valueForKey:@"eSignPINDefault"];
1071
- if([options valueForKey:@"eSignPINNewValue"] != nil)
1072
- rfidScenario.eSignPINNewValue = [options valueForKey:@"eSignPINNewValue"];
1073
- if([options valueForKey:@"authorizedSTSignature"] != nil)
1074
- rfidScenario.authorizedSTSignature = [[options valueForKey:@"authorizedSTSignature"] boolValue];
1075
- if([options valueForKey:@"authorizedSTQSignature"] != nil)
1076
- rfidScenario.authorizedSTQSignature = [[options valueForKey:@"authorizedSTQSignature"] boolValue];
1077
- if([options valueForKey:@"authorizedWriteDG17"] != nil)
1078
- rfidScenario.authorizedWriteDG17 = [[options valueForKey:@"authorizedWriteDG17"] boolValue];
1079
- if([options valueForKey:@"authorizedWriteDG18"] != nil)
1080
- rfidScenario.authorizedWriteDG18 = [[options valueForKey:@"authorizedWriteDG18"] boolValue];
1081
- if([options valueForKey:@"authorizedWriteDG19"] != nil)
1082
- rfidScenario.authorizedWriteDG19 = [[options valueForKey:@"authorizedWriteDG19"] boolValue];
1083
- if([options valueForKey:@"authorizedWriteDG20"] != nil)
1084
- rfidScenario.authorizedWriteDG20 = [[options valueForKey:@"authorizedWriteDG20"] boolValue];
1085
- if([options valueForKey:@"authorizedWriteDG21"] != nil)
1086
- rfidScenario.authorizedWriteDG21 = [[options valueForKey:@"authorizedWriteDG21"] boolValue];
1087
- if([options valueForKey:@"authorizedVerifyAge"] != nil)
1088
- rfidScenario.authorizedVerifyAge = [[options valueForKey:@"authorizedVerifyAge"] boolValue];
1089
- if([options valueForKey:@"authorizedVerifyCommunityID"] != nil)
1090
- rfidScenario.authorizedVerifyCommunityID = [[options valueForKey:@"authorizedVerifyCommunityID"] boolValue];
1091
- if([options valueForKey:@"authorizedPrivilegedTerminal"] != nil)
1092
- rfidScenario.authorizedPrivilegedTerminal = [[options valueForKey:@"authorizedPrivilegedTerminal"] boolValue];
1093
- if([options valueForKey:@"authorizedCANAllowed"] != nil)
1094
- rfidScenario.authorizedCANAllowed = [[options valueForKey:@"authorizedCANAllowed"] boolValue];
1095
- if([options valueForKey:@"authorizedPINManagment"] != nil)
1096
- rfidScenario.authorizedPINManagment = [[options valueForKey:@"authorizedPINManagment"] boolValue];
1097
- if([options valueForKey:@"authorizedInstallCert"] != nil)
1098
- rfidScenario.authorizedInstallCert = [[options valueForKey:@"authorizedInstallCert"] boolValue];
1099
- if([options valueForKey:@"authorizedInstallQCert"] != nil)
1100
- rfidScenario.authorizedInstallQCert = [[options valueForKey:@"authorizedInstallQCert"] boolValue];
1101
- if([options valueForKey:@"reprocessParams"] != nil)
1102
- rfidScenario.reprocParams = [self RGLReprocParamsFromJSON:[options valueForKey:@"reprocessParams"]];
1103
- if([options valueForKey:@"defaultReadingBufferSize"] != nil)
1104
- rfidScenario.defaultReadingBufferSize = [[options valueForKey:@"defaultReadingBufferSize"] intValue];
1105
- }
1106
-
1107
- +(RGLRFIDParams*)RGLRFIDParamsFromJSON:(NSDictionary*)input {
1108
- RGLRFIDParams* result = [RGLRFIDParams new];
1109
-
1110
- if([input valueForKey:@"paIgnoreNotificationCodes"] != nil)
1111
- result.paIgnoreNotificationCodes = [input valueForKey:@"paIgnoreNotificationCodes"];
1112
-
1113
- return result;
1114
- }
1115
-
1116
- +(RGLFaceAPIParams*)RGLFaceAPIParamsFromJSON:(NSDictionary*)input {
1117
- RGLFaceAPIParams* result = [RGLFaceAPIParams new];
1118
-
1119
- if([input valueForKey:@"url"] != nil)
1120
- result.url = [input valueForKey:@"url"];
1121
- if([input valueForKey:@"mode"] != nil)
1122
- result.mode = [input valueForKey:@"mode"];
1123
- if([input valueForKey:@"threshold"] != nil)
1124
- result.threshold = [input valueForKey:@"threshold"];
1125
- if([input valueForKey:@"searchParams"] != nil)
1126
- result.searchParams = [self RGLFaceAPISearchParamsFromJSON:[input valueForKey:@"searchParams"]];
1127
- if([input valueForKey:@"serviceTimeout"] != nil)
1128
- result.serviceTimeout = [input valueForKey:@"serviceTimeout"];
1129
- if([input valueForKey:@"proxy"] != nil)
1130
- result.proxy = [input valueForKey:@"proxy"];
1131
- if([input valueForKey:@"proxyPassword"] != nil)
1132
- result.proxyPassword = [input valueForKey:@"proxyPassword"];
1133
- if([input valueForKey:@"proxyType"] != nil)
1134
- result.proxyType = [input valueForKey:@"proxyType"];
1135
-
1136
- return result;
1137
- }
1138
-
1139
- +(RGLFaceAPISearchParams*)RGLFaceAPISearchParamsFromJSON:(NSDictionary*)input {
1140
- RGLFaceAPISearchParams* result = [RGLFaceAPISearchParams new];
1141
-
1142
- if([input valueForKey:@"limit"] != nil)
1143
- result.limit = [input valueForKey:@"limit"];
1144
- if([input valueForKey:@"threshold"] != nil)
1145
- result.threshold = [input valueForKey:@"threshold"];
1146
- if([input valueForKey:@"groupIds"] != nil)
1147
- result.groupIDs = [input valueForKey:@"groupIds"];
1148
-
1149
- return result;
1150
- }
1151
-
1152
- @end