BarcodeScannerConfiguration

data class BarcodeScannerConfiguration(var barcodeFormatConfigurations: List<BarcodeFormatConfigurationBase> = listOf( BarcodeFormatCommonConfiguration( ) ), var extractedDocumentFormats: List<BarcodeDocumentFormat> = listOf( BarcodeDocumentFormat.AAMVA, BarcodeDocumentFormat.BOARDING_PASS, BarcodeDocumentFormat.DE_MEDICAL_PLAN, BarcodeDocumentFormat.MEDICAL_CERTIFICATE, BarcodeDocumentFormat.ID_CARD_PDF_417, BarcodeDocumentFormat.SEPA, BarcodeDocumentFormat.SWISS_QR, BarcodeDocumentFormat.VCARD, BarcodeDocumentFormat.GS1, BarcodeDocumentFormat.HIBC, BarcodeDocumentFormat.BRITISH_COLUMBIA_DRIVER_LICENSE ), var onlyAcceptDocuments: Boolean = false, var returnBarcodeImage: Boolean = false, var accumulationConfig: BarcodeAccumulationConfiguration = BarcodeAccumulationConfiguration( ), var optimizedForOverlays: Boolean = false, var directAcceptanceAreaFraction: Double = 0.8, var engineMode: BarcodeScannerEngineMode = BarcodeScannerEngineMode.NEXT_GEN, var processingMode: ProcessingMode = ProcessingMode.AUTO) : Parcelable

Configuration for the barcode scanner.

Constructors

Link copied to clipboard
constructor(source: Map<String, Any?>)
constructor(json: JSONObject)
constructor(barcodeFormatConfigurations: List<BarcodeFormatConfigurationBase> = listOf( BarcodeFormatCommonConfiguration( ) ), extractedDocumentFormats: List<BarcodeDocumentFormat> = listOf( BarcodeDocumentFormat.AAMVA, BarcodeDocumentFormat.BOARDING_PASS, BarcodeDocumentFormat.DE_MEDICAL_PLAN, BarcodeDocumentFormat.MEDICAL_CERTIFICATE, BarcodeDocumentFormat.ID_CARD_PDF_417, BarcodeDocumentFormat.SEPA, BarcodeDocumentFormat.SWISS_QR, BarcodeDocumentFormat.VCARD, BarcodeDocumentFormat.GS1, BarcodeDocumentFormat.HIBC, BarcodeDocumentFormat.BRITISH_COLUMBIA_DRIVER_LICENSE ), onlyAcceptDocuments: Boolean = false, returnBarcodeImage: Boolean = false, accumulationConfig: BarcodeAccumulationConfiguration = BarcodeAccumulationConfiguration( ), optimizedForOverlays: Boolean = false, directAcceptanceAreaFraction: Double = 0.8, engineMode: BarcodeScannerEngineMode = BarcodeScannerEngineMode.NEXT_GEN, processingMode: ProcessingMode = ProcessingMode.AUTO)

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Configuration to accumulate barcodes across multiple frames in live mode.

Link copied to clipboard
Link copied to clipboard

In single-shot mode, if the combined area of detected barcodes exceeds this fraction of the input image, the scanner returns the result immediately. Further scanning is skipped, even if more barcodes may be present. This can be used to accelerate scanning when barcode sizes are known in advance. To disable this behaviour, the value must be set to 1.0.

Link copied to clipboard

The engine mode for barcode scanning.

Link copied to clipboard

List of document formats to be extracted. Barcodes that decode to one of the extracted document formats will have extractedDocument field in BarcodeItem populated with the parsed document. By default all supported barcode document formats are accepted. If empty, no barcodes will be parsed into documents. To only accept the document formats listed in extractedDocumentFormats, the property onlyAcceptDocuments must be true.

Link copied to clipboard

If true and extractedDocumentFormats is not empty, then barcodes that don't decode to one of the extracted document formats will be ignored.

Link copied to clipboard

If true, the quads of linear (1D) barcodes will be further refined to more closely match the barcode's outline in the input image. This will also produce stabler barcode outlines across frames for use cases such as AR.

Link copied to clipboard

Scanners typically can produce better results from a single image if they are allowed to spend a longer time analyzing it.

Link copied to clipboard

If true, the barcode image will be returned in the BarcodeItem.

Functions

Link copied to clipboard
Link copied to clipboard
fun BarcodeScannerConfiguration.setBarcodeFormats(barcodeFormats: List<BarcodeFormat> = BarcodeFormatCommonConfiguration.default().formats)

Simplified extension configuration function that set the list of barcode formats to scan. By default, the most commonly used formats are enabled. Overrides BarcodeScannerConfiguration.barcodeFormatConfigurations list of configurations.

Link copied to clipboard
fun toJson(config: ToJsonConfiguration = ToJsonConfiguration.default()): JSONObject