Class BaseAutoSnappingController
-
- 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 IAutoSnappingController.AutoSnappingStateListenergetStateListener()UnitsetStateListener(IAutoSnappingController.AutoSnappingStateListener stateListener)final BooleanisEnabled()Flag to disable autosnapping processing. final UnitsetEnabled(Boolean isEnabled)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. final Unitcleanup()Cleanup all resources and listeners. -
-
Constructor Detail
-
BaseAutoSnappingController
BaseAutoSnappingController(IScanbotCameraView cameraView)
-
-
Method Detail
-
getStateListener
IAutoSnappingController.AutoSnappingStateListener getStateListener()
-
setStateListener
Unit setStateListener(IAutoSnappingController.AutoSnappingStateListener stateListener)
-
isEnabled
final Boolean isEnabled()
Flag to disable autosnapping processing. In case of
falseframes will be skipped.
-
setEnabled
final Unit setEnabled(Boolean isEnabled)
-
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.
-
detach
abstract Unit detach()
Allows to detach successor implementation class. To be called in place of usage when screen hierarchy is being destroyed.
-
-
-
-