Class DefaultScanbotBarcodeDetector
-
- All Implemented Interfaces:
-
io.scanbot.sdk.barcode.ScanbotBarcodeDetector
public final class DefaultScanbotBarcodeDetector implements ScanbotBarcodeDetector
Manages barcode detection operations and detector initialization
-
-
Constructor Summary
Constructors Constructor Description DefaultScanbotBarcodeDetector()
-
Method Summary
Modifier and Type Method Description UnitsetConfig(BarcodeScannerConfig config)Apply configuration to tweak scanning logic. UnitmodifyConfig(Function1<BarcodeScannerConfigBuilder, Unit> mutatingFunc)Modify existing config. UnitenableBarcodeScan(Boolean barcodeScanEnabled)BarcodeScanningResultdetectFromNv21(ByteArray nv21, Integer width, Integer height, Integer frameOrientation)Detect barcodes on the nv21 frame. BarcodeScanningResultdetectFromNv21(ByteArray nv21, Integer width, Integer height, Integer frameOrientation, Rect finderRect)Decode the nv21 within the viewfinder rectangle, and time how long it took. BarcodeScanningResultdetectFromNv21(ByteArray nv21, Integer width, Integer height, Integer frameOrientation, Rect finderRect, Boolean isLive)Decode the nv21 within the viewfinder rectangle, and time how long it took. BarcodeScanningResultdetectFromJpeg(ByteArray jpeg, Integer frameOrientation)Detect barcodes on the jpeg image. BarcodeScanningResultdetectFromRgba(ByteArray img, Integer width, Integer height, Integer frameOrientation)Detect barcodes on the RGBA image. BarcodeScanningResultdetectFromBitmap(Bitmap bitmap, Integer frameOrientation)Detect barcodes on the bitmap. -
-
Method Detail
-
setConfig
Unit setConfig(BarcodeScannerConfig config)
Apply configuration to tweak scanning logic.
NOTE: this only influences current instance of ScanbotBarcodeDetector!
See default values in BarcodeScannerConfig's documentation.
Java users may benefit from using pre-made builders: BarcodeScannerConfigBuilder, BarcodeScannerAdditionalConfigBuilder
-
modifyConfig
Unit modifyConfig(Function1<BarcodeScannerConfigBuilder, Unit> mutatingFunc)
Modify existing config.
- Parameters:
mutatingFunc- will receive the existing config instance - justcopyit changing the desired parameter.
-
enableBarcodeScan
Unit enableBarcodeScan(Boolean barcodeScanEnabled)
- Parameters:
barcodeScanEnabled- iftruebarcode scanning will be enabled,false- will be disabled
-
detectFromNv21
BarcodeScanningResult detectFromNv21(ByteArray nv21, Integer width, Integer height, Integer frameOrientation)
Detect barcodes on the nv21 frame.
For efficiency, reuse the same detector object from one decode to the next. The barcode filters list is taken from the current 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.
-
detectFromNv21
BarcodeScanningResult detectFromNv21(ByteArray nv21, Integer width, Integer height, Integer frameOrientation, Rect finderRect)
Decode the nv21 within the viewfinder rectangle, and time how long it took.
For efficiency, reuse the same reader objects from one decode to the next. The barcode filters list is taken from the current 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
-
detectFromNv21
BarcodeScanningResult detectFromNv21(ByteArray nv21, Integer width, Integer height, Integer frameOrientation, Rect finderRect, Boolean isLive)
Decode the nv21 within the viewfinder rectangle, and time how long it took.
For efficiency, reuse the same reader objects from one decode to the next. The barcode filters list is taken from the current 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 areaisLive- iftrue- will try to detect barcodes in the live mode (e.g.
-
detectFromJpeg
BarcodeScanningResult detectFromJpeg(ByteArray jpeg, Integer frameOrientation)
Detect barcodes on the jpeg image.
For efficiency, reuse the same reader objects from one decode to the next. The barcode filters list is taken from the current state
- Parameters:
jpeg- The jpeg to find barcodes.frameOrientation- The frame orientation degrees.
-
detectFromRgba
BarcodeScanningResult detectFromRgba(ByteArray img, Integer width, Integer height, Integer frameOrientation)
Detect barcodes on the RGBA image.
For efficiency, reuse the same reader objects from one decode to the next. The barcode filters list is taken from the current 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.
-
detectFromBitmap
BarcodeScanningResult detectFromBitmap(Bitmap bitmap, Integer frameOrientation)
Detect barcodes on the bitmap.
For efficiency, reuse the same reader objects from one decode to the next. The barcode filters list is taken from the current state
- Parameters:
bitmap- The Bitmap to find barcodes.frameOrientation- The frame orientation degrees.
-
-
-
-