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
flashEnabled
private Boolean
minFocusDistanceLock
private Boolean
touchToFocusEnabled
private Boolean
pinchToZoomEnabled
private CameraPreviewMode
cameraPreviewMode
private CapturePhotoQualityPrioritization
captureQualityPrioritization
private Double
acceptedAngleScore
private Double
acceptedSizeScore
private Double
autoSnappingSensitivity
private Integer
autoSnappingDelay
private Integer
acceptedBrightnessThreshold
private Boolean
autoSnappingEnabled
private List<AspectRatio>
requiredAspectRatios
private Boolean
ignoreBadAspectRatio
private Boolean
captureWithHardwareButtonsEnabled
-
Constructor Summary
Constructors Constructor Description DocumentScannerCameraConfiguration(Map<String, Object> source)
DocumentScannerCameraConfiguration(JSONObject json)
DocumentScannerCameraConfiguration(CameraModule cameraModule, Double defaultZoomFactor, Boolean flashEnabled, Boolean minFocusDistanceLock, Boolean touchToFocusEnabled, Boolean pinchToZoomEnabled, CameraPreviewMode cameraPreviewMode, CapturePhotoQualityPrioritization captureQualityPrioritization, Double acceptedAngleScore, Double acceptedSizeScore, Double autoSnappingSensitivity, Integer autoSnappingDelay, Integer acceptedBrightnessThreshold, Boolean autoSnappingEnabled, List<AspectRatio> requiredAspectRatios, Boolean ignoreBadAspectRatio, 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
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
getAcceptedAngleScore()
The minimum pitch/skew angle of the document to be accepted. final Unit
setAcceptedAngleScore(Double acceptedAngleScore)
The minimum pitch/skew angle of the document to be accepted. final Double
getAcceptedSizeScore()
The minimum size of the document in relation to the screen preview to be accepted. final Unit
setAcceptedSizeScore(Double acceptedSizeScore)
The minimum size of the document in relation to the screen preview to be accepted. 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 Integer
getAcceptedBrightnessThreshold()
The minimum brightness value to accept a detected document. final Unit
setAcceptedBrightnessThreshold(Integer acceptedBrightnessThreshold)
The minimum brightness value to accept a detected document. 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 List<AspectRatio>
getRequiredAspectRatios()
The required aspect ratios for the document to be accepted. final Unit
setRequiredAspectRatios(List<AspectRatio> requiredAspectRatios)
The required aspect ratios for the document to be accepted. final Boolean
getIgnoreBadAspectRatio()
Determines whether a landscape document will be detected when the camera is in portrait mode (and vice versa) or not. final Unit
setIgnoreBadAspectRatio(Boolean ignoreBadAspectRatio)
Determines whether a landscape document will be detected when the camera is in portrait mode (and vice versa) 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()
final static DocumentScannerCameraConfiguration
default()
-
-
Constructor Detail
-
DocumentScannerCameraConfiguration
DocumentScannerCameraConfiguration(JSONObject json)
-
DocumentScannerCameraConfiguration
DocumentScannerCameraConfiguration(CameraModule cameraModule, Double defaultZoomFactor, Boolean flashEnabled, Boolean minFocusDistanceLock, Boolean touchToFocusEnabled, Boolean pinchToZoomEnabled, CameraPreviewMode cameraPreviewMode, CapturePhotoQualityPrioritization captureQualityPrioritization, Double acceptedAngleScore, Double acceptedSizeScore, Double autoSnappingSensitivity, Integer autoSnappingDelay, Integer acceptedBrightnessThreshold, Boolean autoSnappingEnabled, List<AspectRatio> requiredAspectRatios, Boolean ignoreBadAspectRatio, 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
-
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
-
getAcceptedAngleScore
final Double getAcceptedAngleScore()
The minimum pitch/skew angle of the document to be accepted. The value must be between 0.0 and 1.0. Default is 0.75
-
setAcceptedAngleScore
final Unit setAcceptedAngleScore(Double acceptedAngleScore)
The minimum pitch/skew angle of the document to be accepted. The value must be between 0.0 and 1.0. Default is 0.75
-
getAcceptedSizeScore
final Double getAcceptedSizeScore()
The minimum size of the document in relation to the screen preview to be accepted. The value must be between 0.0 and 1.0. Default is 0.75
-
setAcceptedSizeScore
final Unit setAcceptedSizeScore(Double acceptedSizeScore)
The minimum size of the document in relation to the screen preview to be accepted. The value must be between 0.0 and 1.0. Default is 0.75
-
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
-
getAcceptedBrightnessThreshold
final Integer getAcceptedBrightnessThreshold()
The minimum brightness value to accept a detected document. Default is 50
-
setAcceptedBrightnessThreshold
final Unit setAcceptedBrightnessThreshold(Integer acceptedBrightnessThreshold)
The minimum brightness value to accept a detected document. Default is 50
-
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
-
getRequiredAspectRatios
final List<AspectRatio> getRequiredAspectRatios()
The required aspect ratios for the document to be accepted.
-
setRequiredAspectRatios
final Unit setRequiredAspectRatios(List<AspectRatio> requiredAspectRatios)
The required aspect ratios for the document to be accepted.
-
getIgnoreBadAspectRatio
final Boolean getIgnoreBadAspectRatio()
Determines whether a landscape document will be detected when the camera is in portrait mode (and vice versa) or not. This parameter will be ignored if required aspect ratios have been explicitly defined. Default is true
-
setIgnoreBadAspectRatio
final Unit setIgnoreBadAspectRatio(Boolean ignoreBadAspectRatio)
Determines whether a landscape document will be detected when the camera is in portrait mode (and vice versa) or not. This parameter will be ignored if required aspect ratios have been explicitly defined. 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()
-
default
final static DocumentScannerCameraConfiguration default()
-
-
-
-