public class CaptureIntervalAutoSnappingPredicate implements IAutoSnappingPredicate<T>, ResettablePredicate
Determines how often consecutive snaps can be made.
Don't forget to call reset after successful snap.
resetpublic static float DEFAULT_SENSITIVITY
public static io.scanbot.sdk.camera.autosnapping.CaptureIntervalAutoSnappingPredicate.Companion Companion
@NotNull public io.scanbot.sdk.camera.autosnapping.IAutoSnappingController.AutoSnappingStateListener getStateListener()
public void setStateListener(@NotNull
io.scanbot.sdk.camera.autosnapping.IAutoSnappingController.AutoSnappingStateListener p)
public void setSensitivity(float sensitivity)
public boolean checkState(@NotNull
kotlin.Unit param)
Run this check.
param - typed param that this implementation might need. Default is Unitwhether this predicate currently allows autosnap
Note some (bad) magic here:
to achieve ability to implement interface IAutoSnappingPredicate
with param or without it - we do unchecked cast here.
If interface IAutoSnappingPredicate's implementation explicitly defines some type to use
as param - this cast will fail if nothing provided:
For class Foo : IAutoSnappingPredicate
call myFoo.okDetected() will fail, as it expects myFoo.okDetected(myClassInstance).
To have implementation that does not need param, just use Unit and pass no parameter:
class Bar : IAutoSnappingPredicate, and then myBar.okDetected()
public void reset()
Reset possible internal counter, e.g. when snap was made.