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 CameraModulecameraModuleprivate DoubledefaultZoomFactorprivate BooleanautoCropOnManualSnapprivate BooleanflashEnabledprivate BooleanminFocusDistanceLockprivate BooleantouchToFocusEnabledprivate BooleanpinchToZoomEnabledprivate CameraPreviewModecameraPreviewModeprivate CapturePhotoQualityPrioritizationcaptureQualityPrioritizationprivate DoubleacceptedAngleScoreprivate DoubleacceptedSizeScoreprivate DoubleautoSnappingSensitivityprivate IntegerautoSnappingDelayprivate IntegeracceptedBrightnessThresholdprivate BooleanautoSnappingEnabledprivate List<AspectRatio>requiredAspectRatiosprivate BooleanignoreBadAspectRatioprivate BooleancaptureWithHardwareButtonsEnabled
-
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 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 CameraModulegetCameraModule()Determines which camera module to use on start-up. final UnitsetCameraModule(CameraModule cameraModule)Determines which camera module to use on start-up. final DoublegetDefaultZoomFactor()The default zoom factor on start-up. final UnitsetDefaultZoomFactor(Double defaultZoomFactor)The default zoom factor on start-up. final BooleangetAutoCropOnManualSnap()Determines whether the document should be cropped automatically after a manual snap or not. final UnitsetAutoCropOnManualSnap(Boolean autoCropOnManualSnap)Determines whether the document should be cropped automatically after a manual snap or not. final BooleangetFlashEnabled()Determines whether the flashlight is enabled or not on start-up. final UnitsetFlashEnabled(Boolean flashEnabled)Determines whether the flashlight is enabled or not on start-up. final BooleangetMinFocusDistanceLock()Determines whether locking the focus at the minimum possible distance is enabled or not (device-specific). final UnitsetMinFocusDistanceLock(Boolean minFocusDistanceLock)Determines whether locking the focus at the minimum possible distance is enabled or not (device-specific). final BooleangetTouchToFocusEnabled()Determines whether touch-to-focus is enabled or not. final UnitsetTouchToFocusEnabled(Boolean touchToFocusEnabled)Determines whether touch-to-focus is enabled or not. final BooleangetPinchToZoomEnabled()Determines whether pinch-to-zoom is enabled or not. final UnitsetPinchToZoomEnabled(Boolean pinchToZoomEnabled)Determines whether pinch-to-zoom is enabled or not. final CameraPreviewModegetCameraPreviewMode()Determines which camera preview mode to use. final UnitsetCameraPreviewMode(CameraPreviewMode cameraPreviewMode)Determines which camera preview mode to use. final CapturePhotoQualityPrioritizationgetCaptureQualityPrioritization()Determines the prioritization of still image quality and capturing speed. final UnitsetCaptureQualityPrioritization(CapturePhotoQualityPrioritization captureQualityPrioritization)Determines the prioritization of still image quality and capturing speed. final DoublegetAcceptedAngleScore()The minimum pitch/skew angle of the document to be accepted. final UnitsetAcceptedAngleScore(Double acceptedAngleScore)The minimum pitch/skew angle of the document to be accepted. final DoublegetAcceptedSizeScore()The minimum size of the document in relation to the screen preview to be accepted. final UnitsetAcceptedSizeScore(Double acceptedSizeScore)The minimum size of the document in relation to the screen preview to be accepted. final DoublegetAutoSnappingSensitivity()Controls the auto snapping speed. final UnitsetAutoSnappingSensitivity(Double autoSnappingSensitivity)Controls the auto snapping speed. final IntegergetAutoSnappingDelay()After a page has been snapped, the delay in milliseconds before auto snapping resumes for the next page. final UnitsetAutoSnappingDelay(Integer autoSnappingDelay)After a page has been snapped, the delay in milliseconds before auto snapping resumes for the next page. final IntegergetAcceptedBrightnessThreshold()The minimum brightness value to accept a detected document. final UnitsetAcceptedBrightnessThreshold(Integer acceptedBrightnessThreshold)The minimum brightness value to accept a detected document. final BooleangetAutoSnappingEnabled()Determines if auto snapping is enabled or not. final UnitsetAutoSnappingEnabled(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 UnitsetRequiredAspectRatios(List<AspectRatio> requiredAspectRatios)The required aspect ratios for the document to be accepted. final BooleangetIgnoreBadAspectRatio()Determines whether a landscape document will be detected when the camera is in portrait mode (and vice versa) or not. final UnitsetIgnoreBadAspectRatio(Boolean ignoreBadAspectRatio)Determines whether a landscape document will be detected when the camera is in portrait mode (and vice versa) or not. final BooleangetCaptureWithHardwareButtonsEnabled()When enabled the hardware volume up/down buttons can be used to capture an image if manual snapping is enabled. final UnitsetCaptureWithHardwareButtonsEnabled(Boolean captureWithHardwareButtonsEnabled)When enabled the hardware volume up/down buttons can be used to capture an image if manual snapping is enabled. final JSONObjecttoJson()final static DocumentScannerCameraConfigurationdefault()-
-
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 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
-
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
-
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 (1 second). 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 (1 second). 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()
-
-
-
-