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.AutoSnappingStateListener
stateListener
private Boolean
isEnabled
-
Constructor Summary
Constructors Constructor Description BaseAutoSnappingController(IScanbotCameraView cameraView)
-
Method Summary
Modifier and Type Method Description IAutoSnappingController.AutoSnappingStateListener
getStateListener()
Unit
setStateListener(IAutoSnappingController.AutoSnappingStateListener stateListener)
final Boolean
isEnabled()
Flag to disable autosnapping processing. final Unit
setEnabled(Boolean isEnabled)
final Unit
setForceAutofocusBeforeSnap(Boolean forceAutofocusBeforeSnap)
final Unit
setShakeDetectionEnabled(Boolean enabled)
Allows to enable or disable shake detection before autosnapping. final Unit
setSensitivity(Float sensitivity)
Changes sensitivity of auto-snapping. Unit
trySnap(T parameter)
Start conditions evaluation and, maybe, take a snap, e.g. final Unit
setAutoSnappingCallback(IAutoSnappingController.Callback callback)
Set callback. abstract Unit
detach()
Allows to detach successor implementation class. final Unit
cleanup()
-
-
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
false
frames will be skipped.
-
setEnabled
final Unit setEnabled(Boolean isEnabled)
-
setForceAutofocusBeforeSnap
final Unit setForceAutofocusBeforeSnap(Boolean forceAutofocusBeforeSnap)
- Parameters:
forceAutofocusBeforeSnap
-true
to enable auto focus before snapping,false
to 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 ornull
to 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.
-
-
-
-