-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e683555
commit 772f65d
Showing
9 changed files
with
192 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
BlinkID/src/ios/sources/Recognizers/Wrappers/MBPassportRecognizerWrapper.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#import "MBRecognizerWrapper.h" | ||
#import <MicroBlink/MicroBlink.h> | ||
|
||
@interface MBPassportRecognizerCreator : NSObject<MBRecognizerCreator> | ||
|
||
@end |
75 changes: 75 additions & 0 deletions
75
BlinkID/src/ios/sources/Recognizers/Wrappers/MBPassportRecognizerWrapper.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#import "MBPassportRecognizerWrapper.h" | ||
#import "MBSerializationUtils.h" | ||
#import "MBBlinkIDSerializationUtils.h" | ||
|
||
@implementation MBPassportRecognizerCreator | ||
|
||
@synthesize jsonName = _jsonName; | ||
|
||
-(instancetype) init { | ||
self = [super init]; | ||
if (self) { | ||
_jsonName = @"PassportRecognizer"; | ||
} | ||
return self; | ||
} | ||
|
||
-(MBRecognizer *) createRecognizer:(NSDictionary*) jsonRecognizer { | ||
MBPassportRecognizer *recognizer = [[MBPassportRecognizer alloc] init]; | ||
{ | ||
id detectGlare = [jsonRecognizer valueForKey:@"detectGlare"]; | ||
if (detectGlare != nil) { | ||
recognizer.detectGlare = [(NSNumber *)detectGlare boolValue]; | ||
} | ||
} | ||
{ | ||
id faceImageDpi = [jsonRecognizer valueForKey:@"faceImageDpi"]; | ||
if (faceImageDpi != nil) { | ||
recognizer.faceImageDpi = [(NSNumber *)faceImageDpi unsignedIntegerValue]; | ||
} | ||
} | ||
{ | ||
id fullDocumentImageDpi = [jsonRecognizer valueForKey:@"fullDocumentImageDpi"]; | ||
if (fullDocumentImageDpi != nil) { | ||
recognizer.fullDocumentImageDpi = [(NSNumber *)fullDocumentImageDpi unsignedIntegerValue]; | ||
} | ||
} | ||
{ | ||
id fullDocumentImageExtensionFactors = [jsonRecognizer valueForKey:@"fullDocumentImageExtensionFactors"]; | ||
if (fullDocumentImageExtensionFactors != nil) { | ||
recognizer.fullDocumentImageExtensionFactors = [MBBlinkIDSerializationUtils deserializeMBImageExtensionFactors:(NSDictionary*)fullDocumentImageExtensionFactors]; | ||
} | ||
} | ||
{ | ||
id returnFaceImage = [jsonRecognizer valueForKey:@"returnFaceImage"]; | ||
if (returnFaceImage != nil) { | ||
recognizer.returnFaceImage = [(NSNumber *)returnFaceImage boolValue]; | ||
} | ||
} | ||
{ | ||
id returnFullDocumentImage = [jsonRecognizer valueForKey:@"returnFullDocumentImage"]; | ||
if (returnFullDocumentImage != nil) { | ||
recognizer.returnFullDocumentImage = [(NSNumber *)returnFullDocumentImage boolValue]; | ||
} | ||
} | ||
|
||
return recognizer; | ||
} | ||
|
||
@end | ||
|
||
@interface MBPassportRecognizer (JsonSerialization) | ||
@end | ||
|
||
@implementation MBPassportRecognizer (JsonSerialization) | ||
|
||
-(NSDictionary *) serializeResult { | ||
NSMutableDictionary* jsonResult = (NSMutableDictionary*)[super serializeResult]; | ||
[jsonResult setValue:[MBSerializationUtils encodeMBImage:self.result.faceImage] forKey:@"faceImage"]; | ||
[jsonResult setValue:[MBSerializationUtils encodeMBImage:self.result.fullDocumentImage] forKey:@"fullDocumentImage"]; | ||
[jsonResult setValue:[MBBlinkIDSerializationUtils serializeMrzResult:self.result.mrzResult] forKey:@"mrzResult"]; | ||
|
||
return jsonResult; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters