public IScanbotCameraView
long getDelayAfterFocusCompleteMs()
Delay that camera will took before snap on auto focus complete called from camera core in ms. For some devices this callback could call even before real auto focus completed, so we need to take some delay before snapping. Usually you can set 500ms. By default it is set to 20ms.
void setDelayAfterFocusCompleteMs(long p)
Delay that camera will took before snap on auto focus complete called from camera core in ms. For some devices this callback could call even before real auto focus completed, so we need to take some delay before snapping. Usually you can set 500ms. By default it is set to 20ms.
@Nullable <T extends FrameHandler> T getAttachedFrameHandler(@NotNull java.lang.Class<T> clazz)
Check whether there is same class of interface FrameHandler attached to the view
return object of the same class if exists otherwise null
interface FrameHandler,
nullvoid addFrameHandler(@NotNull
FrameHandler frameHandler)
Used to add frame handler that will be called on each next frame
void removeFrameHandler(@NotNull
FrameHandler frameHandler)
Unregisters interface FrameHandler.
frameHandler - handler to unregister. If it was not registered before, nothing happens.interface FrameHandlervoid setPreviewMode(@NotNull
CameraPreviewMode mode)
Set the camera preview mode. By default - CameraPreviewMode.FILL_IN.
mode - camera preview mode
void takePicture(boolean acquireFocus)
Takes picture.
acquireFocus - {@code true} to perform auto-focus before shooting. {@code false} to shoot as fast as possible using current camera state.void addPictureCallback(@NotNull
BasePictureCallback pictureCallback)
Adds callback which will be notified when picture will be taken. Callbacks are invoked on a worker thread, so you can safely perform "heavy" operations here.
pictureCallback - callback to register. Must not be null. If this callbackwas already added, nothing happens.class PictureCallbackvoid removePictureCallback(@NotNull
BasePictureCallback pictureCallback)
Removes callback, so it won't receive any further notifications.
pictureCallback - callback to unregister. If it was not registered before, nothinghappens.void setCameraOpenCallback(@NotNull
CameraOpenCallback cameraOpenCallback)
Callback which will be invoked when camera will be opened
cameraOpenCallback - callbackvoid addCameraStateCallback(@NotNull
CameraStateCallback cameraStateCallback)
Adds callback which will be notified about camera state changes. Callbacks are invoked on a main thread.
cameraStateCallback - callback to register. Must not be null. If this callbackwas already added, nothing happens.void removeCameraStateCallback(@NotNull
CameraStateCallback cameraStateCallback)
Removes callback, so it won't receive any further notifications.
cameraStateCallback - callback to unregister. If it was not registered before, nothinghappens.void addTakePictureCallback(@NotNull
CameraTakePictureCallback cameraTakePictureCallback)
Adds callback which will be notified about take picture operation process. Callbacks are invoked on a main thread.
cameraTakePictureCallback - callback to register. Must not be null. If this callbackwas already added, nothing happens.void removeTakePictureCallback(@NotNull
CameraTakePictureCallback cameraTakePictureCallback)
Removes callback, so it won't receive any further notifications.
cameraTakePictureCallback - callback to unregister. If it was not registered before, nothinghappens.void setAutoFocusOnTouch(boolean autoFocusOnTouch)
autoFocusOnTouch - if true - auto focus on touch will be enabled, false - otherwise.By default this feature is enabled.void autoFocus()
Performs auto-focus.
If there is no auto-focus capabilities on this device, does nothing.
If view is paused, this call is ignored.
void continuousFocus()
Cancels auto-focus and performs continuous-focus. Should be executed from the main thread and when camera is opened
If there is no continuous-focus capabilities on this device, does auto-focus.
If view is paused, this call is ignored.
void useFlash(boolean useFlash)
Enables or disables camera flash.
If there is no flash on this device, does nothing.
If view is paused, this call is ignored.
useFlash - true to enable flash. false to disable flash.void lockToPortrait(boolean lockPicture)
Locks camera in portrait mode
lockPicture - if true - taken picture will ba locked to the portrait orientation,false - picture orientation depends on the device sensor.void lockToLandscape(boolean lockPicture)
Locks camera in landscape mode
lockPicture - if true - taken picture will ba locked to the landscape orientation,false - picture orientation depends on the device sensor.void unlockOrientation()
Unlocks camera orientation
void usePinchToZoom(boolean usePinchToZoom)
Enables/disables Pinch-to-Zoom camera functionality
usePinchToZoom - true if Pinch-to-Zoom should be enabled, false - otherwisevoid setOpticalZoomLevel(float zoomLevel)
Sets current zoom by a linear zoom value ranging from 0f to 1.0f. Zoom Level 0f represents the minimum zoom while Zoom Level 1.0f represents the maximum zoom. Default value is 0f.
zoomLevel - Target zoom levelvoid setOpticalZoomRange(@NotNull
ZoomRange zoomRange)
Set custom zoom range. Default value is ZoomRange0f,1f.
zoomRange - Target zoom rangevoid setCameraModule(@NotNull
CameraModule cameraModule)
Defines a camera module. By default is CameraModule.BACK.
cameraModule - enum CameraModule to use.