Interface BarcodeScanner
-
- All Implemented Interfaces:
public interface BarcodeScanner
Scans bar codes and QR codes.
-
-
Method Summary
Modifier and Type Method Description abstract BarcodeScannerConfiguration
copyCurrentConfiguration()
Returns a copy of the current configuration. abstract Unit
setConfiguration(BarcodeScannerConfiguration configuration)
Sets the configuration for the barcode scanner. abstract Unit
enableBarcodeScan(Boolean barcodeScanEnabled)
abstract BarcodeScannerResult
scanFromNv21(ByteArray nv21, Integer width, Integer height, Integer frameOrientation)
Scan barcodes from the nv21 frame. abstract BarcodeScannerResult
scanFromNv21(ByteArray nv21, Integer width, Integer height, Integer frameOrientation, Rect finderRect)
Scan barcodes from the nv21 frame within the viewfinder rectangle. abstract BarcodeScannerResult
scanFromJpeg(ByteArray jpeg, Integer frameOrientation)
Scan barcodes from the jpeg image. abstract BarcodeScannerResult
scanFromRgba(ByteArray img, Integer width, Integer height, Integer frameOrientation)
Scan barcodes from the RGBA image. abstract BarcodeScannerResult
scanFromBitmap(Bitmap bitmap, Integer frameOrientation)
Scan barcodes from the bitmap.
-
-
-
Method Detail
-
copyCurrentConfiguration
abstract BarcodeScannerConfiguration copyCurrentConfiguration()
Returns a copy of the current configuration.
-
setConfiguration
abstract Unit setConfiguration(BarcodeScannerConfiguration configuration)
Sets the configuration for the barcode scanner.
- Parameters:
configuration
- The configuration to set.
-
enableBarcodeScan
abstract Unit enableBarcodeScan(Boolean barcodeScanEnabled)
- Parameters:
barcodeScanEnabled
- iftrue
barcode scanning will be enabled,false
- will be disabled
-
scanFromNv21
abstract BarcodeScannerResult scanFromNv21(ByteArray nv21, Integer width, Integer height, Integer frameOrientation)
Scan barcodes from the nv21 frame.
For efficiency, reuse the same scanner object between scans. The barcode filters list is taken from the current configuration state.
- Parameters:
nv21
- The YUV preview frame.width
- The width of the preview frame.height
- The height of the preview frame.frameOrientation
- The frame orientation degrees.
-
scanFromNv21
abstract BarcodeScannerResult scanFromNv21(ByteArray nv21, Integer width, Integer height, Integer frameOrientation, Rect finderRect)
Scan barcodes from the nv21 frame within the viewfinder rectangle.
For efficiency, reuse the same scanner object between scans. The barcode filters list is taken from the current configuration state.
- Parameters:
nv21
- The YUV preview frame.width
- The width of the preview frame.height
- The height of the preview frame.frameOrientation
- The frame orientation degrees.finderRect
- decode area
-
scanFromJpeg
abstract BarcodeScannerResult scanFromJpeg(ByteArray jpeg, Integer frameOrientation)
Scan barcodes from the jpeg image.
For efficiency, reuse the same scanner object between scans. The barcode filters list is taken from the current configuration state.
- Parameters:
jpeg
- The jpeg to find barcodes.frameOrientation
- The frame orientation degrees.
-
scanFromRgba
abstract BarcodeScannerResult scanFromRgba(ByteArray img, Integer width, Integer height, Integer frameOrientation)
Scan barcodes from the RGBA image.
For efficiency, reuse the same scanner object between scans. The barcode filters list is taken from the current configuration state.
- Parameters:
img
- The byteArray with image to find barcodes.width
- The width of the preview frame.height
- The height of the preview frame.frameOrientation
- The frame orientation degrees.
-
scanFromBitmap
abstract BarcodeScannerResult scanFromBitmap(Bitmap bitmap, Integer frameOrientation)
Scan barcodes from the bitmap.
For efficiency, reuse the same scanner object between scans. The barcode filters list is taken from the current configuration state.
- Parameters:
bitmap
- The Bitmap to find barcodes.frameOrientation
- The frame orientation degrees.
-
-