Class DocumentScannerCameraConfiguration
-
- All Implemented Interfaces:
-
android.os.Parcelable
public final class DocumentScannerCameraConfiguration implements Parcelable
Configuration of the camera behavior.
-
-
Field Summary
Fields Modifier and Type Field Description private CameraModule
cameraModule
private Double
defaultZoomFactor
private Boolean
autoCropOnManualSnap
private Boolean
flashEnabled
private Boolean
minFocusDistanceLock
private Boolean
touchToFocusEnabled
private Boolean
pinchToZoomEnabled
private CameraPreviewMode
cameraPreviewMode
private CapturePhotoQualityPrioritization
captureQualityPrioritization
private Double
autoSnappingSensitivity
private Integer
autoSnappingDelay
private Boolean
autoSnappingEnabled
private Boolean
captureWithHardwareButtonsEnabled
-
Constructor Summary
Constructors Constructor Description DocumentScannerCameraConfiguration(Map<String, Object> source)
DocumentScannerCameraConfiguration(JSONObject json)
DocumentScannerCameraConfiguration(CameraModule cameraModule, Double defaultZoomFactor, Boolean autoCropOnManualSnap, Boolean flashEnabled, Boolean minFocusDistanceLock, Boolean touchToFocusEnabled, Boolean pinchToZoomEnabled, CameraPreviewMode cameraPreviewMode, CapturePhotoQualityPrioritization captureQualityPrioritization, Double autoSnappingSensitivity, Integer autoSnappingDelay, Boolean autoSnappingEnabled, Boolean captureWithHardwareButtonsEnabled)
-
Method Summary
Modifier and Type Method Description final CameraModule
getCameraModule()
Determines which camera module to use on start-up. final Unit
setCameraModule(CameraModule cameraModule)
Determines which camera module to use on start-up. final Double
getDefaultZoomFactor()
The default zoom factor on start-up. final Unit
setDefaultZoomFactor(Double defaultZoomFactor)
The default zoom factor on start-up. final Boolean
getAutoCropOnManualSnap()
Determines whether the document should be cropped automatically after a manual snap or not. final Unit
setAutoCropOnManualSnap(Boolean autoCropOnManualSnap)
Determines whether the document should be cropped automatically after a manual snap or not. final Boolean
getFlashEnabled()
Determines whether the flashlight is enabled or not on start-up. final Unit
setFlashEnabled(Boolean flashEnabled)
Determines whether the flashlight is enabled or not on start-up. final Boolean
getMinFocusDistanceLock()
Determines whether locking the focus at the minimum possible distance is enabled or not (device-specific). final Unit
setMinFocusDistanceLock(Boolean minFocusDistanceLock)
Determines whether locking the focus at the minimum possible distance is enabled or not (device-specific). final Boolean
getTouchToFocusEnabled()
Determines whether touch-to-focus is enabled or not. final Unit
setTouchToFocusEnabled(Boolean touchToFocusEnabled)
Determines whether touch-to-focus is enabled or not. final Boolean
getPinchToZoomEnabled()
Determines whether pinch-to-zoom is enabled or not. final Unit
setPinchToZoomEnabled(Boolean pinchToZoomEnabled)
Determines whether pinch-to-zoom is enabled or not. final CameraPreviewMode
getCameraPreviewMode()
Determines which camera preview mode to use. final Unit
setCameraPreviewMode(CameraPreviewMode cameraPreviewMode)
Determines which camera preview mode to use. final CapturePhotoQualityPrioritization
getCaptureQualityPrioritization()
Determines the prioritization of still image quality and capturing speed. final Unit
setCaptureQualityPrioritization(CapturePhotoQualityPrioritization captureQualityPrioritization)
Determines the prioritization of still image quality and capturing speed. final Double
getAutoSnappingSensitivity()
Controls the auto snapping speed. final Unit
setAutoSnappingSensitivity(Double autoSnappingSensitivity)
Controls the auto snapping speed. final Integer
getAutoSnappingDelay()
After a page has been snapped, the delay in milliseconds before auto snapping resumes for the next page. final Unit
setAutoSnappingDelay(Integer autoSnappingDelay)
After a page has been snapped, the delay in milliseconds before auto snapping resumes for the next page. final Boolean
getAutoSnappingEnabled()
Determines if auto snapping is enabled or not. final Unit
setAutoSnappingEnabled(Boolean autoSnappingEnabled)
Determines if auto snapping is enabled or not. final Boolean
getCaptureWithHardwareButtonsEnabled()
When enabled the hardware volume up/down buttons can be used to capture an image if manual snapping is enabled. final Unit
setCaptureWithHardwareButtonsEnabled(Boolean captureWithHardwareButtonsEnabled)
When enabled the hardware volume up/down buttons can be used to capture an image if manual snapping is enabled. final JSONObject
toJson(ToJsonConfiguration config)
final DocumentScannerCameraConfiguration
clone()
final static DocumentScannerCameraConfiguration
default()
-
-
Constructor Detail
-
DocumentScannerCameraConfiguration
DocumentScannerCameraConfiguration(JSONObject json)
-
DocumentScannerCameraConfiguration
DocumentScannerCameraConfiguration(CameraModule cameraModule, Double defaultZoomFactor, Boolean autoCropOnManualSnap, Boolean flashEnabled, Boolean minFocusDistanceLock, Boolean touchToFocusEnabled, Boolean pinchToZoomEnabled, CameraPreviewMode cameraPreviewMode, CapturePhotoQualityPrioritization captureQualityPrioritization, Double autoSnappingSensitivity, Integer autoSnappingDelay, Boolean autoSnappingEnabled, Boolean captureWithHardwareButtonsEnabled)
-
-
Method Detail
-
getCameraModule
final CameraModule getCameraModule()
Determines which camera module to use on start-up.
Default is BACK
-
setCameraModule
final Unit setCameraModule(CameraModule cameraModule)
Determines which camera module to use on start-up.
Default is BACK
-
getDefaultZoomFactor
final Double getDefaultZoomFactor()
The default zoom factor on start-up.
Default is 1.0
-
setDefaultZoomFactor
final Unit setDefaultZoomFactor(Double defaultZoomFactor)
The default zoom factor on start-up.
Default is 1.0
-
getAutoCropOnManualSnap
final Boolean getAutoCropOnManualSnap()
Determines whether the document should be cropped automatically after a manual snap or not.
Default is true
-
setAutoCropOnManualSnap
final Unit setAutoCropOnManualSnap(Boolean autoCropOnManualSnap)
Determines whether the document should be cropped automatically after a manual snap or not.
Default is true
-
getFlashEnabled
final Boolean getFlashEnabled()
Determines whether the flashlight is enabled or not on start-up.
Default is false
-
setFlashEnabled
final Unit setFlashEnabled(Boolean flashEnabled)
Determines whether the flashlight is enabled or not on start-up.
Default is false
-
getMinFocusDistanceLock
final Boolean getMinFocusDistanceLock()
Determines whether locking the focus at the minimum possible distance is enabled or not (device-specific).
Default is false
-
setMinFocusDistanceLock
final Unit setMinFocusDistanceLock(Boolean minFocusDistanceLock)
Determines whether locking the focus at the minimum possible distance is enabled or not (device-specific).
Default is false
-
getTouchToFocusEnabled
final Boolean getTouchToFocusEnabled()
Determines whether touch-to-focus is enabled or not. Android only.
Default is false
-
setTouchToFocusEnabled
final Unit setTouchToFocusEnabled(Boolean touchToFocusEnabled)
Determines whether touch-to-focus is enabled or not. Android only.
Default is false
-
getPinchToZoomEnabled
final Boolean getPinchToZoomEnabled()
Determines whether pinch-to-zoom is enabled or not.
Default is true
-
setPinchToZoomEnabled
final Unit setPinchToZoomEnabled(Boolean pinchToZoomEnabled)
Determines whether pinch-to-zoom is enabled or not.
Default is true
-
getCameraPreviewMode
final CameraPreviewMode getCameraPreviewMode()
Determines which camera preview mode to use.
Default is FILL_IN
-
setCameraPreviewMode
final Unit setCameraPreviewMode(CameraPreviewMode cameraPreviewMode)
Determines which camera preview mode to use.
Default is FILL_IN
-
getCaptureQualityPrioritization
final CapturePhotoQualityPrioritization getCaptureQualityPrioritization()
Determines the prioritization of still image quality and capturing speed.
Default is BALANCED
-
setCaptureQualityPrioritization
final Unit setCaptureQualityPrioritization(CapturePhotoQualityPrioritization captureQualityPrioritization)
Determines the prioritization of still image quality and capturing speed.
Default is BALANCED
-
getAutoSnappingSensitivity
final Double getAutoSnappingSensitivity()
Controls the auto snapping speed. The sensitivity must be between 0.0 and 1.0. A value of 1.0 triggers auto snapping immediately, while a value of 0.0 delays the auto snapping by 3 seconds. The default value is 0.66 (2 seconds).
Default is 0.66
-
setAutoSnappingSensitivity
final Unit setAutoSnappingSensitivity(Double autoSnappingSensitivity)
Controls the auto snapping speed. The sensitivity must be between 0.0 and 1.0. A value of 1.0 triggers auto snapping immediately, while a value of 0.0 delays the auto snapping by 3 seconds. The default value is 0.66 (2 seconds).
Default is 0.66
-
getAutoSnappingDelay
final Integer getAutoSnappingDelay()
After a page has been snapped, the delay in milliseconds before auto snapping resumes for the next page.
Default is 200
-
setAutoSnappingDelay
final Unit setAutoSnappingDelay(Integer autoSnappingDelay)
After a page has been snapped, the delay in milliseconds before auto snapping resumes for the next page.
Default is 200
-
getAutoSnappingEnabled
final Boolean getAutoSnappingEnabled()
Determines if auto snapping is enabled or not.
Default is true
-
setAutoSnappingEnabled
final Unit setAutoSnappingEnabled(Boolean autoSnappingEnabled)
Determines if auto snapping is enabled or not.
Default is true
-
getCaptureWithHardwareButtonsEnabled
final Boolean getCaptureWithHardwareButtonsEnabled()
When enabled the hardware volume up/down buttons can be used to capture an image if manual snapping is enabled. For iOS version 17.2 or later is required. On iPhones with camera control (iPhone 16 series) this also enables zooming and capturing with the camera control.
Default is true
-
setCaptureWithHardwareButtonsEnabled
final Unit setCaptureWithHardwareButtonsEnabled(Boolean captureWithHardwareButtonsEnabled)
When enabled the hardware volume up/down buttons can be used to capture an image if manual snapping is enabled. For iOS version 17.2 or later is required. On iPhones with camera control (iPhone 16 series) this also enables zooming and capturing with the camera control.
Default is true
-
toJson
final JSONObject toJson(ToJsonConfiguration config)
-
clone
final DocumentScannerCameraConfiguration clone()
-
default
final static DocumentScannerCameraConfiguration default()
-
-
-
-