Class BarcodeAutoSnappingController
-
- All Implemented Interfaces:
public final class BarcodeAutoSnappingControllerControls auto-snapping process by observing document scanning results from BarcodeScannerFrameHandler.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceBarcodeAutoSnappingController.AutoSnappingCallbackCalled right before auto-snapping routine takes picture. Might intercept and cancel the shooting.
-
Field Summary
Fields Modifier and Type Field Description private BooleanisEnabledprivate final IScanbotCameraViewcameraView
-
Constructor Summary
Constructors Constructor Description BarcodeAutoSnappingController(IScanbotCameraView cameraView, BarcodeScannerFrameHandler frameHandler)BarcodeAutoSnappingController(IScanbotCameraView cameraView, FrameHandler frameHandler)
-
Method Summary
Modifier and Type Method Description final BooleanisEnabled()trueif auto-snapping is enabled.final UnitsetEnabled(Boolean isEnabled)trueif auto-snapping is enabled.final IScanbotCameraViewgetCameraView()final UnitsetSensitivity(Float sensitivity)Changes sensitivity of auto-snapping. final UnitsetAutoSnappingCallback(BarcodeAutoSnappingController.AutoSnappingCallback callback)final static BarcodeAutoSnappingControllerattach(IScanbotCameraView cameraView, BarcodeScanner barcodeScanner)Same as BarcodeAutoSnappingController.attach, but creates new BarcodeScannerFrameHandler which will be attached to camera. final static BarcodeAutoSnappingControllerattach(IScanbotCameraView cameraView, BarcodeScannerFrameHandler frameHandler)Convenience method for attaching BarcodeAutoSnappingController to camera view and BarcodeScannerFrameHandler. -
-
Constructor Detail
-
BarcodeAutoSnappingController
BarcodeAutoSnappingController(IScanbotCameraView cameraView, BarcodeScannerFrameHandler frameHandler)
-
BarcodeAutoSnappingController
BarcodeAutoSnappingController(IScanbotCameraView cameraView, FrameHandler frameHandler)
-
-
Method Detail
-
isEnabled
final Boolean isEnabled()
trueif auto-snapping is enabled.falseif auto-snapping is disabled.
-
setEnabled
final Unit setEnabled(Boolean isEnabled)
trueif auto-snapping is enabled.falseif auto-snapping is disabled.
-
getCameraView
final IScanbotCameraView getCameraView()
-
setSensitivity
final Unit setSensitivity(Float sensitivity)
Changes sensitivity of auto-snapping. That is: the more sensitive it is the faster it shoots.
Sensitivity must be within 0..1 range. A value of 1.0 triggers automatic capturing immediately, a value of 0.0 delays the automatic by 3 seconds.
The default value is 0.66 (1 sec)
- Parameters:
sensitivity- sensitivity within 0..
-
setAutoSnappingCallback
final Unit setAutoSnappingCallback(BarcodeAutoSnappingController.AutoSnappingCallback callback)
- Parameters:
callback- callback which will be called right before auto-snapping routine takes picture.
-
attach
final static BarcodeAutoSnappingController attach(IScanbotCameraView cameraView, BarcodeScanner barcodeScanner)
Same as BarcodeAutoSnappingController.attach, but creates new BarcodeScannerFrameHandler which will be attached to camera.
Use this method if you don't need to control barcodes scanning routine. However, be careful to not accidentally attach several BarcodeScannerFrameHandler to camera therefore causing document scanning to be executed more than once.
-
attach
final static BarcodeAutoSnappingController attach(IScanbotCameraView cameraView, BarcodeScannerFrameHandler frameHandler)
Convenience method for attaching BarcodeAutoSnappingController to camera view and BarcodeScannerFrameHandler.
Auto-snapping is enabled by default as soon as you create new instance of BarcodeAutoSnappingController. You can manually enable or disable auto-snapping by calling BarcodeAutoSnappingController.isEnabled.
- Parameters:
cameraView- camera view which is used for snappingframeHandler- BarcodeScannerFrameHandler which will be attached to camera.
-
-
-
-