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 Unit
setConfig(BarcodeScannerConfig config)
Apply configuration to tweak scanning logic. Unit
modifyConfig(Function1<BarcodeScannerConfigBuilder, Unit> mutatingFunc)
Modify existing config. Unit
enableBarcodeScan(Boolean barcodeScanEnabled)
BarcodeScanningResult
detectFromNv21(ByteArray nv21, Integer width, Integer height, Integer frameOrientation)
Detect barcodes on the nv21 frame. 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. 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. BarcodeScanningResult
detectFromJpeg(ByteArray jpeg, Integer frameOrientation)
Detect barcodes on the jpeg image. BarcodeScanningResult
detectFromRgba(ByteArray img, Integer width, Integer height, Integer frameOrientation)
Detect barcodes on the RGBA image. BarcodeScanningResult
detectFromBitmap(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 - justcopy
it changing the desired parameter.
-
enableBarcodeScan
Unit enableBarcodeScan(Boolean barcodeScanEnabled)
- Parameters:
barcodeScanEnabled
- iftrue
barcode 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.
-
-
-
-