public class AutoSnappingController
extends java.lang.Object
ContourDetectorFrameHandler.| Modifier and Type | Class and Description |
|---|---|
static interface |
AutoSnappingController.AutoSnappingCallback
Called right before auto-snapping routine takes picture.
|
| Constructor and Description |
|---|
AutoSnappingController(ScanbotCameraView cameraView,
ContourDetectorFrameHandler contourDetectorFrameHandler) |
| Modifier and Type | Method and Description |
|---|---|
static AutoSnappingController |
attach(ScanbotCameraView cameraView)
Same as
attach(ScanbotCameraView, ContourDetectorFrameHandler), but creates
new ContourDetectorFrameHandler which will be attached to camera. |
static AutoSnappingController |
attach(ScanbotCameraView cameraView,
ContourDetectorFrameHandler contourDetectorFrameHandler)
Convenience method for attaching
AutoSnappingController to camera view and
ContourDetectorFrameHandler. |
boolean |
isEnabled() |
void |
setAutoSnappingCallback(AutoSnappingController.AutoSnappingCallback callback) |
void |
setEnabled(boolean enabled) |
void |
setSensitivity(float sensitivity)
Changes sensitivity of auto-snapping.
|
public AutoSnappingController(ScanbotCameraView cameraView, ContourDetectorFrameHandler contourDetectorFrameHandler)
public static AutoSnappingController attach(ScanbotCameraView cameraView)
attach(ScanbotCameraView, ContourDetectorFrameHandler), but creates
new ContourDetectorFrameHandler which will be attached to camera.
Use this method if you don't need to control contour detection routine. However, be careful
to not accidentally attach several ContourDetectorFrameHandler to camera therefore
causing contour detection to be executed more than once.
public static AutoSnappingController attach(ScanbotCameraView cameraView, ContourDetectorFrameHandler contourDetectorFrameHandler)
AutoSnappingController to camera view and
ContourDetectorFrameHandler.
Auto-snapping is enabled by default as soon as you create new instance of
AutoSnappingController. You can manually enable or disable auto-snapping by calling
setEnabled(boolean).
cameraView - camera view which is used for snappingcontourDetectorFrameHandler - ContourDetectorFrameHandler which will be attached
to camera.AutoSnappingControllerpublic void setEnabled(boolean enabled)
enabled - true to enable auto-snapping. false to disable auto-snapping.public boolean isEnabled()
true if auto-snapping is enabled. false if auto-snapping is disabled.public void setSensitivity(float sensitivity)
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)
sensitivity - sensitivity within [0..1] range. If given value is outside of this range
it is clampedpublic void setAutoSnappingCallback(AutoSnappingController.AutoSnappingCallback callback)
callback - callback which will be called right before auto-snapping routine takes
picture.