Class BarcodeAutoSnappingController
-
- All Implemented Interfaces:
public final class BarcodeAutoSnappingControllerControls auto-snapping process by observing contour detection results from BarcodeDetectorFrameHandler.
-
-
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, BarcodeDetectorFrameHandler barcodeDetectorFrameHandler)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, ScanbotBarcodeDetector barcodeDetector)Same as BarcodeAutoSnappingController.attach, but creates new BarcodeDetectorFrameHandler which will be attached to camera. final static BarcodeAutoSnappingControllerattach(IScanbotCameraView cameraView, BarcodeDetectorFrameHandler barcodeDetectorFrameHandler)Convenience method for attaching BarcodeAutoSnappingController to camera view and BarcodeDetectorFrameHandler. -
-
Constructor Detail
-
BarcodeAutoSnappingController
BarcodeAutoSnappingController(IScanbotCameraView cameraView, BarcodeDetectorFrameHandler barcodeDetectorFrameHandler)
-
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, ScanbotBarcodeDetector barcodeDetector)
Same as BarcodeAutoSnappingController.attach, but creates new BarcodeDetectorFrameHandler which will be attached to camera.
Use this method if you don't need to control barcodes detection routine. However, be careful to not accidentally attach several BarcodeDetectorFrameHandler to camera therefore causing contour detection to be executed more than once.
-
attach
final static BarcodeAutoSnappingController attach(IScanbotCameraView cameraView, BarcodeDetectorFrameHandler barcodeDetectorFrameHandler)
Convenience method for attaching BarcodeAutoSnappingController to camera view and BarcodeDetectorFrameHandler.
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 snappingbarcodeDetectorFrameHandler- BarcodeDetectorFrameHandler which will be attached to camera.
-
-
-
-