@trustchex/react-native-sdk 1.161.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +49 -0
- package/README.md +223 -0
- package/TrustchexSDK.podspec +26 -0
- package/android/build.gradle +103 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +11 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/TrustchexSDKModule.kt +40 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/TrustchexSDKPackage.kt +61 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/barcodescanner/BarcodeScannerFrameProcessorPlugin.kt +301 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/BitmapUtils.kt +205 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/CropperPlugin.kt +72 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/cropper/FrameMetadata.kt +4 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/facedetector/FaceDetectorFrameProcessorPlugin.kt +303 -0
- package/android/src/main/java/com/trustchex/reactnativesdk/visioncameraplugins/textrecognition/TextRecognitionFrameProcessorPlugin.kt +115 -0
- package/ios/TrustchexSDK.h +5 -0
- package/ios/TrustchexSDK.mm +28 -0
- package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin.mm +22 -0
- package/ios/VisionCameraPlugins/BarcodeScanner/BarcodeScannerFrameProcessorPlugin.swift +172 -0
- package/ios/VisionCameraPlugins/Cropper/Cropper-Bridging-Header.h +13 -0
- package/ios/VisionCameraPlugins/Cropper/Cropper.h +20 -0
- package/ios/VisionCameraPlugins/Cropper/Cropper.mm +22 -0
- package/ios/VisionCameraPlugins/Cropper/Cropper.swift +145 -0
- package/ios/VisionCameraPlugins/Cropper/CropperUtils.swift +49 -0
- package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin-Bridging-Header.h +4 -0
- package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin.mm +22 -0
- package/ios/VisionCameraPlugins/FaceDetector/FaceDetectorFrameProcessorPlugin.swift +320 -0
- package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin-Bridging-Header.h +4 -0
- package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin.mm +27 -0
- package/ios/VisionCameraPlugins/TextRecognition/TextRecognitionFrameProcessorPlugin.swift +144 -0
- package/lib/module/NativeTrustchexSDK.js +4 -0
- package/lib/module/Screens/Dynamic/ContractAcceptanceScreen.js +141 -0
- package/lib/module/Screens/Dynamic/IdentityDocumentEIDScanningScreen.js +140 -0
- package/lib/module/Screens/Dynamic/IdentityDocumentScanningScreen.js +100 -0
- package/lib/module/Screens/Dynamic/LivenessDetectionScreen.js +596 -0
- package/lib/module/Screens/Static/QrCodeScanningScreen.js +36 -0
- package/lib/module/Screens/Static/ResultScreen.js +627 -0
- package/lib/module/Screens/Static/VerificationSessionCheckScreen.js +381 -0
- package/lib/module/Shared/Animations/face-scan.json +1 -0
- package/lib/module/Shared/Animations/hole.json +76 -0
- package/lib/module/Shared/Animations/hologram-scan.json +1 -0
- package/lib/module/Shared/Animations/id-or-passport.json +1 -0
- package/lib/module/Shared/Animations/light.json +1 -0
- package/lib/module/Shared/Animations/loading.json +1 -0
- package/lib/module/Shared/Animations/nfc-scan.json +1 -0
- package/lib/module/Shared/Animations/nfc.json +1 -0
- package/lib/module/Shared/Animations/scanning.json +1 -0
- package/lib/module/Shared/Animations/success.json +1 -0
- package/lib/module/Shared/Assets/trustchex-logo-black.png +0 -0
- package/lib/module/Shared/Components/EIDScanner.js +372 -0
- package/lib/module/Shared/Components/FaceCamera.js +223 -0
- package/lib/module/Shared/Components/IdentityDocumentCamera.js +968 -0
- package/lib/module/Shared/Components/LanguageSelector.js +53 -0
- package/lib/module/Shared/Components/NativeCircularProgress.js +64 -0
- package/lib/module/Shared/Components/NativeProgressBar.js +53 -0
- package/lib/module/Shared/Components/NavigationManager.js +180 -0
- package/lib/module/Shared/Components/OTPCodeInput.js +74 -0
- package/lib/module/Shared/Components/QrCodeScannerCamera.js +262 -0
- package/lib/module/Shared/Contexts/AppContext.js +27 -0
- package/lib/module/Shared/EIDReader/abstractMRTDCardService.js +4 -0
- package/lib/module/Shared/EIDReader/accessKeySpec.js +1 -0
- package/lib/module/Shared/EIDReader/apduLevelBACCapable.js +1 -0
- package/lib/module/Shared/EIDReader/apduLevelReadBinaryCapable.js +3 -0
- package/lib/module/Shared/EIDReader/bacKey.js +112 -0
- package/lib/module/Shared/EIDReader/bacKeySpec.js +3 -0
- package/lib/module/Shared/EIDReader/cardFileInputStream.js +140 -0
- package/lib/module/Shared/EIDReader/cardService.js +31 -0
- package/lib/module/Shared/EIDReader/cbeff/biometricDataBlock.js +3 -0
- package/lib/module/Shared/EIDReader/cbeff/biometricDataBlockDecoder.js +3 -0
- package/lib/module/Shared/EIDReader/cbeff/biometricDataBlockEncoder.js +3 -0
- package/lib/module/Shared/EIDReader/cbeff/cbeffInfo.js +102 -0
- package/lib/module/Shared/EIDReader/cbeff/complexCBEFFInfo.js +46 -0
- package/lib/module/Shared/EIDReader/cbeff/faceDataBlockDecoder.js +8 -0
- package/lib/module/Shared/EIDReader/cbeff/iso781611.js +79 -0
- package/lib/module/Shared/EIDReader/cbeff/iso781611Decoder.js +141 -0
- package/lib/module/Shared/EIDReader/cbeff/iso781611Encoder.js +53 -0
- package/lib/module/Shared/EIDReader/cbeff/simpleCBEFFInfo.js +21 -0
- package/lib/module/Shared/EIDReader/cbeff/standardBiometricHeader.js +97 -0
- package/lib/module/Shared/EIDReader/cert/cvcPrincipal.js +48 -0
- package/lib/module/Shared/EIDReader/data/country.js +66 -0
- package/lib/module/Shared/EIDReader/data/gender.js +29 -0
- package/lib/module/Shared/EIDReader/data/isoCountry.js +283 -0
- package/lib/module/Shared/EIDReader/data/unicodeCountry.js +278 -0
- package/lib/module/Shared/EIDReader/defaultFileInfo.js +29 -0
- package/lib/module/Shared/EIDReader/defaultFileSystem.js +171 -0
- package/lib/module/Shared/EIDReader/eidReader.js +90 -0
- package/lib/module/Shared/EIDReader/eidService.js +280 -0
- package/lib/module/Shared/EIDReader/fileInfo.js +3 -0
- package/lib/module/Shared/EIDReader/fileSystemCardService.js +4 -0
- package/lib/module/Shared/EIDReader/fragment.js +17 -0
- package/lib/module/Shared/EIDReader/fragmentBuffer.js +130 -0
- package/lib/module/Shared/EIDReader/java/byteArrayInputStream.js +73 -0
- package/lib/module/Shared/EIDReader/java/byteArrayOutputStream.js +55 -0
- package/lib/module/Shared/EIDReader/java/dataInput.js +1 -0
- package/lib/module/Shared/EIDReader/java/dataInputStream.js +167 -0
- package/lib/module/Shared/EIDReader/java/dataOutputStream.js +91 -0
- package/lib/module/Shared/EIDReader/java/filterInputStream.js +134 -0
- package/lib/module/Shared/EIDReader/java/filterOutputStream.js +124 -0
- package/lib/module/Shared/EIDReader/java/inputStream.js +139 -0
- package/lib/module/Shared/EIDReader/java/inputStreamBuffer.js +144 -0
- package/lib/module/Shared/EIDReader/java/objectInputStream.js +39 -0
- package/lib/module/Shared/EIDReader/java/outputStream.js +77 -0
- package/lib/module/Shared/EIDReader/java/positionInputStream.js +50 -0
- package/lib/module/Shared/EIDReader/java/splittableInputStream.js +54 -0
- package/lib/module/Shared/EIDReader/lds/abstractImageInfo.js +137 -0
- package/lib/module/Shared/EIDReader/lds/abstractLDSFile.js +101 -0
- package/lib/module/Shared/EIDReader/lds/abstractLDSInfo.js +29 -0
- package/lib/module/Shared/EIDReader/lds/abstractListInfo.js +66 -0
- package/lib/module/Shared/EIDReader/lds/abstractTaggedLDSFile.js +65 -0
- package/lib/module/Shared/EIDReader/lds/cbeffDataGroup.js +118 -0
- package/lib/module/Shared/EIDReader/lds/cvcaFile.js +89 -0
- package/lib/module/Shared/EIDReader/lds/dataGroup.js +10 -0
- package/lib/module/Shared/EIDReader/lds/icao/comFile.js +101 -0
- package/lib/module/Shared/EIDReader/lds/icao/dg1File.js +33 -0
- package/lib/module/Shared/EIDReader/lds/icao/dg2File.js +42 -0
- package/lib/module/Shared/EIDReader/lds/icao/icaoCountry.js +114 -0
- package/lib/module/Shared/EIDReader/lds/icao/mrzInfo.js +1418 -0
- package/lib/module/Shared/EIDReader/lds/imageInfo.js +3 -0
- package/lib/module/Shared/EIDReader/lds/iso19794/faceImageInfo.js +817 -0
- package/lib/module/Shared/EIDReader/lds/iso19794/faceInfo.js +116 -0
- package/lib/module/Shared/EIDReader/lds/ldsElement.js +1 -0
- package/lib/module/Shared/EIDReader/lds/ldsFile.js +3 -0
- package/lib/module/Shared/EIDReader/nfcManagerCardService.js +44 -0
- package/lib/module/Shared/EIDReader/protocol/bacAPDUSender.js +83 -0
- package/lib/module/Shared/EIDReader/protocol/bacProtocol.js +70 -0
- package/lib/module/Shared/EIDReader/protocol/bacResult.js +32 -0
- package/lib/module/Shared/EIDReader/protocol/readBinaryAPDUSender.js +126 -0
- package/lib/module/Shared/EIDReader/protocol/secureMessagingAPDUSender.js +102 -0
- package/lib/module/Shared/EIDReader/secureMessagingWrapper.js +218 -0
- package/lib/module/Shared/EIDReader/smartcards/apduEvent.js +23 -0
- package/lib/module/Shared/EIDReader/smartcards/apduListener.js +3 -0
- package/lib/module/Shared/EIDReader/smartcards/apduWrapper.js +3 -0
- package/lib/module/Shared/EIDReader/smartcards/commandAPDU.js +124 -0
- package/lib/module/Shared/EIDReader/smartcards/fileSystemStructured.js +3 -0
- package/lib/module/Shared/EIDReader/smartcards/iso7816.js +107 -0
- package/lib/module/Shared/EIDReader/smartcards/responseAPDU.js +35 -0
- package/lib/module/Shared/EIDReader/tlv/asn1Constants.js +48 -0
- package/lib/module/Shared/EIDReader/tlv/tlv.utils.js +186 -0
- package/lib/module/Shared/EIDReader/tlv/tlvInputState.js +141 -0
- package/lib/module/Shared/EIDReader/tlv/tlvInputStream.js +180 -0
- package/lib/module/Shared/EIDReader/tlv/tlvOutputState.js +186 -0
- package/lib/module/Shared/EIDReader/tlv/tlvOutputStream.js +85 -0
- package/lib/module/Shared/EIDReader/tripleDesSecureMessagingWrapper.js +37 -0
- package/lib/module/Shared/EIDReader/utils/crypto.utils.js +218 -0
- package/lib/module/Shared/EIDReader/utils/random.js +166 -0
- package/lib/module/Shared/EIDReader/wrappedAPDUEvent.js +16 -0
- package/lib/module/Shared/Libs/camera.utils.js +32 -0
- package/lib/module/Shared/Libs/contains.js +40 -0
- package/lib/module/Shared/Libs/crypto.utils.js +35 -0
- package/lib/module/Shared/Libs/debounce.utils.js +35 -0
- package/lib/module/Shared/Libs/deeplink.utils.js +20 -0
- package/lib/module/Shared/Libs/demo.utils.js +57 -0
- package/lib/module/Shared/Libs/http-client.js +104 -0
- package/lib/module/Shared/Libs/mrz.utils.js +99 -0
- package/lib/module/Shared/Libs/native-device-info.utils.js +44 -0
- package/lib/module/Shared/Libs/native-keep-awake.utils.js +85 -0
- package/lib/module/Shared/Libs/opencv.utils.js +21 -0
- package/lib/module/Shared/Libs/promise.utils.js +17 -0
- package/lib/module/Shared/Libs/tts.utils.js +31 -0
- package/lib/module/Shared/Types/identificationInfo.js +3 -0
- package/lib/module/Shared/Types/instruction.js +1 -0
- package/lib/module/Shared/Types/livenessIntructionType.js +1 -0
- package/lib/module/Shared/Types/verificationSession.js +3 -0
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/components/BarcodeCamera.js +66 -0
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.js +46 -0
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.js +34 -0
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/index.js +21 -0
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.js +24 -0
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/types.js +3 -0
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.js +197 -0
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.js +101 -0
- package/lib/module/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.js +60 -0
- package/lib/module/Shared/VisionCameraPlugins/Cropper/index.js +47 -0
- package/lib/module/Shared/VisionCameraPlugins/FaceDetector/Camera.js +42 -0
- package/lib/module/Shared/VisionCameraPlugins/FaceDetector/detectFaces.js +35 -0
- package/lib/module/Shared/VisionCameraPlugins/FaceDetector/index.js +4 -0
- package/lib/module/Shared/VisionCameraPlugins/FaceDetector/types.js +3 -0
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/Camera.js +56 -0
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.js +20 -0
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.js +9 -0
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/index.js +6 -0
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/scanText.js +20 -0
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/translateText.js +19 -0
- package/lib/module/Shared/VisionCameraPlugins/TextRecognition/types.js +3 -0
- package/lib/module/Translation/Resources/en.js +109 -0
- package/lib/module/Translation/Resources/index.js +4 -0
- package/lib/module/Translation/Resources/tr.js +112 -0
- package/lib/module/Translation/index.js +27 -0
- package/lib/module/Trustchex.js +149 -0
- package/lib/module/index.js +5 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/NativeTrustchexSDK.d.ts +8 -0
- package/lib/typescript/src/NativeTrustchexSDK.d.ts.map +1 -0
- package/lib/typescript/src/Screens/Dynamic/ContractAcceptanceScreen.d.ts +3 -0
- package/lib/typescript/src/Screens/Dynamic/ContractAcceptanceScreen.d.ts.map +1 -0
- package/lib/typescript/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.d.ts +3 -0
- package/lib/typescript/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.d.ts.map +1 -0
- package/lib/typescript/src/Screens/Dynamic/IdentityDocumentScanningScreen.d.ts +3 -0
- package/lib/typescript/src/Screens/Dynamic/IdentityDocumentScanningScreen.d.ts.map +1 -0
- package/lib/typescript/src/Screens/Dynamic/LivenessDetectionScreen.d.ts +3 -0
- package/lib/typescript/src/Screens/Dynamic/LivenessDetectionScreen.d.ts.map +1 -0
- package/lib/typescript/src/Screens/Static/QrCodeScanningScreen.d.ts +3 -0
- package/lib/typescript/src/Screens/Static/QrCodeScanningScreen.d.ts.map +1 -0
- package/lib/typescript/src/Screens/Static/ResultScreen.d.ts +3 -0
- package/lib/typescript/src/Screens/Static/ResultScreen.d.ts.map +1 -0
- package/lib/typescript/src/Screens/Static/VerificationSessionCheckScreen.d.ts +3 -0
- package/lib/typescript/src/Screens/Static/VerificationSessionCheckScreen.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Components/EIDScanner.d.ts +12 -0
- package/lib/typescript/src/Shared/Components/EIDScanner.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Components/FaceCamera.d.ts +9 -0
- package/lib/typescript/src/Shared/Components/FaceCamera.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts +58 -0
- package/lib/typescript/src/Shared/Components/IdentityDocumentCamera.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Components/LanguageSelector.d.ts +3 -0
- package/lib/typescript/src/Shared/Components/LanguageSelector.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Components/NativeCircularProgress.d.ts +13 -0
- package/lib/typescript/src/Shared/Components/NativeCircularProgress.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Components/NativeProgressBar.d.ts +12 -0
- package/lib/typescript/src/Shared/Components/NativeProgressBar.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Components/NavigationManager.d.ts +11 -0
- package/lib/typescript/src/Shared/Components/NavigationManager.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Components/OTPCodeInput.d.ts +10 -0
- package/lib/typescript/src/Shared/Components/OTPCodeInput.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Components/QrCodeScannerCamera.d.ts +6 -0
- package/lib/typescript/src/Shared/Components/QrCodeScannerCamera.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Contexts/AppContext.d.ts +20 -0
- package/lib/typescript/src/Shared/Contexts/AppContext.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/abstractMRTDCardService.d.ts +50 -0
- package/lib/typescript/src/Shared/EIDReader/abstractMRTDCardService.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/accessKeySpec.d.ts +16 -0
- package/lib/typescript/src/Shared/EIDReader/accessKeySpec.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/apduLevelBACCapable.d.ts +5 -0
- package/lib/typescript/src/Shared/EIDReader/apduLevelBACCapable.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/apduLevelReadBinaryCapable.d.ts +8 -0
- package/lib/typescript/src/Shared/EIDReader/apduLevelReadBinaryCapable.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/bacKey.d.ts +65 -0
- package/lib/typescript/src/Shared/EIDReader/bacKey.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/bacKeySpec.d.ts +24 -0
- package/lib/typescript/src/Shared/EIDReader/bacKeySpec.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/cardFileInputStream.d.ts +26 -0
- package/lib/typescript/src/Shared/EIDReader/cardFileInputStream.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/cardService.d.ts +22 -0
- package/lib/typescript/src/Shared/EIDReader/cardService.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/biometricDataBlock.d.ts +5 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/biometricDataBlock.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/biometricDataBlockDecoder.d.ts +7 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/biometricDataBlockDecoder.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/biometricDataBlockEncoder.d.ts +6 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/biometricDataBlockEncoder.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/cbeffInfo.d.ts +61 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/cbeffInfo.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/complexCBEFFInfo.d.ts +33 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/complexCBEFFInfo.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/faceDataBlockDecoder.d.ts +8 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/faceDataBlockDecoder.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/iso781611.d.ts +60 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/iso781611.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/iso781611Decoder.d.ts +19 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/iso781611Decoder.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/iso781611Encoder.d.ts +15 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/iso781611Encoder.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/simpleCBEFFInfo.d.ts +18 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/simpleCBEFFInfo.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/standardBiometricHeader.d.ts +43 -0
- package/lib/typescript/src/Shared/EIDReader/cbeff/standardBiometricHeader.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/cert/cvcPrincipal.d.ts +14 -0
- package/lib/typescript/src/Shared/EIDReader/cert/cvcPrincipal.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/data/country.d.ts +14 -0
- package/lib/typescript/src/Shared/EIDReader/data/country.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/data/gender.d.ts +14 -0
- package/lib/typescript/src/Shared/EIDReader/data/gender.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/data/isoCountry.d.ts +268 -0
- package/lib/typescript/src/Shared/EIDReader/data/isoCountry.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/data/unicodeCountry.d.ts +263 -0
- package/lib/typescript/src/Shared/EIDReader/data/unicodeCountry.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/defaultFileInfo.d.ts +14 -0
- package/lib/typescript/src/Shared/EIDReader/defaultFileInfo.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/defaultFileSystem.d.ts +30 -0
- package/lib/typescript/src/Shared/EIDReader/defaultFileSystem.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/eidReader.d.ts +8 -0
- package/lib/typescript/src/Shared/EIDReader/eidReader.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/eidService.d.ts +150 -0
- package/lib/typescript/src/Shared/EIDReader/eidService.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/fileInfo.d.ts +5 -0
- package/lib/typescript/src/Shared/EIDReader/fileInfo.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/fileSystemCardService.d.ts +28 -0
- package/lib/typescript/src/Shared/EIDReader/fileSystemCardService.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/fragment.d.ts +9 -0
- package/lib/typescript/src/Shared/EIDReader/fragment.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/fragmentBuffer.d.ts +22 -0
- package/lib/typescript/src/Shared/EIDReader/fragmentBuffer.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/java/byteArrayInputStream.d.ts +22 -0
- package/lib/typescript/src/Shared/EIDReader/java/byteArrayInputStream.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/java/byteArrayOutputStream.d.ts +18 -0
- package/lib/typescript/src/Shared/EIDReader/java/byteArrayOutputStream.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/java/dataInput.d.ts +17 -0
- package/lib/typescript/src/Shared/EIDReader/java/dataInput.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/java/dataInputStream.d.ts +28 -0
- package/lib/typescript/src/Shared/EIDReader/java/dataInputStream.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/java/dataOutputStream.d.ts +18 -0
- package/lib/typescript/src/Shared/EIDReader/java/dataOutputStream.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/java/filterInputStream.d.ts +103 -0
- package/lib/typescript/src/Shared/EIDReader/java/filterInputStream.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/java/filterOutputStream.d.ts +83 -0
- package/lib/typescript/src/Shared/EIDReader/java/filterOutputStream.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/java/inputStream.d.ts +21 -0
- package/lib/typescript/src/Shared/EIDReader/java/inputStream.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/java/inputStreamBuffer.d.ts +32 -0
- package/lib/typescript/src/Shared/EIDReader/java/inputStreamBuffer.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/java/objectInputStream.d.ts +11 -0
- package/lib/typescript/src/Shared/EIDReader/java/objectInputStream.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/java/outputStream.d.ts +64 -0
- package/lib/typescript/src/Shared/EIDReader/java/outputStream.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/java/positionInputStream.d.ts +17 -0
- package/lib/typescript/src/Shared/EIDReader/java/positionInputStream.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/java/splittableInputStream.d.ts +19 -0
- package/lib/typescript/src/Shared/EIDReader/java/splittableInputStream.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/abstractImageInfo.d.ts +50 -0
- package/lib/typescript/src/Shared/EIDReader/lds/abstractImageInfo.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/abstractLDSFile.d.ts +71 -0
- package/lib/typescript/src/Shared/EIDReader/lds/abstractLDSFile.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/abstractLDSInfo.d.ts +19 -0
- package/lib/typescript/src/Shared/EIDReader/lds/abstractLDSInfo.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/abstractListInfo.d.ts +45 -0
- package/lib/typescript/src/Shared/EIDReader/lds/abstractListInfo.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/abstractTaggedLDSFile.d.ts +18 -0
- package/lib/typescript/src/Shared/EIDReader/lds/abstractTaggedLDSFile.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/cbeffDataGroup.d.ts +59 -0
- package/lib/typescript/src/Shared/EIDReader/lds/cbeffDataGroup.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/cvcaFile.d.ts +19 -0
- package/lib/typescript/src/Shared/EIDReader/lds/cvcaFile.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/dataGroup.d.ts +8 -0
- package/lib/typescript/src/Shared/EIDReader/lds/dataGroup.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/icao/comFile.d.ts +22 -0
- package/lib/typescript/src/Shared/EIDReader/lds/icao/comFile.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/icao/dg1File.d.ts +13 -0
- package/lib/typescript/src/Shared/EIDReader/lds/icao/dg1File.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/icao/dg2File.d.ts +14 -0
- package/lib/typescript/src/Shared/EIDReader/lds/icao/dg2File.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/icao/icaoCountry.d.ts +80 -0
- package/lib/typescript/src/Shared/EIDReader/lds/icao/icaoCountry.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/icao/mrzInfo.d.ts +579 -0
- package/lib/typescript/src/Shared/EIDReader/lds/icao/mrzInfo.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/imageInfo.d.ts +52 -0
- package/lib/typescript/src/Shared/EIDReader/lds/imageInfo.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/iso19794/faceImageInfo.d.ts +392 -0
- package/lib/typescript/src/Shared/EIDReader/lds/iso19794/faceImageInfo.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/iso19794/faceInfo.d.ts +22 -0
- package/lib/typescript/src/Shared/EIDReader/lds/iso19794/faceInfo.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/ldsElement.d.ts +9 -0
- package/lib/typescript/src/Shared/EIDReader/lds/ldsElement.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/lds/ldsFile.d.ts +10 -0
- package/lib/typescript/src/Shared/EIDReader/lds/ldsFile.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/nfcManagerCardService.d.ts +13 -0
- package/lib/typescript/src/Shared/EIDReader/nfcManagerCardService.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/protocol/bacAPDUSender.d.ts +9 -0
- package/lib/typescript/src/Shared/EIDReader/protocol/bacAPDUSender.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/protocol/bacProtocol.d.ts +17 -0
- package/lib/typescript/src/Shared/EIDReader/protocol/bacProtocol.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/protocol/bacResult.d.ts +26 -0
- package/lib/typescript/src/Shared/EIDReader/protocol/bacResult.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/protocol/readBinaryAPDUSender.d.ts +15 -0
- package/lib/typescript/src/Shared/EIDReader/protocol/readBinaryAPDUSender.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/protocol/secureMessagingAPDUSender.d.ts +19 -0
- package/lib/typescript/src/Shared/EIDReader/protocol/secureMessagingAPDUSender.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/secureMessagingWrapper.d.ts +30 -0
- package/lib/typescript/src/Shared/EIDReader/secureMessagingWrapper.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/smartcards/apduEvent.d.ts +15 -0
- package/lib/typescript/src/Shared/EIDReader/smartcards/apduEvent.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/smartcards/apduListener.d.ts +5 -0
- package/lib/typescript/src/Shared/EIDReader/smartcards/apduListener.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/smartcards/apduWrapper.d.ts +8 -0
- package/lib/typescript/src/Shared/EIDReader/smartcards/apduWrapper.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/smartcards/commandAPDU.d.ts +20 -0
- package/lib/typescript/src/Shared/EIDReader/smartcards/commandAPDU.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/smartcards/fileSystemStructured.d.ts +7 -0
- package/lib/typescript/src/Shared/EIDReader/smartcards/fileSystemStructured.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/smartcards/iso7816.d.ts +101 -0
- package/lib/typescript/src/Shared/EIDReader/smartcards/iso7816.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/smartcards/responseAPDU.d.ts +13 -0
- package/lib/typescript/src/Shared/EIDReader/smartcards/responseAPDU.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/asn1Constants.d.ts +36 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/asn1Constants.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlv.utils.d.ts +44 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlv.utils.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlvInputState.d.ts +34 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlvInputState.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlvInputStream.d.ts +23 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlvInputStream.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlvOutputState.d.ts +24 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlvOutputState.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlvOutputStream.d.ts +16 -0
- package/lib/typescript/src/Shared/EIDReader/tlv/tlvOutputStream.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/tripleDesSecureMessagingWrapper.d.ts +10 -0
- package/lib/typescript/src/Shared/EIDReader/tripleDesSecureMessagingWrapper.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/utils/crypto.utils.d.ts +16 -0
- package/lib/typescript/src/Shared/EIDReader/utils/crypto.utils.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/utils/random.d.ts +25 -0
- package/lib/typescript/src/Shared/EIDReader/utils/random.d.ts.map +1 -0
- package/lib/typescript/src/Shared/EIDReader/wrappedAPDUEvent.d.ts +11 -0
- package/lib/typescript/src/Shared/EIDReader/wrappedAPDUEvent.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/camera.utils.d.ts +5 -0
- package/lib/typescript/src/Shared/Libs/camera.utils.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/contains.d.ts +14 -0
- package/lib/typescript/src/Shared/Libs/contains.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/crypto.utils.d.ts +9 -0
- package/lib/typescript/src/Shared/Libs/crypto.utils.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/debounce.utils.d.ts +10 -0
- package/lib/typescript/src/Shared/Libs/debounce.utils.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/deeplink.utils.d.ts +5 -0
- package/lib/typescript/src/Shared/Libs/deeplink.utils.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/demo.utils.d.ts +5 -0
- package/lib/typescript/src/Shared/Libs/demo.utils.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/http-client.d.ts +27 -0
- package/lib/typescript/src/Shared/Libs/http-client.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts +9 -0
- package/lib/typescript/src/Shared/Libs/mrz.utils.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/native-device-info.utils.d.ts +14 -0
- package/lib/typescript/src/Shared/Libs/native-device-info.utils.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/native-keep-awake.utils.d.ts +31 -0
- package/lib/typescript/src/Shared/Libs/native-keep-awake.utils.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/opencv.utils.d.ts +3 -0
- package/lib/typescript/src/Shared/Libs/opencv.utils.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/promise.utils.d.ts +3 -0
- package/lib/typescript/src/Shared/Libs/promise.utils.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Libs/tts.utils.d.ts +6 -0
- package/lib/typescript/src/Shared/Libs/tts.utils.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Types/identificationInfo.d.ts +57 -0
- package/lib/typescript/src/Shared/Types/identificationInfo.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Types/instruction.d.ts +5 -0
- package/lib/typescript/src/Shared/Types/instruction.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Types/livenessIntructionType.d.ts +2 -0
- package/lib/typescript/src/Shared/Types/livenessIntructionType.d.ts.map +1 -0
- package/lib/typescript/src/Shared/Types/verificationSession.d.ts +16 -0
- package/lib/typescript/src/Shared/Types/verificationSession.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/components/BarcodeCamera.d.ts +13 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/components/BarcodeCamera.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.d.ts +13 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.d.ts +6 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/index.d.ts +14 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/index.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.d.ts +3 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/types.d.ts +52 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/types.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.d.ts +62 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.d.ts +34 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.d.ts +32 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/Cropper/index.d.ts +23 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/Cropper/index.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/Camera.d.ts +9 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/Camera.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.d.ts +3 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/index.d.ts +3 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/index.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/types.d.ts +79 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/FaceDetector/types.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/Camera.d.ts +6 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/Camera.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.d.ts +3 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.d.ts +3 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/index.d.ts +5 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/index.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/scanText.d.ts +3 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/scanText.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/translateText.d.ts +3 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/translateText.d.ts.map +1 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/types.d.ts +67 -0
- package/lib/typescript/src/Shared/VisionCameraPlugins/TextRecognition/types.d.ts.map +1 -0
- package/lib/typescript/src/Translation/Resources/en.d.ts +109 -0
- package/lib/typescript/src/Translation/Resources/en.d.ts.map +1 -0
- package/lib/typescript/src/Translation/Resources/index.d.ts +3 -0
- package/lib/typescript/src/Translation/Resources/index.d.ts.map +1 -0
- package/lib/typescript/src/Translation/Resources/tr.d.ts +112 -0
- package/lib/typescript/src/Translation/Resources/tr.d.ts.map +1 -0
- package/lib/typescript/src/Translation/index.d.ts +3 -0
- package/lib/typescript/src/Translation/index.d.ts.map +1 -0
- package/lib/typescript/src/Trustchex.d.ts +18 -0
- package/lib/typescript/src/Trustchex.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +4 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +288 -0
- package/src/NativeTrustchexSDK.ts +9 -0
- package/src/Screens/Dynamic/ContractAcceptanceScreen.tsx +165 -0
- package/src/Screens/Dynamic/IdentityDocumentEIDScanningScreen.tsx +205 -0
- package/src/Screens/Dynamic/IdentityDocumentScanningScreen.tsx +152 -0
- package/src/Screens/Dynamic/LivenessDetectionScreen.tsx +699 -0
- package/src/Screens/Static/QrCodeScanningScreen.tsx +37 -0
- package/src/Screens/Static/ResultScreen.tsx +877 -0
- package/src/Screens/Static/VerificationSessionCheckScreen.tsx +524 -0
- package/src/Shared/Animations/face-scan.json +1 -0
- package/src/Shared/Animations/hole.json +76 -0
- package/src/Shared/Animations/hologram-scan.json +1 -0
- package/src/Shared/Animations/id-or-passport.json +1 -0
- package/src/Shared/Animations/light.json +1 -0
- package/src/Shared/Animations/loading.json +1 -0
- package/src/Shared/Animations/nfc-scan.json +1 -0
- package/src/Shared/Animations/nfc.json +1 -0
- package/src/Shared/Animations/scanning.json +1 -0
- package/src/Shared/Animations/success.json +1 -0
- package/src/Shared/Assets/trustchex-logo-black.png +0 -0
- package/src/Shared/Components/EIDScanner.tsx +472 -0
- package/src/Shared/Components/FaceCamera.tsx +267 -0
- package/src/Shared/Components/IdentityDocumentCamera.tsx +1377 -0
- package/src/Shared/Components/LanguageSelector.tsx +62 -0
- package/src/Shared/Components/NativeCircularProgress.tsx +76 -0
- package/src/Shared/Components/NativeProgressBar.tsx +74 -0
- package/src/Shared/Components/NavigationManager.tsx +275 -0
- package/src/Shared/Components/OTPCodeInput.tsx +93 -0
- package/src/Shared/Components/QrCodeScannerCamera.tsx +306 -0
- package/src/Shared/Contexts/AppContext.ts +47 -0
- package/src/Shared/EIDReader/abstractMRTDCardService.ts +195 -0
- package/src/Shared/EIDReader/accessKeySpec.ts +16 -0
- package/src/Shared/EIDReader/apduLevelBACCapable.ts +10 -0
- package/src/Shared/EIDReader/apduLevelReadBinaryCapable.ts +15 -0
- package/src/Shared/EIDReader/bacKey.ts +132 -0
- package/src/Shared/EIDReader/bacKeySpec.ts +26 -0
- package/src/Shared/EIDReader/cardFileInputStream.ts +188 -0
- package/src/Shared/EIDReader/cardService.ts +51 -0
- package/src/Shared/EIDReader/cbeff/biometricDataBlock.ts +5 -0
- package/src/Shared/EIDReader/cbeff/biometricDataBlockDecoder.ts +12 -0
- package/src/Shared/EIDReader/cbeff/biometricDataBlockEncoder.ts +6 -0
- package/src/Shared/EIDReader/cbeff/cbeffInfo.ts +100 -0
- package/src/Shared/EIDReader/cbeff/complexCBEFFInfo.ts +48 -0
- package/src/Shared/EIDReader/cbeff/faceDataBlockDecoder.ts +17 -0
- package/src/Shared/EIDReader/cbeff/iso781611.ts +79 -0
- package/src/Shared/EIDReader/cbeff/iso781611Decoder.ts +242 -0
- package/src/Shared/EIDReader/cbeff/iso781611Encoder.ts +91 -0
- package/src/Shared/EIDReader/cbeff/simpleCBEFFInfo.ts +26 -0
- package/src/Shared/EIDReader/cbeff/standardBiometricHeader.ts +116 -0
- package/src/Shared/EIDReader/cert/cvcPrincipal.ts +63 -0
- package/src/Shared/EIDReader/data/country.ts +76 -0
- package/src/Shared/EIDReader/data/gender.ts +36 -0
- package/src/Shared/EIDReader/data/isoCountry.ts +1251 -0
- package/src/Shared/EIDReader/data/unicodeCountry.ts +1516 -0
- package/src/Shared/EIDReader/defaultFileInfo.ts +41 -0
- package/src/Shared/EIDReader/defaultFileSystem.ts +287 -0
- package/src/Shared/EIDReader/eidReader.ts +113 -0
- package/src/Shared/EIDReader/eidService.ts +349 -0
- package/src/Shared/EIDReader/fileInfo.ts +5 -0
- package/src/Shared/EIDReader/fileSystemCardService.ts +32 -0
- package/src/Shared/EIDReader/fragment.ts +21 -0
- package/src/Shared/EIDReader/fragmentBuffer.ts +191 -0
- package/src/Shared/EIDReader/java/byteArrayInputStream.ts +103 -0
- package/src/Shared/EIDReader/java/byteArrayOutputStream.ts +67 -0
- package/src/Shared/EIDReader/java/dataInput.ts +16 -0
- package/src/Shared/EIDReader/java/dataInputStream.ts +203 -0
- package/src/Shared/EIDReader/java/dataOutputStream.ts +107 -0
- package/src/Shared/EIDReader/java/filterInputStream.ts +138 -0
- package/src/Shared/EIDReader/java/filterOutputStream.ts +126 -0
- package/src/Shared/EIDReader/java/inputStream.ts +186 -0
- package/src/Shared/EIDReader/java/inputStreamBuffer.ts +200 -0
- package/src/Shared/EIDReader/java/objectInputStream.ts +45 -0
- package/src/Shared/EIDReader/java/outputStream.ts +76 -0
- package/src/Shared/EIDReader/java/positionInputStream.ts +64 -0
- package/src/Shared/EIDReader/java/splittableInputStream.ts +69 -0
- package/src/Shared/EIDReader/lds/abstractImageInfo.ts +191 -0
- package/src/Shared/EIDReader/lds/abstractLDSFile.ts +106 -0
- package/src/Shared/EIDReader/lds/abstractLDSInfo.ts +31 -0
- package/src/Shared/EIDReader/lds/abstractListInfo.ts +72 -0
- package/src/Shared/EIDReader/lds/abstractTaggedLDSFile.ts +85 -0
- package/src/Shared/EIDReader/lds/cbeffDataGroup.ts +128 -0
- package/src/Shared/EIDReader/lds/cvcaFile.ts +112 -0
- package/src/Shared/EIDReader/lds/dataGroup.ts +11 -0
- package/src/Shared/EIDReader/lds/icao/comFile.ts +166 -0
- package/src/Shared/EIDReader/lds/icao/dg1File.ts +45 -0
- package/src/Shared/EIDReader/lds/icao/dg2File.ts +54 -0
- package/src/Shared/EIDReader/lds/icao/icaoCountry.ts +253 -0
- package/src/Shared/EIDReader/lds/icao/mrzInfo.ts +1669 -0
- package/src/Shared/EIDReader/lds/imageInfo.ts +58 -0
- package/src/Shared/EIDReader/lds/iso19794/faceImageInfo.ts +948 -0
- package/src/Shared/EIDReader/lds/iso19794/faceInfo.ts +198 -0
- package/src/Shared/EIDReader/lds/ldsElement.ts +8 -0
- package/src/Shared/EIDReader/lds/ldsFile.ts +14 -0
- package/src/Shared/EIDReader/nfcManagerCardService.ts +58 -0
- package/src/Shared/EIDReader/protocol/bacAPDUSender.ts +146 -0
- package/src/Shared/EIDReader/protocol/bacProtocol.ts +121 -0
- package/src/Shared/EIDReader/protocol/bacResult.ts +36 -0
- package/src/Shared/EIDReader/protocol/readBinaryAPDUSender.ts +251 -0
- package/src/Shared/EIDReader/protocol/secureMessagingAPDUSender.ts +170 -0
- package/src/Shared/EIDReader/secureMessagingWrapper.ts +361 -0
- package/src/Shared/EIDReader/smartcards/apduEvent.ts +38 -0
- package/src/Shared/EIDReader/smartcards/apduListener.ts +5 -0
- package/src/Shared/EIDReader/smartcards/apduWrapper.ts +10 -0
- package/src/Shared/EIDReader/smartcards/commandAPDU.ts +172 -0
- package/src/Shared/EIDReader/smartcards/fileSystemStructured.ts +7 -0
- package/src/Shared/EIDReader/smartcards/iso7816.ts +104 -0
- package/src/Shared/EIDReader/smartcards/responseAPDU.ts +44 -0
- package/src/Shared/EIDReader/tlv/asn1Constants.ts +46 -0
- package/src/Shared/EIDReader/tlv/tlv.utils.ts +201 -0
- package/src/Shared/EIDReader/tlv/tlvInputState.ts +186 -0
- package/src/Shared/EIDReader/tlv/tlvInputStream.ts +207 -0
- package/src/Shared/EIDReader/tlv/tlvOutputState.ts +244 -0
- package/src/Shared/EIDReader/tlv/tlvOutputStream.ts +112 -0
- package/src/Shared/EIDReader/tripleDesSecureMessagingWrapper.ts +48 -0
- package/src/Shared/EIDReader/utils/crypto.utils.ts +273 -0
- package/src/Shared/EIDReader/utils/random.ts +198 -0
- package/src/Shared/EIDReader/wrappedAPDUEvent.ts +36 -0
- package/src/Shared/Libs/camera.utils.ts +34 -0
- package/src/Shared/Libs/contains.ts +59 -0
- package/src/Shared/Libs/crypto.utils.ts +47 -0
- package/src/Shared/Libs/debounce.utils.ts +38 -0
- package/src/Shared/Libs/deeplink.utils.ts +19 -0
- package/src/Shared/Libs/demo.utils.ts +82 -0
- package/src/Shared/Libs/http-client.ts +148 -0
- package/src/Shared/Libs/mrz.utils.ts +110 -0
- package/src/Shared/Libs/native-device-info.utils.ts +50 -0
- package/src/Shared/Libs/native-keep-awake.utils.ts +104 -0
- package/src/Shared/Libs/opencv.utils.ts +40 -0
- package/src/Shared/Libs/promise.utils.ts +20 -0
- package/src/Shared/Libs/tts.utils.ts +40 -0
- package/src/Shared/Types/identificationInfo.ts +62 -0
- package/src/Shared/Types/instruction.ts +4 -0
- package/src/Shared/Types/livenessIntructionType.ts +8 -0
- package/src/Shared/Types/verificationSession.ts +17 -0
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/components/BarcodeCamera.tsx +85 -0
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useBarcodeScanner.ts +79 -0
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/hooks/useCameraPermissions.ts +45 -0
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/index.ts +64 -0
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/scanCodes.ts +30 -0
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/types.ts +82 -0
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/convert.ts +195 -0
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/geometry.ts +135 -0
- package/src/Shared/VisionCameraPlugins/BarcodeScanner/utils/highlights.ts +84 -0
- package/src/Shared/VisionCameraPlugins/Cropper/index.ts +78 -0
- package/src/Shared/VisionCameraPlugins/FaceDetector/Camera.tsx +63 -0
- package/src/Shared/VisionCameraPlugins/FaceDetector/detectFaces.ts +44 -0
- package/src/Shared/VisionCameraPlugins/FaceDetector/index.ts +3 -0
- package/src/Shared/VisionCameraPlugins/FaceDetector/types.ts +99 -0
- package/src/Shared/VisionCameraPlugins/TextRecognition/Camera.tsx +76 -0
- package/src/Shared/VisionCameraPlugins/TextRecognition/PhotoRecognizer.ts +18 -0
- package/src/Shared/VisionCameraPlugins/TextRecognition/RemoveLanguageModel.ts +7 -0
- package/src/Shared/VisionCameraPlugins/TextRecognition/index.ts +7 -0
- package/src/Shared/VisionCameraPlugins/TextRecognition/scanText.ts +27 -0
- package/src/Shared/VisionCameraPlugins/TextRecognition/translateText.ts +21 -0
- package/src/Shared/VisionCameraPlugins/TextRecognition/types.ts +141 -0
- package/src/Translation/Resources/en.ts +151 -0
- package/src/Translation/Resources/index.ts +2 -0
- package/src/Translation/Resources/tr.ts +152 -0
- package/src/Translation/index.ts +37 -0
- package/src/Trustchex.tsx +171 -0
- package/src/index.tsx +5 -0
|
@@ -0,0 +1,817 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { Gender } from "../../data/gender.js";
|
|
4
|
+
import { ByteArrayOutputStream } from "../../java/byteArrayOutputStream.js";
|
|
5
|
+
import { DataInputStream } from "../../java/dataInputStream.js";
|
|
6
|
+
import { DataOutputStream } from "../../java/dataOutputStream.js";
|
|
7
|
+
import { AbstractImageInfo } from "../abstractImageInfo.js";
|
|
8
|
+
import { Buffer } from 'buffer';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Feature points as described in Section 5.6.3 of ISO/IEC FCD 19794-5.
|
|
12
|
+
*/
|
|
13
|
+
export class FeaturePoint {
|
|
14
|
+
/**
|
|
15
|
+
* Constructs a new feature point.
|
|
16
|
+
*
|
|
17
|
+
* @param type feature point type
|
|
18
|
+
* @param majorCode major code
|
|
19
|
+
* @param minorCode minor code
|
|
20
|
+
* @param x X-coordinate
|
|
21
|
+
* @param y Y-coordinate
|
|
22
|
+
*/
|
|
23
|
+
constructor(type, code, x, y) {
|
|
24
|
+
this.type = type;
|
|
25
|
+
this.majorCode = (code & 0xf0) >> 4;
|
|
26
|
+
this.minorCode = code & 0x0f;
|
|
27
|
+
this.x = x;
|
|
28
|
+
this.y = y;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Returns the major code of this point.
|
|
33
|
+
*
|
|
34
|
+
* @return major code
|
|
35
|
+
*/
|
|
36
|
+
getMajorCode() {
|
|
37
|
+
return this.majorCode;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Returns the minor code of this point.
|
|
42
|
+
*
|
|
43
|
+
* @return minor code
|
|
44
|
+
*/
|
|
45
|
+
getMinorCode() {
|
|
46
|
+
return this.minorCode;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Returns the type of this point.
|
|
51
|
+
*
|
|
52
|
+
* @return type
|
|
53
|
+
*/
|
|
54
|
+
getType() {
|
|
55
|
+
return this.type;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Returns the X-coordinate of this point.
|
|
60
|
+
*
|
|
61
|
+
* @return X-coordinate
|
|
62
|
+
*/
|
|
63
|
+
getX() {
|
|
64
|
+
return this.x;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Returns the Y-coordinate of this point.
|
|
69
|
+
*
|
|
70
|
+
* @return Y-coordinate
|
|
71
|
+
*/
|
|
72
|
+
getY() {
|
|
73
|
+
return this.y;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
// /* These correspond to values in Table 4 in 5.5.4 in ISO/IEC 19794-5:2005(E). */
|
|
78
|
+
// public static EYE_COLOR_UNSPECIFIED = 0x00;
|
|
79
|
+
// public static EYE_COLOR_BLACK = 0x01;
|
|
80
|
+
// public static EYE_COLOR_BLUE = 0x02;
|
|
81
|
+
// public static EYE_COLOR_BROWN = 0x03;
|
|
82
|
+
// public static EYE_COLOR_GRAY = 0x04;
|
|
83
|
+
// public static EYE_COLOR_GREEN = 0x05;
|
|
84
|
+
// public static EYE_COLOR_MULTI_COLORED = 0x06;
|
|
85
|
+
// public static EYE_COLOR_PINK = 0x07;
|
|
86
|
+
// public static EYE_COLOR_UNKNOWN = 0xFF;
|
|
87
|
+
/** Eye color code based on Section 5.5.4 of ISO 19794-5. */
|
|
88
|
+
export class EyeColor {
|
|
89
|
+
static UNSPECIFIED = new EyeColor(0x00);
|
|
90
|
+
static BLACK = new EyeColor(0x01);
|
|
91
|
+
static BLUE = new EyeColor(0x02);
|
|
92
|
+
static BROWN = new EyeColor(0x03);
|
|
93
|
+
static GRAY = new EyeColor(0x04);
|
|
94
|
+
static GREEN = new EyeColor(0x05);
|
|
95
|
+
static MULTI_COLORED = new EyeColor(0x06);
|
|
96
|
+
static PINK = new EyeColor(0x07);
|
|
97
|
+
static UNKNOWN = new EyeColor(0xff);
|
|
98
|
+
/**
|
|
99
|
+
* Creates an eye color.
|
|
100
|
+
*
|
|
101
|
+
* @param code the ISO19794-5 integer code for the color
|
|
102
|
+
*/
|
|
103
|
+
constructor(code) {
|
|
104
|
+
this.code = code;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Returns the integer code to use in ISO19794-5 encoding for this color.
|
|
109
|
+
*
|
|
110
|
+
* @return the integer code
|
|
111
|
+
*/
|
|
112
|
+
toInt() {
|
|
113
|
+
return this.code;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Returns an eye color value for the given code.
|
|
118
|
+
*
|
|
119
|
+
* @param i the integer code for a color
|
|
120
|
+
*
|
|
121
|
+
* @return the color value
|
|
122
|
+
*/
|
|
123
|
+
static toEyeColor(i) {
|
|
124
|
+
for (const c of EyeColor.values()) {
|
|
125
|
+
if (c.toInt() === i) {
|
|
126
|
+
return c;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return EyeColor.UNKNOWN;
|
|
130
|
+
}
|
|
131
|
+
static values() {
|
|
132
|
+
return [EyeColor.UNSPECIFIED, EyeColor.BLACK, EyeColor.BLUE, EyeColor.BROWN, EyeColor.GRAY, EyeColor.GREEN, EyeColor.MULTI_COLORED, EyeColor.PINK, EyeColor.UNKNOWN];
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// public static HAIR_COLOR_UNSPECIFIED = 0x00;
|
|
137
|
+
// public static HAIR_COLOR_BALD = 0x01;
|
|
138
|
+
// public static HAIR_COLOR_BLACK = 0x02;
|
|
139
|
+
// public static HAIR_COLOR_BLONDE = 0x03;
|
|
140
|
+
// public static HAIR_COLOR_BROWN = 0x04;
|
|
141
|
+
// public static HAIR_COLOR_GRAY = 0x05;
|
|
142
|
+
// public static HAIR_COLOR_WHITE = 0x06;
|
|
143
|
+
// public static HAIR_COLOR_RED = 0x07;
|
|
144
|
+
// public static HAIR_COLOR_GREEN = 0x08;
|
|
145
|
+
// public static HAIR_COLOR_BLUE = 0x09;
|
|
146
|
+
// public static HAIR_COLOR_UNKNOWN = 0xFF;
|
|
147
|
+
/** Hair color code based on Section 5.5.5 of ISO 19794-5. */
|
|
148
|
+
export class HairColor {
|
|
149
|
+
static UNSPECIFIED = new HairColor(0x00);
|
|
150
|
+
static BALD = new HairColor(0x01);
|
|
151
|
+
static BLACK = new HairColor(0x02);
|
|
152
|
+
static BLONDE = new HairColor(0x03);
|
|
153
|
+
static BROWN = new HairColor(0x04);
|
|
154
|
+
static GRAY = new HairColor(0x05);
|
|
155
|
+
static WHITE = new HairColor(0x06);
|
|
156
|
+
static RED = new HairColor(0x07);
|
|
157
|
+
static GREEN = new HairColor(0x08);
|
|
158
|
+
static BLUE = new HairColor(0x09);
|
|
159
|
+
static UNKNOWN = new HairColor(0xff);
|
|
160
|
+
/**
|
|
161
|
+
* Creates a hair color.
|
|
162
|
+
*
|
|
163
|
+
* @param code the integer code for a color
|
|
164
|
+
*/
|
|
165
|
+
constructor(code) {
|
|
166
|
+
this.code = code;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* Returns the code for this hair color.
|
|
171
|
+
*
|
|
172
|
+
* @return the code
|
|
173
|
+
*/
|
|
174
|
+
toInt() {
|
|
175
|
+
return this.code;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Returns a hair color value for the given code.
|
|
180
|
+
*
|
|
181
|
+
* @param i the integer code for a color
|
|
182
|
+
*
|
|
183
|
+
* @return the color value
|
|
184
|
+
*/
|
|
185
|
+
static toHairColor(i) {
|
|
186
|
+
for (const c of HairColor.values()) {
|
|
187
|
+
if (c.toInt() === i) {
|
|
188
|
+
return c;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
return HairColor.UNKNOWN;
|
|
192
|
+
}
|
|
193
|
+
static values() {
|
|
194
|
+
return [HairColor.UNSPECIFIED, HairColor.BALD, HairColor.BLACK, HairColor.BLONDE, HairColor.BROWN, HairColor.GRAY, HairColor.WHITE, HairColor.RED, HairColor.GREEN, HairColor.BLUE, HairColor.UNKNOWN];
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** Feature flags meaning based on Section 5.5.6 of ISO 19794-5. */
|
|
199
|
+
export class Features {
|
|
200
|
+
static FEATURE_FEATURES_ARE_SPECIFIED_FLAG = 0x000001;
|
|
201
|
+
static FEATURE_GLASSES_FLAG = 0x000002;
|
|
202
|
+
static FEATURE_MOUSTACHE_FLAG = 0x000004;
|
|
203
|
+
static FEATURE_BEARD_FLAG = 0x000008;
|
|
204
|
+
static FEATURE_TEETH_VISIBLE_FLAG = 0x000010;
|
|
205
|
+
static FEATURE_BLINK_FLAG = 0x000020;
|
|
206
|
+
static FEATURE_MOUTH_OPEN_FLAG = 0x000040;
|
|
207
|
+
static FEATURE_LEFT_EYE_PATCH_FLAG = 0x000080;
|
|
208
|
+
static FEATURE_RIGHT_EYE_PATCH = 0x000100;
|
|
209
|
+
static FEATURE_DARK_GLASSES = 0x000200;
|
|
210
|
+
static FEATURE_DISTORTING_MEDICAL_CONDITION = 0x000400;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** Expression code based on Section 5.5.7 of ISO 19794-5. */
|
|
214
|
+
export class Expression {
|
|
215
|
+
static EXPRESSION_UNSPECIFIED = 0x0000;
|
|
216
|
+
static EXPRESSION_NEUTRAL = 0x0001;
|
|
217
|
+
static EXPRESSION_SMILE_CLOSED = 0x0002;
|
|
218
|
+
static EXPRESSION_SMILE_OPEN = 0x0003;
|
|
219
|
+
static EXPRESSION_RAISED_EYEBROWS = 0x0004;
|
|
220
|
+
static EXPRESSION_EYES_LOOKING_AWAY = 0x0005;
|
|
221
|
+
static EXPRESSION_SQUINTING = 0x0006;
|
|
222
|
+
static EXPRESSION_FROWNING = 0x0007;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/** Face image type code based on Section 5.7.1 of ISO 19794-5. */
|
|
226
|
+
export class FaceImageType {
|
|
227
|
+
static FACE_IMAGE_TYPE_BASIC = 0x00;
|
|
228
|
+
static FACE_IMAGE_TYPE_FULL_FRONTAL = 0x01;
|
|
229
|
+
static FACE_IMAGE_TYPE_TOKEN_FRONTAL = 0x02;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
/** Image data type code based on Section 5.7.2 of ISO 19794-5. */
|
|
233
|
+
export class ImageDataType {
|
|
234
|
+
static IMAGE_DATA_TYPE_JPEG = 0x00;
|
|
235
|
+
static IMAGE_DATA_TYPE_JPEG2000 = 0x01;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/** Color space code based on Section 5.7.4 of ISO 19794-5. */
|
|
239
|
+
export class ImageColorSpace {
|
|
240
|
+
static IMAGE_COLOR_SPACE_UNSPECIFIED = 0x00;
|
|
241
|
+
static IMAGE_COLOR_SPACE_RGB24 = 0x01;
|
|
242
|
+
static IMAGE_COLOR_SPACE_YUV422 = 0x02;
|
|
243
|
+
static IMAGE_COLOR_SPACE_GRAY8 = 0x03;
|
|
244
|
+
static IMAGE_COLOR_SPACE_OTHER = 0x04;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/** Source type based on Section 5.7.6 of ISO 19794-5. */
|
|
248
|
+
export class SourceType {
|
|
249
|
+
static SOURCE_TYPE_UNSPECIFIED = 0x00;
|
|
250
|
+
static SOURCE_TYPE_STATIC_PHOTO_UNKNOWN_SOURCE = 0x01;
|
|
251
|
+
static SOURCE_TYPE_STATIC_PHOTO_DIGITAL_CAM = 0x02;
|
|
252
|
+
static SOURCE_TYPE_STATIC_PHOTO_SCANNER = 0x03;
|
|
253
|
+
static SOURCE_TYPE_VIDEO_FRAME_UNKNOWN_SOURCE = 0x04;
|
|
254
|
+
static SOURCE_TYPE_VIDEO_FRAME_ANALOG_CAM = 0x05;
|
|
255
|
+
static SOURCE_TYPE_VIDEO_FRAME_DIGITAL_CAM = 0x06;
|
|
256
|
+
static SOURCE_TYPE_UNKNOWN = 0x07;
|
|
257
|
+
}
|
|
258
|
+
export class FaceImageInfo extends AbstractImageInfo {
|
|
259
|
+
/** Indexes into poseAngle array. */
|
|
260
|
+
static YAW = 0;
|
|
261
|
+
|
|
262
|
+
/** Indexes into poseAngle array. */
|
|
263
|
+
static PITCH = 1;
|
|
264
|
+
|
|
265
|
+
/** Indexes into poseAngle array. */
|
|
266
|
+
static ROLL = 2;
|
|
267
|
+
/**
|
|
268
|
+
* Constructs a new face information data structure instance.
|
|
269
|
+
*
|
|
270
|
+
* @param gender gender
|
|
271
|
+
* @param eyeColor eye color
|
|
272
|
+
* @param featureMask feature mask (least significant 3 bytes)
|
|
273
|
+
* @param hairColor hair color
|
|
274
|
+
* @param expression expression
|
|
275
|
+
* @param poseAngle (encoded) pose angle
|
|
276
|
+
* @param poseAngleUncertainty pose angle uncertainty
|
|
277
|
+
* @param faceImageType face image type
|
|
278
|
+
* @param colorSpace color space
|
|
279
|
+
* @param sourceType source type
|
|
280
|
+
* @param deviceType capture device type (unspecified is <code>0x00</code>)
|
|
281
|
+
* @param quality quality
|
|
282
|
+
* @param featurePoints feature points
|
|
283
|
+
* @param width width
|
|
284
|
+
* @param height height
|
|
285
|
+
* @param imageInputStream encoded image bytes
|
|
286
|
+
* @param imageLength length of encoded image
|
|
287
|
+
* @param imageDataType either IMAGE_DATA_TYPE_JPEG or IMAGE_DATA_TYPE_JPEG2000
|
|
288
|
+
*
|
|
289
|
+
* @throws IOException on error reading input
|
|
290
|
+
*/
|
|
291
|
+
constructor(gender, eyeColor, featureMask, hairColor, expression, poseAngle, poseAngleUncertainty, faceImageType, colorSpace, sourceType, deviceType, quality, featurePoints, width, height, imageInputStream, imageLength, imageDataType) {
|
|
292
|
+
super(FaceImageInfo.TYPE_PORTRAIT, width, height, imageInputStream, imageLength, FaceImageInfo.toMimeType(imageDataType) || 'image/jpeg');
|
|
293
|
+
if (imageInputStream == null) {
|
|
294
|
+
throw new Error('Null image');
|
|
295
|
+
}
|
|
296
|
+
this.gender = gender == null ? Gender.UNSPECIFIED : gender;
|
|
297
|
+
this.eyeColor = eyeColor == null ? EyeColor.UNSPECIFIED : eyeColor;
|
|
298
|
+
this.featureMask = featureMask;
|
|
299
|
+
this.hairColor = hairColor;
|
|
300
|
+
this.expression = expression;
|
|
301
|
+
this.colorSpace = colorSpace;
|
|
302
|
+
this.sourceType = sourceType;
|
|
303
|
+
this.deviceType = deviceType;
|
|
304
|
+
const featurePointCount = featurePoints == null ? 0 : featurePoints.length;
|
|
305
|
+
this.featurePoints = new Array(featurePointCount);
|
|
306
|
+
if (featurePointCount > 0) {
|
|
307
|
+
this.featurePoints = featurePoints.slice();
|
|
308
|
+
}
|
|
309
|
+
this.poseAngle = poseAngle.slice();
|
|
310
|
+
this.poseAngleUncertainty = poseAngleUncertainty.slice();
|
|
311
|
+
this.imageDataType = imageDataType;
|
|
312
|
+
this.recordLength = 20 + 8 * featurePointCount + 12 + imageLength;
|
|
313
|
+
this.faceImageType = faceImageType;
|
|
314
|
+
this.colorSpace = colorSpace;
|
|
315
|
+
this.sourceType = sourceType;
|
|
316
|
+
this.deviceType = deviceType;
|
|
317
|
+
this.quality = quality;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// /**
|
|
321
|
+
// * Constructs a new face information structure from binary encoding.
|
|
322
|
+
// *
|
|
323
|
+
// * @param inputStream an input stream
|
|
324
|
+
// *
|
|
325
|
+
// * @throws IOException if input cannot be read
|
|
326
|
+
// */
|
|
327
|
+
// public FaceImageInfo(InputStream inputStream) {
|
|
328
|
+
// super(TYPE_PORTRAIT);
|
|
329
|
+
// readObject(inputStream);
|
|
330
|
+
async readObject(inputStream) {
|
|
331
|
+
const dataIn = inputStream instanceof DataInputStream ? inputStream : new DataInputStream(inputStream);
|
|
332
|
+
|
|
333
|
+
/* Facial Information Block (20), see ISO 19794-5 5.5 */
|
|
334
|
+
this.recordLength = (await dataIn.readInt()) & 0xffffffff; /* 4 */
|
|
335
|
+
const featurePointCount = await dataIn.readUnsignedShort(); /* +2 = 6 */
|
|
336
|
+
this.gender = Gender.toGender(await dataIn.readUnsignedByte()); /* +1 = 7 */
|
|
337
|
+
this.eyeColor = EyeColor.toEyeColor(await dataIn.readUnsignedByte()); /* +1 = 8 */
|
|
338
|
+
this.hairColor = await dataIn.readUnsignedByte(); /* +1 = 9 */
|
|
339
|
+
this.featureMask = await dataIn.readUnsignedByte(); /* +1 = 10 */
|
|
340
|
+
this.featureMask = this.featureMask << 16 | (await dataIn.readUnsignedShort()); /* +2 = 12 */
|
|
341
|
+
this.expression = await dataIn.readShort(); /* +2 = 14 */
|
|
342
|
+
this.poseAngle = new Array(3);
|
|
343
|
+
let by = await dataIn.readUnsignedByte(); /* +1 = 15 */
|
|
344
|
+
this.poseAngle[FaceImageInfo.YAW] = by;
|
|
345
|
+
let bp = await dataIn.readUnsignedByte(); /* +1 = 16 */
|
|
346
|
+
this.poseAngle[FaceImageInfo.PITCH] = bp;
|
|
347
|
+
let br = await dataIn.readUnsignedByte(); /* +1 = 17 */
|
|
348
|
+
this.poseAngle[FaceImageInfo.ROLL] = br;
|
|
349
|
+
this.poseAngleUncertainty = new Array(3);
|
|
350
|
+
this.poseAngleUncertainty[FaceImageInfo.YAW] = await dataIn.readUnsignedByte(); /* +1 = 18 */
|
|
351
|
+
this.poseAngleUncertainty[FaceImageInfo.PITCH] = await dataIn.readUnsignedByte(); /* +1 = 19 */
|
|
352
|
+
this.poseAngleUncertainty[FaceImageInfo.ROLL] = await dataIn.readUnsignedByte(); /* +1 = 20 */
|
|
353
|
+
|
|
354
|
+
/* Feature Point(s) (optional) (8 * featurePointCount), see ISO 19794-5 5.8 */
|
|
355
|
+
this.featurePoints = new Array(featurePointCount);
|
|
356
|
+
for (let i = 0; i < featurePointCount; i++) {
|
|
357
|
+
const featureType = await dataIn.readUnsignedByte(); /* 1 */
|
|
358
|
+
const featurePoint = await dataIn.readByte(); /* +1 = 2 */
|
|
359
|
+
const x = await dataIn.readUnsignedShort(); /* +2 = 4 */
|
|
360
|
+
const y = await dataIn.readUnsignedShort(); /* +2 = 6 */
|
|
361
|
+
let skippedBytes = 0;
|
|
362
|
+
while (skippedBytes < 2) {
|
|
363
|
+
skippedBytes += await dataIn.skip(2);
|
|
364
|
+
} /* +2 = 8, NOTE: 2 bytes reserved */
|
|
365
|
+
this.featurePoints[i] = new FeaturePoint(featureType, featurePoint, x, y);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
/* Image Information */
|
|
369
|
+
this.faceImageType = await dataIn.readUnsignedByte(); /* 1 */
|
|
370
|
+
this.imageDataType = await dataIn.readUnsignedByte(); /* +1 = 2 */
|
|
371
|
+
this.setWidth(await dataIn.readUnsignedShort()); /* +2 = 4 */
|
|
372
|
+
this.setHeight(await dataIn.readUnsignedShort()); /* +2 = 6 */
|
|
373
|
+
this.colorSpace = await dataIn.readUnsignedByte(); /* +1 = 7 */
|
|
374
|
+
this.sourceType = await dataIn.readUnsignedByte(); /* +1 = 8 */
|
|
375
|
+
this.deviceType = await dataIn.readUnsignedShort(); /* +2 = 10 */
|
|
376
|
+
this.quality = await dataIn.readUnsignedShort(); /* +2 = 12 */
|
|
377
|
+
|
|
378
|
+
/* Temporarily fix width and height if 0. */
|
|
379
|
+
if (this.getWidth() <= 0) {
|
|
380
|
+
this.setWidth(800);
|
|
381
|
+
}
|
|
382
|
+
if (this.getHeight() <= 0) {
|
|
383
|
+
this.setHeight(600);
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/*
|
|
387
|
+
* Read image data, image data type code based on Section 5.8.1
|
|
388
|
+
* ISO 19794-5.
|
|
389
|
+
*/
|
|
390
|
+
this.setMimeType(FaceImageInfo.toMimeType(this.imageDataType) || 'image/jpeg');
|
|
391
|
+
const imageLength = this.recordLength - 20 - 8 * featurePointCount - 12;
|
|
392
|
+
await this.readImage(inputStream, imageLength);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* Writes this face image info to output stream.
|
|
397
|
+
*
|
|
398
|
+
* @param outputStream an output stream
|
|
399
|
+
*
|
|
400
|
+
* @throws IOException if writing fails
|
|
401
|
+
*/
|
|
402
|
+
writeObject(outputStream) {
|
|
403
|
+
const recordOut = new ByteArrayOutputStream();
|
|
404
|
+
this.writeFacialRecordData(recordOut);
|
|
405
|
+
const facialRecordData = recordOut.toByteArray();
|
|
406
|
+
const faceImageBlockLength = facialRecordData.length + 4;
|
|
407
|
+
const dataOut = new DataOutputStream(outputStream);
|
|
408
|
+
dataOut.write(faceImageBlockLength);
|
|
409
|
+
dataOut.writeUTF(Buffer.from(facialRecordData).toString('utf-8'));
|
|
410
|
+
dataOut.flush();
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
/**
|
|
414
|
+
* Returns the record length.
|
|
415
|
+
*
|
|
416
|
+
* @return the record length
|
|
417
|
+
*/
|
|
418
|
+
getRecordLength() {
|
|
419
|
+
/* Should be equal to (20 + 8 * featurePoints.length + 12 + getImageLength()). */
|
|
420
|
+
return this.recordLength;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Returns the available feature points of this face.
|
|
425
|
+
*
|
|
426
|
+
* @return feature points
|
|
427
|
+
*/
|
|
428
|
+
getFeaturePoints() {
|
|
429
|
+
return this.featurePoints;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Returns the expression
|
|
434
|
+
* (neutral, smiling, eyebrow raised, etc).
|
|
435
|
+
*
|
|
436
|
+
* @return expression
|
|
437
|
+
*/
|
|
438
|
+
getExpression() {
|
|
439
|
+
return this.expression;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
/**
|
|
443
|
+
* Returns the eye color
|
|
444
|
+
* (black, blue, brown, etc).
|
|
445
|
+
*
|
|
446
|
+
* @return eye color
|
|
447
|
+
*/
|
|
448
|
+
getEyeColor() {
|
|
449
|
+
return this.eyeColor;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* Returns the gender
|
|
454
|
+
* (male, female, etc).
|
|
455
|
+
*
|
|
456
|
+
* @return gender
|
|
457
|
+
*/
|
|
458
|
+
getGender() {
|
|
459
|
+
return this.gender;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
/**
|
|
463
|
+
* Returns the hair color
|
|
464
|
+
* (bald, black, blonde, etc).
|
|
465
|
+
*
|
|
466
|
+
* @return hair color
|
|
467
|
+
*/
|
|
468
|
+
getHairColor() {
|
|
469
|
+
return this.hairColor;
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
/**
|
|
473
|
+
* Returns the face image type
|
|
474
|
+
* (full frontal, token frontal, etc).
|
|
475
|
+
*
|
|
476
|
+
* @return face image type
|
|
477
|
+
*/
|
|
478
|
+
getFaceImageType() {
|
|
479
|
+
return this.faceImageType;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
/**
|
|
483
|
+
* Returns the feature mask.
|
|
484
|
+
*
|
|
485
|
+
* @return feature mask
|
|
486
|
+
*/
|
|
487
|
+
getFeatureMask() {
|
|
488
|
+
return this.featureMask;
|
|
489
|
+
}
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* Returns the quality as unsigned integer.
|
|
493
|
+
*
|
|
494
|
+
* @return quality
|
|
495
|
+
*/
|
|
496
|
+
getQuality() {
|
|
497
|
+
return this.quality;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
/**
|
|
501
|
+
* Returns the source type
|
|
502
|
+
* (camera, scanner, etc).
|
|
503
|
+
*
|
|
504
|
+
* @return source type
|
|
505
|
+
*/
|
|
506
|
+
getSourceType() {
|
|
507
|
+
return this.sourceType;
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
/**
|
|
511
|
+
* Returns the image data type.
|
|
512
|
+
*
|
|
513
|
+
* @return image data type
|
|
514
|
+
*/
|
|
515
|
+
getImageDataType() {
|
|
516
|
+
return this.imageDataType;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Returns the image color space
|
|
521
|
+
* (rgb, grayscale, etc).
|
|
522
|
+
*
|
|
523
|
+
* @return image color space
|
|
524
|
+
*/
|
|
525
|
+
getColorSpace() {
|
|
526
|
+
return this.colorSpace;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
/**
|
|
530
|
+
* Returns the device type.
|
|
531
|
+
*
|
|
532
|
+
* @return device type
|
|
533
|
+
*/
|
|
534
|
+
getDeviceType() {
|
|
535
|
+
return this.deviceType;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
/**
|
|
539
|
+
* Returns the pose angle as an integer array of length 3,
|
|
540
|
+
* containing yaw, pitch, and roll angle in encoded form.
|
|
541
|
+
*
|
|
542
|
+
* @return an integer array of length 3
|
|
543
|
+
*/
|
|
544
|
+
getPoseAngle() {
|
|
545
|
+
const result = [];
|
|
546
|
+
result.push(...this.poseAngle);
|
|
547
|
+
return result;
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
/**
|
|
551
|
+
* Returns the pose angle uncertainty as an integer array of length 3,
|
|
552
|
+
* containing yaw, pitch, and roll angle uncertainty.
|
|
553
|
+
*
|
|
554
|
+
* @return an integer array of length 3
|
|
555
|
+
*/
|
|
556
|
+
getPoseAngleUncertainty() {
|
|
557
|
+
const result = [];
|
|
558
|
+
result.push(...this.poseAngleUncertainty);
|
|
559
|
+
return result;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
/**
|
|
563
|
+
* Writes the record data to a stream.
|
|
564
|
+
*
|
|
565
|
+
* @param outputStream the stream to write to
|
|
566
|
+
*
|
|
567
|
+
* @throws IOException on error
|
|
568
|
+
*/
|
|
569
|
+
async writeFacialRecordData(outputStream) {
|
|
570
|
+
const dataOut = new DataOutputStream(outputStream);
|
|
571
|
+
|
|
572
|
+
/* Facial Information (16) */
|
|
573
|
+
dataOut.write(this.featurePoints.length); /* 2 */
|
|
574
|
+
dataOut.write(this.gender == null ? Gender.UNSPECIFIED.getCode() : this.gender.getCode()); /* 1 */
|
|
575
|
+
dataOut.write(this.eyeColor == null ? EyeColor.UNSPECIFIED.toInt() : this.eyeColor.toInt()); /* 1 */
|
|
576
|
+
dataOut.write(this.hairColor); /* 1 */
|
|
577
|
+
dataOut.write((this.featureMask & 0xff0000) >> 16); /* 1 */
|
|
578
|
+
dataOut.write((this.featureMask & 0x00ff00) >> 8); /* 1 */
|
|
579
|
+
dataOut.write(this.featureMask & 0x0000ff); /* 1 */
|
|
580
|
+
dataOut.write(this.expression); /* 2 */
|
|
581
|
+
for (let i = 0; i < 3; i++) {
|
|
582
|
+
/* 3 */
|
|
583
|
+
const b = this.poseAngle[i];
|
|
584
|
+
dataOut.write(b);
|
|
585
|
+
}
|
|
586
|
+
for (let i = 0; i < 3; i++) {
|
|
587
|
+
/* 3 */
|
|
588
|
+
dataOut.write(this.poseAngleUncertainty[i]);
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
/* Feature Point(s) (optional) (8 * featurePointCount) */
|
|
592
|
+
for (const fp of this.featurePoints) {
|
|
593
|
+
dataOut.write(fp.getType());
|
|
594
|
+
dataOut.write(fp.getMajorCode() << 4 | fp.getMinorCode());
|
|
595
|
+
dataOut.write(fp.getX());
|
|
596
|
+
dataOut.write(fp.getY());
|
|
597
|
+
dataOut.write(0x00); /* 2 bytes RFU */
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
/* Image Information (12) */
|
|
601
|
+
dataOut.write(this.faceImageType); /* 1 */
|
|
602
|
+
dataOut.write(this.imageDataType); /* 1 */
|
|
603
|
+
dataOut.write(this.getWidth()); /* 2 */
|
|
604
|
+
dataOut.write(this.getHeight()); /* 2 */
|
|
605
|
+
dataOut.write(this.colorSpace); /* 1 */
|
|
606
|
+
dataOut.write(this.sourceType); /* 1 */
|
|
607
|
+
dataOut.write(this.deviceType); /* 2 */
|
|
608
|
+
dataOut.write(this.quality); /* 2 */
|
|
609
|
+
|
|
610
|
+
/*
|
|
611
|
+
* Image data type code based on Section 5.8.1
|
|
612
|
+
* ISO 19794-5
|
|
613
|
+
*/
|
|
614
|
+
await this.writeImage(dataOut);
|
|
615
|
+
dataOut.flush();
|
|
616
|
+
dataOut.close();
|
|
617
|
+
}
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Converts a hair color value to a human readable string.
|
|
621
|
+
*
|
|
622
|
+
* @return a human readable string for the current hair color value
|
|
623
|
+
*/
|
|
624
|
+
hairColorToString() {
|
|
625
|
+
switch (this.hairColor) {
|
|
626
|
+
case HairColor.UNSPECIFIED.toInt():
|
|
627
|
+
return 'unspecified';
|
|
628
|
+
case HairColor.BALD.toInt():
|
|
629
|
+
return 'bald';
|
|
630
|
+
case HairColor.BLACK.toInt():
|
|
631
|
+
return 'black';
|
|
632
|
+
case HairColor.BLONDE.toInt():
|
|
633
|
+
return 'blonde';
|
|
634
|
+
case HairColor.BROWN.toInt():
|
|
635
|
+
return 'brown';
|
|
636
|
+
case HairColor.GRAY.toInt():
|
|
637
|
+
return 'gray';
|
|
638
|
+
case HairColor.WHITE.toInt():
|
|
639
|
+
return 'white';
|
|
640
|
+
case HairColor.RED.toInt():
|
|
641
|
+
return 'red';
|
|
642
|
+
case HairColor.GREEN.toInt():
|
|
643
|
+
return 'green';
|
|
644
|
+
case HairColor.BLUE.toInt():
|
|
645
|
+
return 'blue';
|
|
646
|
+
default:
|
|
647
|
+
return 'unknown';
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Returns a human readable string for the current feature mask.
|
|
653
|
+
*
|
|
654
|
+
* @return a human readable string
|
|
655
|
+
*/
|
|
656
|
+
featureMaskToString() {
|
|
657
|
+
if ((this.featureMask & Features.FEATURE_FEATURES_ARE_SPECIFIED_FLAG) === 0) {
|
|
658
|
+
return '';
|
|
659
|
+
}
|
|
660
|
+
const features = [];
|
|
661
|
+
if ((this.featureMask & Features.FEATURE_GLASSES_FLAG) !== 0) {
|
|
662
|
+
features.push('glasses');
|
|
663
|
+
}
|
|
664
|
+
if ((this.featureMask & Features.FEATURE_MOUSTACHE_FLAG) !== 0) {
|
|
665
|
+
features.push('moustache');
|
|
666
|
+
}
|
|
667
|
+
if ((this.featureMask & Features.FEATURE_BEARD_FLAG) !== 0) {
|
|
668
|
+
features.push('beard');
|
|
669
|
+
}
|
|
670
|
+
if ((this.featureMask & Features.FEATURE_TEETH_VISIBLE_FLAG) !== 0) {
|
|
671
|
+
features.push('teeth visible');
|
|
672
|
+
}
|
|
673
|
+
if ((this.featureMask & Features.FEATURE_BLINK_FLAG) !== 0) {
|
|
674
|
+
features.push('blink');
|
|
675
|
+
}
|
|
676
|
+
if ((this.featureMask & Features.FEATURE_MOUTH_OPEN_FLAG) !== 0) {
|
|
677
|
+
features.push('mouth open');
|
|
678
|
+
}
|
|
679
|
+
if ((this.featureMask & Features.FEATURE_LEFT_EYE_PATCH_FLAG) !== 0) {
|
|
680
|
+
features.push('left eye patch');
|
|
681
|
+
}
|
|
682
|
+
if ((this.featureMask & Features.FEATURE_RIGHT_EYE_PATCH) !== 0) {
|
|
683
|
+
features.push('right eye patch');
|
|
684
|
+
}
|
|
685
|
+
if ((this.featureMask & Features.FEATURE_DARK_GLASSES) !== 0) {
|
|
686
|
+
features.push('dark glasses');
|
|
687
|
+
}
|
|
688
|
+
if ((this.featureMask & Features.FEATURE_DISTORTING_MEDICAL_CONDITION) !== 0) {
|
|
689
|
+
features.push('distorting medical condition (which could impact feature point detection)');
|
|
690
|
+
}
|
|
691
|
+
return features.join(', ');
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
/**
|
|
695
|
+
* Converts the current expression to a human readable string.
|
|
696
|
+
*
|
|
697
|
+
* @return a human readable string
|
|
698
|
+
*/
|
|
699
|
+
expressionToString() {
|
|
700
|
+
switch (this.expression) {
|
|
701
|
+
case Expression.EXPRESSION_UNSPECIFIED:
|
|
702
|
+
return 'unspecified';
|
|
703
|
+
case Expression.EXPRESSION_NEUTRAL:
|
|
704
|
+
return 'neutral (non-smiling) with both eyes open and mouth closed';
|
|
705
|
+
case Expression.EXPRESSION_SMILE_CLOSED:
|
|
706
|
+
return 'a smile where the inside of the mouth and/or teeth is not exposed (closed jaw)';
|
|
707
|
+
case Expression.EXPRESSION_SMILE_OPEN:
|
|
708
|
+
return 'a smile where the inside of the mouth and/or teeth is exposed';
|
|
709
|
+
case Expression.EXPRESSION_RAISED_EYEBROWS:
|
|
710
|
+
return 'raised eyebrows';
|
|
711
|
+
case Expression.EXPRESSION_EYES_LOOKING_AWAY:
|
|
712
|
+
return 'eyes looking away from the camera';
|
|
713
|
+
case Expression.EXPRESSION_SQUINTING:
|
|
714
|
+
return 'squinting';
|
|
715
|
+
case Expression.EXPRESSION_FROWNING:
|
|
716
|
+
return 'frowning';
|
|
717
|
+
default:
|
|
718
|
+
return 'unknown';
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Converts the current pose angle to a human readable string.
|
|
724
|
+
*
|
|
725
|
+
* @return a human readable string
|
|
726
|
+
*/
|
|
727
|
+
poseAngleToString() {
|
|
728
|
+
let out = '(';
|
|
729
|
+
out += 'y: ' + this.poseAngle[FaceImageInfo.YAW];
|
|
730
|
+
if (this.poseAngleUncertainty[FaceImageInfo.YAW] !== 0) {
|
|
731
|
+
out += ' (' + this.poseAngleUncertainty[FaceImageInfo.YAW] + ')';
|
|
732
|
+
}
|
|
733
|
+
out += ', ';
|
|
734
|
+
out += 'p:' + this.poseAngle[FaceImageInfo.PITCH];
|
|
735
|
+
if (this.poseAngleUncertainty[FaceImageInfo.PITCH] !== 0) {
|
|
736
|
+
out += ' (' + this.poseAngleUncertainty[FaceImageInfo.PITCH] + ')';
|
|
737
|
+
}
|
|
738
|
+
out += ', ';
|
|
739
|
+
out += 'r: ' + this.poseAngle[FaceImageInfo.ROLL];
|
|
740
|
+
if (this.poseAngleUncertainty[FaceImageInfo.ROLL] !== 0) {
|
|
741
|
+
out += ' (' + this.poseAngleUncertainty[FaceImageInfo.ROLL] + ')';
|
|
742
|
+
}
|
|
743
|
+
out += ')';
|
|
744
|
+
return out;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* Returns a textual representation of the face image type
|
|
749
|
+
* ({@code "basic"}, {@code "full frontal"}, {@code "token frontal"},
|
|
750
|
+
* or {@code "unknown"}).
|
|
751
|
+
*
|
|
752
|
+
* @return a textual representation of the face image type
|
|
753
|
+
*/
|
|
754
|
+
faceImageTypeToString() {
|
|
755
|
+
switch (this.faceImageType) {
|
|
756
|
+
case FaceImageType.FACE_IMAGE_TYPE_BASIC:
|
|
757
|
+
return 'basic';
|
|
758
|
+
case FaceImageType.FACE_IMAGE_TYPE_FULL_FRONTAL:
|
|
759
|
+
return 'full frontal';
|
|
760
|
+
case FaceImageType.FACE_IMAGE_TYPE_TOKEN_FRONTAL:
|
|
761
|
+
return 'token frontal';
|
|
762
|
+
default:
|
|
763
|
+
return 'unknown';
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Returns a textual representation of the source type.
|
|
769
|
+
*
|
|
770
|
+
* @return a textual representation of the source type
|
|
771
|
+
*/
|
|
772
|
+
sourceTypeToString() {
|
|
773
|
+
switch (this.sourceType) {
|
|
774
|
+
case SourceType.SOURCE_TYPE_UNSPECIFIED:
|
|
775
|
+
return 'unspecified';
|
|
776
|
+
case SourceType.SOURCE_TYPE_STATIC_PHOTO_UNKNOWN_SOURCE:
|
|
777
|
+
return 'static photograph from an unknown source';
|
|
778
|
+
case SourceType.SOURCE_TYPE_STATIC_PHOTO_DIGITAL_CAM:
|
|
779
|
+
return 'static photograph from a digital still-image camera';
|
|
780
|
+
case SourceType.SOURCE_TYPE_STATIC_PHOTO_SCANNER:
|
|
781
|
+
return 'static photograph from a scanner';
|
|
782
|
+
case SourceType.SOURCE_TYPE_VIDEO_FRAME_UNKNOWN_SOURCE:
|
|
783
|
+
return 'single video frame from an unknown source';
|
|
784
|
+
case SourceType.SOURCE_TYPE_VIDEO_FRAME_ANALOG_CAM:
|
|
785
|
+
return 'single video frame from an analogue camera';
|
|
786
|
+
case SourceType.SOURCE_TYPE_VIDEO_FRAME_DIGITAL_CAM:
|
|
787
|
+
return 'single video frame from a digital camera';
|
|
788
|
+
default:
|
|
789
|
+
return 'unknown';
|
|
790
|
+
}
|
|
791
|
+
}
|
|
792
|
+
|
|
793
|
+
/**
|
|
794
|
+
* Returns a mime-type string for the compression algorithm code.
|
|
795
|
+
*
|
|
796
|
+
* @param compressionAlg the compression algorithm code as it occurs in the header
|
|
797
|
+
*
|
|
798
|
+
* @return a mime-type string,
|
|
799
|
+
* typically {@code JPEG_MIME_TYPE} or {@code JPEG2000_MIME_TYPE}
|
|
800
|
+
*/
|
|
801
|
+
static toMimeType(compressionAlg) {
|
|
802
|
+
switch (compressionAlg) {
|
|
803
|
+
case ImageDataType.IMAGE_DATA_TYPE_JPEG:
|
|
804
|
+
return FaceImageInfo.JPEG_MIME_TYPE;
|
|
805
|
+
case ImageDataType.IMAGE_DATA_TYPE_JPEG2000:
|
|
806
|
+
return FaceImageInfo.JPEG2000_MIME_TYPE;
|
|
807
|
+
default:
|
|
808
|
+
console.debug('Unknown image type: ' + compressionAlg);
|
|
809
|
+
return null;
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
static async from(inputStream) {
|
|
813
|
+
const faceImageInfo = new FaceImageInfo(Gender.UNSPECIFIED, EyeColor.UNSPECIFIED, 0, 0, 0, [0, 0, 0], [0, 0, 0], 0, 0, 0, 0, 0, [], 0, 0, inputStream, 0, 0);
|
|
814
|
+
await faceImageInfo.readObject(inputStream);
|
|
815
|
+
return faceImageInfo;
|
|
816
|
+
}
|
|
817
|
+
}
|