Class QRCodeScannerSDK
java.lang.Object
com.vasco.digipass.sdk.utils.qrcodescanner.QRCodeScannerSDK
Provides methods for QR Code and Cronto Code scanning
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Represents a result of image decoding.
Contains decoded data and image format. -
Method Summary
Modifier and TypeMethodDescriptiondecodeBitmap
(android.graphics.Bitmap bitmap, int codeType) Decodes an image containing Cronto or QR code from a bitmap.
The bitmap must be in ARGB_8888 format.decodeImage
(androidx.camera.core.ImageProxy image, int codeType) Decodes a Camera X image stream object(ImageProxy) containing a Cronto or QR code.
Requires using CameraX API.
To improve performance, it is recommended that, in the Image Analyzer, the output image format for Cronto codes is set to OUTPUT_IMAGE_FORMAT_RGBA_8888 while for QR codes it should be set to OUTPUT_IMAGE_FORMAT_YUV_420_888.
-
Method Details
-
decodeImage
public static QRCodeScannerSDK.QRCodeScannerSDKDecodingResultData decodeImage(androidx.camera.core.ImageProxy image, int codeType) throws QRCodeScannerSDKException, LinkageError Decodes a Camera X image stream object(ImageProxy) containing a Cronto or QR code.
Requires using CameraX API.
To improve performance, it is recommended that, in the Image Analyzer, the output image format for Cronto codes is set to OUTPUT_IMAGE_FORMAT_RGBA_8888 while for QR codes it should be set to OUTPUT_IMAGE_FORMAT_YUV_420_888. This greatly cuts down on preprocessing and makes the scanning faster.
Warning: The method processes the image and this could take some time to achieve.
The process time depends on the size of the input image, make sure input image is not too large.
Also, the decode process should be performed on another thread so that the main thread isn't blocked.- Parameters:
image
- ImageProxy object to decodecodeType
- indicates type of the image. A mask with possible values:
- QRCodeScannerSDKConstants.CRONTO_CODE - QRCodeScannerSDKConstants.QR_CODE - QRCodeScannerSDKConstants.CRONTO_CODE + QRCodeScannerSDKConstants.QR_CODE- Returns:
- QRCodeScannerSDKDecodingResultData containing decoded data and image format
- Throws:
QRCodeScannerSDKException
- in case the image could not be decodedLinkageError
-
decodeBitmap
public static QRCodeScannerSDK.QRCodeScannerSDKDecodingResultData decodeBitmap(android.graphics.Bitmap bitmap, int codeType) throws QRCodeScannerSDKException, LinkageError Decodes an image containing Cronto or QR code from a bitmap.
The bitmap must be in ARGB_8888 format. Warning: The method processes the image and this could take some time to achieve.
The process time depends on the size of the input image, make sure bitmap is not too large.
Also, the decode process should be performed on it's own thread so that the main thread isn't blocked.- Parameters:
bitmap
- Bitmap to decode.codeType
- indicates type of the image. A mask with possible values:
- QRCodeScannerSDKConstants.CRONTO_CODE - QRCodeScannerSDKConstants.QR_CODE - QRCodeScannerSDKConstants.CRONTO_CODE + QRCodeScannerSDKConstants.QR_CODE- Returns:
- QRCodeScannerSDKDecodingResultData containing decoded data and image format
- Throws:
QRCodeScannerSDKException
- in case the image could not be decodedLinkageError
-