public class BarcodeAutoSnappingController
Controls auto-snapping process by observing contour detection results from
class BarcodeDetectorFrameHandler.
class BarcodeDetectorFrameHandlerpublic static io.scanbot.sdk.barcode.BarcodeAutoSnappingController.Companion Companion
protected BarcodeAutoSnappingController(@NotNull
io.scanbot.sdk.ui.camera.IScanbotCameraView cameraView,
@NotNull
io.scanbot.sdk.camera.FrameHandler frameHandler)
Controls auto-snapping process by observing contour detection results from
class BarcodeDetectorFrameHandler.
class BarcodeDetectorFrameHandlerpublic BarcodeAutoSnappingController(@NotNull
io.scanbot.sdk.ui.camera.IScanbotCameraView cameraView,
@NotNull
BarcodeDetectorFrameHandler barcodeDetectorFrameHandler)
@NotNull protected java.util.concurrent.atomic.AtomicLong getCaptureInterval()
@NotNull protected io.scanbot.sdk.util.log.Logger getLogger()
protected long getLastCapture()
protected void setLastCapture(long p)
@NotNull protected java.util.concurrent.atomic.AtomicBoolean getCapturing()
protected void setCapturing(@NotNull
java.util.concurrent.atomic.AtomicBoolean p)
@NotNull protected android.os.Handler getMainThreadHandler()
public boolean isEnabled()
true if auto-snapping is enabled. false if auto-snapping is disabled.
public void setEnabled(boolean p)
true if auto-snapping is enabled. false if auto-snapping is disabled.
protected void barcodesDetected()
public void 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 0.66 (1 sec)
public void setAutoSnappingCallback(@Nullable
io.scanbot.sdk.barcode.BarcodeAutoSnappingController.AutoSnappingCallback callback)
callback - callback which will be called right before auto-snapping routine takespicture.@NotNull protected io.scanbot.sdk.ui.camera.IScanbotCameraView getCameraView()
@JvmStatic @NotNull public static BarcodeAutoSnappingController attach(@NotNull io.scanbot.sdk.ui.camera.IScanbotCameraView cameraView, @NotNull ScanbotBarcodeDetector barcodeDetector)
Same as BarcodeAutoSnappingController.attach, but creates
new class BarcodeDetectorFrameHandler which will be attached to camera.
Use this method if you don't need to control barcodes detection routine. However, be careful
to not accidentally attach several class BarcodeDetectorFrameHandler to camera therefore
causing contour detection to be executed more than once.
@JvmStatic @NotNull public static BarcodeAutoSnappingController attach(@NotNull io.scanbot.sdk.ui.camera.IScanbotCameraView cameraView, @NotNull BarcodeDetectorFrameHandler barcodeDetectorFrameHandler)
Convenience method for attaching class BarcodeAutoSnappingController to camera view and
class BarcodeDetectorFrameHandler.
Auto-snapping is enabled by default as soon as you create new instance of
class BarcodeAutoSnappingController. You can manually enable or disable auto-snapping by calling BarcodeAutoSnappingController.isEnabled.
cameraView - camera view which is used for snappingbarcodeDetectorFrameHandler - class BarcodeDetectorFrameHandler which will be attachedto camera.class BarcodeAutoSnappingControllerclass BarcodeAutoSnappingController,
class BarcodeDetectorFrameHandler,
class BarcodeAutoSnappingController,
BarcodeAutoSnappingController.isEnabled