Class DefaultBarcodeScanner
-
- All Implemented Interfaces:
-
io.scanbot.sdk.barcode.BarcodeScanner
public final class DefaultBarcodeScanner implements BarcodeScanner
Manages barcode scanning operations and scanner initialization.
-
-
Constructor Summary
Constructors Constructor Description DefaultBarcodeScanner()
-
Method Summary
Modifier and Type Method Description BarcodeScannerConfigurationcopyCurrentConfiguration()Returns a copy of the current configuration. UnitsetConfiguration(BarcodeScannerConfiguration configuration)Sets the configuration for the barcode scanner. UnitenableBarcodeScan(Boolean barcodeScanEnabled)BarcodeScannerResultscanFromNv21(ByteArray nv21, Integer width, Integer height, Integer frameOrientation)Scan barcodes from the nv21 frame. BarcodeScannerResultscanFromNv21(ByteArray nv21, Integer width, Integer height, Integer frameOrientation, Rect finderRect)Scan barcodes from the nv21 frame within the viewfinder rectangle. BarcodeScannerResultscanFromJpeg(ByteArray jpeg, Integer frameOrientation)Scan barcodes from the jpeg image. BarcodeScannerResultscanFromRgba(ByteArray img, Integer width, Integer height, Integer frameOrientation)Scan barcodes from the RGBA image. BarcodeScannerResultscanFromBitmap(Bitmap bitmap, Integer frameOrientation)Scan barcodes from the bitmap. -
-
Method Detail
-
copyCurrentConfiguration
BarcodeScannerConfiguration copyCurrentConfiguration()
Returns a copy of the current configuration.
-
setConfiguration
Unit setConfiguration(BarcodeScannerConfiguration configuration)
Sets the configuration for the barcode scanner.
- Parameters:
configuration- The configuration to set.
-
enableBarcodeScan
Unit enableBarcodeScan(Boolean barcodeScanEnabled)
- Parameters:
barcodeScanEnabled- iftruebarcode scanning will be enabled,false- will be disabled
-
scanFromNv21
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
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
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
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
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.
-
-
-
-