BarcodeScanner
Represents a Barcode Scanner that uses ML Kit Barcodes.
The BarcodeScanner can be used in a Frame Processor by calling scanCodes, or for static images by calling scanCodesInImageAsync. It holds native resources: dispose it (or use it in a use { } block) once it is no longer needed.
val scanner = createBarcodeScanner(BarcodeScannerOptions(listOf(TargetBarcodeFormat.ALL_FORMATS)))
frameOutput.setOnFrameCallback { frame ->
frame.use { scanner.scanCodes(it) }.forEach { println("Barcode value: ${it.rawValue}") }
}Content copied to clipboard
See also
Functions
Link copied to clipboard
Same as dispose, to use a BarcodeScanner with use { }.
Link copied to clipboard
Disposes this BarcodeScanner, releasing its native resources. It must not be used afterwards.
Link copied to clipboard
Link copied to clipboard