-
- All Implemented Interfaces:
-
io.scanbot.sdk.camera.autosnapping.IAutoSnappingController
public abstract class BaseAutoSnappingController<T extends Object> implements IAutoSnappingController<T>
Base IAutoSnappingController implementation, that is, in theory, to suffice any scenario needs.
This class wraps all device- and camera's lifecycle-specific code, as well as two conditions validation - significant move timeout and capture interval timeout.
-
-
Field Summary
Fields Modifier and Type Field Description private IAutoSnappingController.AutoSnappingStateListenerstateListenerprivate BooleanisEnabled
-
Constructor Summary
Constructors Constructor Description BaseAutoSnappingController(IScanbotCameraView cameraView)
-
Method Summary
Modifier and Type Method Description final IAutoSnappingController.AutoSnappingStateListenergetStateListener()final UnitsetStateListener(IAutoSnappingController.AutoSnappingStateListener stateListener)final BooleangetIsEnabled()Flag to disable autosnapping processing. final UnitsetIsEnabled(Boolean isEnabled)Flag to disable autosnapping processing. final UnitsetForceAutofocusBeforeSnap(Boolean forceAutofocusBeforeSnap)final UnitsetShakeDetectionEnabled(Boolean enabled)Allows to enable or disable shake detection before autosnapping. final UnitsetSensitivity(Float sensitivity)Changes sensitivity of auto-snapping. UnittrySnap(T parameter)Start conditions evaluation and, maybe, take a snap, e.g. final UnitsetAutoSnappingCallback(IAutoSnappingController.Callback callback)Set callback. abstract Unitdetach()Allows to detach successor implementation class. -
-
Constructor Detail
-
BaseAutoSnappingController
BaseAutoSnappingController(IScanbotCameraView cameraView)
-
-
Method Detail
-
getStateListener
final IAutoSnappingController.AutoSnappingStateListener getStateListener()
-
setStateListener
final Unit setStateListener(IAutoSnappingController.AutoSnappingStateListener stateListener)
-
getIsEnabled
final Boolean getIsEnabled()
Flag to disable autosnapping processing. In case of
falseframes will be skipped.
-
setIsEnabled
final Unit setIsEnabled(Boolean isEnabled)
Flag to disable autosnapping processing. In case of
falseframes will be skipped.
-
setForceAutofocusBeforeSnap
final Unit setForceAutofocusBeforeSnap(Boolean forceAutofocusBeforeSnap)
- Parameters:
forceAutofocusBeforeSnap-trueto enable auto focus before snapping,falseto snap whenever requested.
-
setShakeDetectionEnabled
final Unit setShakeDetectionEnabled(Boolean enabled)
Allows to enable or disable shake detection before autosnapping. It will wait for 2 seconds of stable values from accelerometer before taking a picture. Default is true
-
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 CaptureIntervalAutoSnappingPredicate.DEFAULT_SENSITIVITY (~1 sec)
- Parameters:
sensitivity- sensitivity within[0..1]range.
-
trySnap
Unit trySnap(T parameter)
Start conditions evaluation and, maybe, take a snap, e.g. depending on current image status, snap interval etc.
-
setAutoSnappingCallback
final Unit setAutoSnappingCallback(IAutoSnappingController.Callback callback)
Set callback. Defaults to IAutoSnappingController.Callback.NULL
- Parameters:
callback- to set ornullto reset to default.
-
-
-
-