Class FinderDocumentScannerConfiguration
-
- All Implemented Interfaces:
public final class FinderDocumentScannerConfiguration
Class which is used to configure io.scanbot.sdk.ui.view.camera.DocumentScannerActivity Contains settings indicating views Behaviour, Texts and Appearance.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
FinderDocumentScannerConfiguration.Companion
-
Field Summary
Fields Modifier and Type Field Description private final FinderDocumentScannerJsonConfiguration
params
private final FinderDocumentScannerNativeConfiguration
nativeParams
public final static FinderDocumentScannerConfiguration.Companion
Companion
-
Constructor Summary
Constructors Constructor Description FinderDocumentScannerConfiguration()
-
Method Summary
Modifier and Type Method Description final FinderDocumentScannerJsonConfiguration
getParams()
final FinderDocumentScannerNativeConfiguration
getNativeParams()
final Unit
setPhotoQualityPrioritization(CapturePhotoQualityPrioritization value)
The prioritization of still image quality and capturing speed. final Unit
setImageFilterType(ImageFilterType imageFilterType)
Add default filtration for scanned document for given ImageFilterType. final Unit
setDelayAfterFocusCompleteMs(Long delay)
Delay that camera will took before snap on auto focus complete called from camera core in ms. final Unit
setAutoSnappingEnabled(Boolean autoSnappingEnabled)
When auto-snapping is enabled the document scanner will take a photo automatically when a document is detected, conditions are good and the auto-snapping time-out elapses. final Unit
setFlashEnabled(Boolean flashEnabled)
Controls whether the flash should be initially enabled. final Unit
setFinderAspectRatio(AspectRatio finderAspectRatio)
Aspect ratio of the finder window. final Unit
setFinderLineWidth(Integer finderLineWidth)
Thickness of the finder window's outline in Px. final Unit
setFinderLineColor(Integer finderLineColor)
Color of the finder window's outline. final Unit
setCameraOverlayColor(Integer cameraOverlayColor)
Background color outside of the finder window. final Unit
setAutoSnappingSensitivity(Float autoSnappingSensitivity)
Controls the auto-snapping speed. final Unit
setCameraPreviewMode(CameraPreviewMode cameraPreviewMode)
Preview mode of the camera: Fit-In or Fill-In. final Unit
setOrientationLockMode(CameraOrientationMode cameraOrientationMode)
Orientation lock mode of the camera: PORTRAIT or LANDSCAPE. final Unit
setCameraModule(CameraModule cameraModule)
Set supported camera module: CameraModule.BACK, CameraModule.FRONT or others. final Unit
enableHardwareSnapButton(Integer key)
Enable pressing hardware button to make snap on this screen. final Unit
setIgnoreBadAspectRatio(Boolean ignoreBadAspectRatio)
Sets whether to ignore the DetectionResult. final Unit
setAcceptedAngleScore(Double acceptedAngleScore)
The minimum score in percent (0 - 100) of the perspective distortion to accept a detected document. final Unit
setAcceptedSizeScore(Double acceptedSizeScore)
The minimum document width or height in percent (0 - 100) of the screen size to accept a detected document. final Unit
setAcceptedBrightnessThreshold(Double acceptedBrightnessThreshold)
The brightness threshold to accept a detected document in the range of 0 (very dark) to 255 (very bright). final Unit
setImageScale(Float imageScale)
The image scaling factor. final Unit
setDocumentImageSizeLimit(Integer documentImageHeightLimit, Integer documentImageWidthLimit)
Document image size limit. final Unit
setPolygonColor(Integer polygonColor)
The color of the detected document outline when the document's angle, size or aspect ratio is not yet sufficiently good. final Unit
setPolygonColorOK(Integer polygonColorOK)
The color of the detected document outline when we are ready to snap io.scanbot.sdk.core.contourdetector.DetectionStatus. final Unit
setPolygonLineWidth(Integer polygonLineWidth)
Width of the detected document outline in Px. final Unit
setAutoSnapProgressColor(Integer polygonAutoSnapProgressColor)
The color of the outline progress animation before the snap being taken after the successful document detection io.scanbot.sdk.core.contourdetector.DetectionStatus. final Unit
setAutoSnapProgressLineWidth(Integer polygonProgressLineWidth)
Width of the document autoSnap animation outline in Px. final Unit
setAutoSnapProgressEnabled(Boolean enabled)
Enable/disable autoSnap progress animation. final Unit
setPolygonCornerRadius(Integer polygonCornerRadius)
Radius of corners of the detected document outline. final Unit
setPolygonBackgroundColor(Integer polygonBackgroundColor)
The background color of the detected document outline when the document's angle, size or aspect ratio is not yet sufficiently good. final Unit
setPolygonBackgroundColorOK(Integer polygonBackgroundColorOK)
The background color of the detected document outline when we are ready to snap io.scanbot.sdk.core.contourdetector.DetectionStatus. final Unit
setDrawPolygonShadows(Boolean drawPolygonShadows)
Draw shadows under polygon stroke if polygon background color is transparent. final Unit
setShutterButtonAutoOuterColor(Integer shutterButtonAutoOuterColor)
The background color of the shutter button in auto-snapping mode. final Unit
setShutterButtonAutoInnerColor(Integer shutterButtonAutoInnerColor)
The foreground color of the shutter button in auto-snapping mode. final Unit
setShutterButtonManualOuterColor(Integer shutterButtonManualOuterColor)
The background color of the shutter button in manual mode. final Unit
setShutterButtonManualInnerColor(Integer shutterButtonManualInnerColor)
The foreground color of the shutter button in manual mode. final Unit
setShutterSoundEnabled(Boolean shutterSoundEnabled)
Set camera shutter sound state. final Unit
setUserGuidanceBackgroundColor(Integer userGuidanceBackgroundColor)
The background color of the user guidance hints. final Unit
setUserGuidanceTextColor(Integer userGuidanceTextColor)
The text color of the user guidance hints. final Unit
setTopBarBackgroundColor(Integer topBarBackgroundColor)
The background color of the top toolbar. final Unit
setTopBarButtonsActiveColor(Integer topBarButtonsActiveColor)
The color of all active toggle buttons in the toolbar. final Unit
setTopBarButtonsInactiveColor(Integer topBarButtonsInactiveColor)
The color of all inactive toggle buttons in the toolbar. final Unit
setCameraBackgroundColor(Integer cameraBackgroundColor)
The color of the camera background (relevant only when the camera preview mode is CameraPreviewMode.FIT_IN). final Unit
setFlashButtonHidden(Boolean flashButtonHidden)
Controls whether the flash toggle button is hidden or not. final Unit
setShutterButtonHidden(Boolean shutterButtonHidden)
Controls whether the shutter button is hidden or not. final Unit
setCancelButtonTitle(String cancelButtonTitle)
Title of the cancel button. final Unit
setTextHintOK(String textHintOK)
Text hint that will be shown when the current detection status is io.scanbot.sdk.core.contourdetector.DetectionStatus. final Unit
setTextHintTooSmall(String textHintTooSmall)
Text hint that will be shown when the current detection status is io.scanbot.sdk.core.contourdetector.DetectionStatus. final Unit
setTextHintBadAngles(String textBadAngles)
Text hint that will be shown when the current detection status is io.scanbot.sdk.core.contourdetector.DetectionStatus. final Unit
setTextHintBadAspectRatio(String textHintBadAspectRatio)
Text hint that will be shown when the current detection status is io.scanbot.sdk.core.contourdetector.DetectionStatus. final Unit
setTextHintNothingDetected(String textHintNothingDetected)
Text hint that will be shown when the current detection status is io.scanbot.sdk.core.contourdetector.DetectionStatus. final Unit
setTextHintTooNoisy(String textHintTooNoisy)
Text hint that will be shown when the current detection status is io.scanbot.sdk.core.contourdetector.DetectionStatus. final Unit
setTextHintOffCenter(String textHintOffCenter)
Text hint that will be shown when the current detection status is io.scanbot.sdk.core.contourdetector.DetectionStatus. final Unit
setTextHintTooDark(String textHintTooDark)
Text hint that will be shown when the current detection status is io.scanbot.sdk.core.contourdetector.DetectionStatus. final Unit
setEnableCameraExplanationText(String enableCameraExplanationText)
Text that will be displayed when the app is not allowed to use the camera, prompting the user to enable the usage of the camera. final Unit
setEnableCameraButtonTitle(String enableCameraButtonTitle)
Title of the button that opens the screen where the user can allow the usage of the camera by the app. final Unit
setUseButtonsAllCaps(Boolean allCaps)
Controls whether buttons should use all capitals style. final Unit
setAccessibilityConfiguration(FinderDocumentScannerAccessibilityConfiguration accessibilityConfiguration)
A configuration with accessibility texts settings. final Unit
setForceMaxSnappingSize(Boolean enabled)
Set whether camera should force maximum possible size of snapped picture or use maximum size that available with the same aspect ratio as preview by default set to false
This parameter works only withScanbotCameraXView
enabledfinal Unit
setForceUserGuidance(Boolean enabled)
Force of showing PolygonView and user guiding when autosnapping is disabled. final Unit
setPolygonEnabled(Boolean enabled)
Set whether polygon view should be enabled on the scanner or not. final Unit
setFinderEnabled(Boolean enabled)
Set whether finder view should be enabled on the scanner or not. final Unit
setLockDocumentAspectRatioToFinder(Boolean enabled)
Set scanning of documents with the aspect ratio that set to the finderAspectRatio parameter. final Unit
setTouchToFocusEnabled(Boolean enabled)
Controls whether the touch to focus feature should be enabled. -
-
Method Detail
-
getParams
final FinderDocumentScannerJsonConfiguration getParams()
-
getNativeParams
final FinderDocumentScannerNativeConfiguration getNativeParams()
-
setPhotoQualityPrioritization
final Unit setPhotoQualityPrioritization(CapturePhotoQualityPrioritization value)
The prioritization of still image quality and capturing speed. Defaults to CapturePhotoQualityPrioritization.BALANCED. If you experience lots of blurry still images try to set this property to CapturePhotoQualityPrioritization.QUALITY
-
setImageFilterType
final Unit setImageFilterType(ImageFilterType imageFilterType)
Add default filtration for scanned document for given ImageFilterType.
-
setDelayAfterFocusCompleteMs
final Unit setDelayAfterFocusCompleteMs(Long delay)
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.
-
setAutoSnappingEnabled
final Unit setAutoSnappingEnabled(Boolean autoSnappingEnabled)
When auto-snapping is enabled the document scanner will take a photo automatically when a document is detected, conditions are good and the auto-snapping time-out elapses. In this mode the user can still tap the shutter button to snap a document.
When auto-snapping is disabled, the user must manually take a photo by tapping the shutter button.
The default value is TRUE.
-
setFlashEnabled
final Unit setFlashEnabled(Boolean flashEnabled)
Controls whether the flash should be initially enabled. The default value is
false
.
-
setFinderAspectRatio
final Unit setFinderAspectRatio(AspectRatio finderAspectRatio)
Aspect ratio of the finder window.
-
setFinderLineWidth
final Unit setFinderLineWidth(Integer finderLineWidth)
Thickness of the finder window's outline in Px.
-
setFinderLineColor
final Unit setFinderLineColor(Integer finderLineColor)
Color of the finder window's outline.
-
setCameraOverlayColor
final Unit setCameraOverlayColor(Integer cameraOverlayColor)
Background color outside of the finder window.
-
setAutoSnappingSensitivity
final Unit setAutoSnappingSensitivity(Float autoSnappingSensitivity)
Controls the auto-snapping speed. Sensitivity must be within the 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 (2 seconds)
-
setCameraPreviewMode
final Unit setCameraPreviewMode(CameraPreviewMode cameraPreviewMode)
Preview mode of the camera: Fit-In or Fill-In. Default value is CameraPreviewMode.FILL_IN.
-
setOrientationLockMode
final Unit setOrientationLockMode(CameraOrientationMode cameraOrientationMode)
Orientation lock mode of the camera: PORTRAIT or LANDSCAPE. By default the camera orientation is not locked.
-
setCameraModule
final Unit setCameraModule(CameraModule cameraModule)
Set supported camera module: CameraModule.BACK, CameraModule.FRONT or others. Optional. By default is CameraModule.BACK.
-
enableHardwareSnapButton
final Unit enableHardwareSnapButton(Integer key)
Enable pressing hardware button to make snap on this screen. Pass KeyEvent.KEYCODE_VOLUME_DOWN or any other KeyEvent.KEYCODE that is supported by the device. By default for kotlin KeyEvent.KEYCODE_VOLUME_DOWN code being used.
-
setIgnoreBadAspectRatio
final Unit setIgnoreBadAspectRatio(Boolean ignoreBadAspectRatio)
Sets whether to ignore the DetectionResult.OK_BUT_BAD_ASPECT_RATIO detection status. Default value is
false
.
-
setAcceptedAngleScore
final Unit setAcceptedAngleScore(Double acceptedAngleScore)
The minimum score in percent (0 - 100) of the perspective distortion to accept a detected document. Default is
75.0
.
-
setAcceptedSizeScore
final Unit setAcceptedSizeScore(Double acceptedSizeScore)
The minimum document width or height in percent (0 - 100) of the screen size to accept a detected document. Default is 80.0.
-
setAcceptedBrightnessThreshold
final Unit setAcceptedBrightnessThreshold(Double acceptedBrightnessThreshold)
The brightness threshold to accept a detected document in the range of 0 (very dark) to 255 (very bright). If the average brightness value of the detectors input image is below this value, the status of the detection will be set to ERROR_TOO_DARK. Default is 50.0.
-
setImageScale
final Unit setImageScale(Float imageScale)
The image scaling factor. The factor must be within the 0..1 range. A factor of 1 means that the resulting images retain their original size. When the factor is less than 1, resulting images will be made smaller by that factor. By default the scale is 1.
-
setDocumentImageSizeLimit
final Unit setDocumentImageSizeLimit(Integer documentImageHeightLimit, Integer documentImageWidthLimit)
Document image size limit. Should be positives Ints. Means that if the document size will be bigger than a limit, then it will be downscaled with keeped aspectRatio. By default the limit is Int.MAX_VALUE, so there are no scaling.
-
setPolygonColor
final Unit setPolygonColor(Integer polygonColor)
The color of the detected document outline when the document's angle, size or aspect ratio is not yet sufficiently good. (All detection statuses in io.scanbot.sdk.core.contourdetector.DetectionStatus that have the OK_BUT_XXX prefix).
-
setPolygonColorOK
final Unit setPolygonColorOK(Integer polygonColorOK)
The color of the detected document outline when we are ready to snap io.scanbot.sdk.core.contourdetector.DetectionStatus.OK.
-
setPolygonLineWidth
final Unit setPolygonLineWidth(Integer polygonLineWidth)
Width of the detected document outline in Px.
-
setAutoSnapProgressColor
final Unit setAutoSnapProgressColor(Integer polygonAutoSnapProgressColor)
The color of the outline progress animation before the snap being taken after the successful document detection io.scanbot.sdk.core.contourdetector.DetectionStatus.OK.
-
setAutoSnapProgressLineWidth
final Unit setAutoSnapProgressLineWidth(Integer polygonProgressLineWidth)
Width of the document autoSnap animation outline in Px.
-
setAutoSnapProgressEnabled
final Unit setAutoSnapProgressEnabled(Boolean enabled)
Enable/disable autoSnap progress animation. If polygon enabled (see setPolygonEnabled) - progress will be shown on polygon. Otherwise - on the finder view. Default value is
true
.
-
setPolygonCornerRadius
final Unit setPolygonCornerRadius(Integer polygonCornerRadius)
Radius of corners of the detected document outline.
-
setPolygonBackgroundColor
final Unit setPolygonBackgroundColor(Integer polygonBackgroundColor)
The background color of the detected document outline when the document's angle, size or aspect ratio is not yet sufficiently good. (All io.scanbot.sdk.core.contourdetector.DetectionStatus with OK_BUT_XXX).
-
setPolygonBackgroundColorOK
final Unit setPolygonBackgroundColorOK(Integer polygonBackgroundColorOK)
The background color of the detected document outline when we are ready to snap io.scanbot.sdk.core.contourdetector.DetectionStatus.OK.
-
setDrawPolygonShadows
final Unit setDrawPolygonShadows(Boolean drawPolygonShadows)
Draw shadows under polygon stroke if polygon background color is transparent.
-
setShutterButtonAutoOuterColor
final Unit setShutterButtonAutoOuterColor(Integer shutterButtonAutoOuterColor)
The background color of the shutter button in auto-snapping mode.
-
setShutterButtonAutoInnerColor
final Unit setShutterButtonAutoInnerColor(Integer shutterButtonAutoInnerColor)
The foreground color of the shutter button in auto-snapping mode.
-
setShutterButtonManualOuterColor
final Unit setShutterButtonManualOuterColor(Integer shutterButtonManualOuterColor)
The background color of the shutter button in manual mode.
-
setShutterButtonManualInnerColor
final Unit setShutterButtonManualInnerColor(Integer shutterButtonManualInnerColor)
The foreground color of the shutter button in manual mode.
-
setShutterSoundEnabled
final Unit setShutterSoundEnabled(Boolean shutterSoundEnabled)
Set camera shutter sound state. {@code true} if a sound should be played when taking a picture, {@code false} - otherwise By default, the camera plays the system-defined camera shutter sound when taking a picture.
<p> Note that devices may not always allow disabling the camera shutter sound. If the shutter sound state cannot be set to the desired value, this value will be ignored. <p> This value is always {@code true} for pre-JELLY_BEAN_MR1- Parameters:
shutterSoundEnabled
- if shutter sound should be enabled
-
setUserGuidanceBackgroundColor
final Unit setUserGuidanceBackgroundColor(Integer userGuidanceBackgroundColor)
The background color of the user guidance hints.
-
setUserGuidanceTextColor
final Unit setUserGuidanceTextColor(Integer userGuidanceTextColor)
The text color of the user guidance hints.
-
setTopBarBackgroundColor
final Unit setTopBarBackgroundColor(Integer topBarBackgroundColor)
The background color of the top toolbar.
-
setTopBarButtonsActiveColor
final Unit setTopBarButtonsActiveColor(Integer topBarButtonsActiveColor)
The color of all active toggle buttons in the toolbar.
-
setTopBarButtonsInactiveColor
final Unit setTopBarButtonsInactiveColor(Integer topBarButtonsInactiveColor)
The color of all inactive toggle buttons in the toolbar.
-
setCameraBackgroundColor
final Unit setCameraBackgroundColor(Integer cameraBackgroundColor)
The color of the camera background (relevant only when the camera preview mode is CameraPreviewMode.FIT_IN).
-
setFlashButtonHidden
final Unit setFlashButtonHidden(Boolean flashButtonHidden)
Controls whether the flash toggle button is hidden or not.
-
setShutterButtonHidden
final Unit setShutterButtonHidden(Boolean shutterButtonHidden)
Controls whether the shutter button is hidden or not. If
true
- enable auto-snapping mode and hides the auto-snapping toggle button.
-
setCancelButtonTitle
final Unit setCancelButtonTitle(String cancelButtonTitle)
Title of the cancel button.
-
setTextHintOK
final Unit setTextHintOK(String textHintOK)
Text hint that will be shown when the current detection status is io.scanbot.sdk.core.contourdetector.DetectionStatus.OK.
-
setTextHintTooSmall
final Unit setTextHintTooSmall(String textHintTooSmall)
Text hint that will be shown when the current detection status is io.scanbot.sdk.core.contourdetector.DetectionStatus.OK_BUT_TOO_SMALL.
-
setTextHintBadAngles
final Unit setTextHintBadAngles(String textBadAngles)
Text hint that will be shown when the current detection status is io.scanbot.sdk.core.contourdetector.DetectionStatus.OK_BUT_BAD_ANGLES.
-
setTextHintBadAspectRatio
final Unit setTextHintBadAspectRatio(String textHintBadAspectRatio)
Text hint that will be shown when the current detection status is io.scanbot.sdk.core.contourdetector.DetectionStatus.OK_BUT_BAD_ASPECT_RATIO.
-
setTextHintNothingDetected
final Unit setTextHintNothingDetected(String textHintNothingDetected)
Text hint that will be shown when the current detection status is io.scanbot.sdk.core.contourdetector.DetectionStatus.ERROR_NOTHING_DETECTED.
-
setTextHintTooNoisy
final Unit setTextHintTooNoisy(String textHintTooNoisy)
Text hint that will be shown when the current detection status is io.scanbot.sdk.core.contourdetector.DetectionStatus.ERROR_TOO_NOISY.
-
setTextHintOffCenter
final Unit setTextHintOffCenter(String textHintOffCenter)
Text hint that will be shown when the current detection status is io.scanbot.sdk.core.contourdetector.DetectionStatus.OK_OFF_CENTER.
-
setTextHintTooDark
final Unit setTextHintTooDark(String textHintTooDark)
Text hint that will be shown when the current detection status is io.scanbot.sdk.core.contourdetector.DetectionStatus.ERROR_TOO_DARK.
-
setEnableCameraExplanationText
final Unit setEnableCameraExplanationText(String enableCameraExplanationText)
Text that will be displayed when the app is not allowed to use the camera, prompting the user to enable the usage of the camera.
-
setEnableCameraButtonTitle
final Unit setEnableCameraButtonTitle(String enableCameraButtonTitle)
Title of the button that opens the screen where the user can allow the usage of the camera by the app.
-
setUseButtonsAllCaps
final Unit setUseButtonsAllCaps(Boolean allCaps)
Controls whether buttons should use all capitals style.
-
setAccessibilityConfiguration
final Unit setAccessibilityConfiguration(FinderDocumentScannerAccessibilityConfiguration accessibilityConfiguration)
A configuration with accessibility texts settings.
-
setForceMaxSnappingSize
final Unit setForceMaxSnappingSize(Boolean enabled)
Set whether camera should force maximum possible size of snapped picture or use maximum size that available with the same aspect ratio as preview by default set to
false
This parameter works only withScanbotCameraXView
enabled
-
setForceUserGuidance
final Unit setForceUserGuidance(Boolean enabled)
Force of showing PolygonView and user guiding when autosnapping is disabled.
-
setPolygonEnabled
final Unit setPolygonEnabled(Boolean enabled)
Set whether polygon view should be enabled on the scanner or not.
-
setFinderEnabled
final Unit setFinderEnabled(Boolean enabled)
Set whether finder view should be enabled on the scanner or not.
-
setLockDocumentAspectRatioToFinder
final Unit setLockDocumentAspectRatioToFinder(Boolean enabled)
Set scanning of documents with the aspect ratio that set to the finderAspectRatio parameter.
Note: only works when setFinderAspectRatio called too.
-
setTouchToFocusEnabled
final Unit setTouchToFocusEnabled(Boolean enabled)
Controls whether the touch to focus feature should be enabled. Default is
true
.
-
-
-
-