Class DocumentScannerCameraViewModel
-
- All Implemented Interfaces:
-
io.scanbot.sdk.ui.utils.Router,io.scanbot.sdk.ui.view.camera.ICameraView.ViewModel
public final class DocumentScannerCameraViewModel implements ICameraView.ViewModel, Router
ViewModel for DocumentScannerCameraView.
-
-
Field Summary
Fields Modifier and Type Field Description public final static DoubleDEFAULT_ACCEPTED_ANGLE_SCOREpublic final static DoubleDEFAULT_ACCEPTED_SIZE_SCOREprivate IntegerhardwareButtonKeyCodeprivate final <Error class: unknown class><Boolean>cameraOpenedprivate final <Error class: unknown class><Boolean>stopNewFramesprivate final <Error class: unknown class><Boolean>flashprivate final <Error class: unknown class><List<Page>>snappedPagesprivate final <Error class: unknown class><Boolean>autoSnappingprivate final <Error class: unknown class><DocumentDetectionStatus>detectionStatusprivate final <Error class: unknown class><Boolean>forceUserGuidanceprivate final <Error class: unknown class><List<AspectRatio>>requiredAspectRatioprivate final <Error class: unknown class><Boolean>shutterSoundEnabledprivate final <Error class: unknown class><Boolean>pictureProcessingprivate final <Error class: unknown class><Boolean>multiPageprivate final <Error class: unknown class><Boolean>ignoreOrientationMistmatchprivate BooleanshutterButtonHiddenprivate final <Error class: unknown class><Integer>snappedPagesCountprivate final <Error class: unknown class><ParametricFilter>parametricFilterprivate final <Error class: unknown class><Float>autosnapSensitivityprivate final <Error class: unknown class><Unit>snapEventprivate final DocumentScannerscanner
-
Constructor Summary
Constructors Constructor Description DocumentScannerCameraViewModel(DocumentScanner scanner, SaveTakenPictureUseCase saveTakenPictureUseCase, FilterDraftDocumentPageUseCase filterDraftDocumentPageUseCase, RemoveDraftPageUseCase removeDraftPageUseCase, FinalizePagesUseCase finalizePagesUseCase, IDispatchersProvider dispatchersProvider)
-
Method Summary
Modifier and Type Method Description IntegergetHardwareButtonKeyCode()UnitsetHardwareButtonKeyCode(Integer hardwareButtonKeyCode)<Error class: unknown class><Boolean>getCameraOpened()<Error class: unknown class><Boolean>getStopNewFrames()<Error class: unknown class><Boolean>getFlash()<Error class: unknown class><List<Page>>getSnappedPages()<Error class: unknown class><Boolean>getAutoSnapping()<Error class: unknown class><DocumentDetectionStatus>getDetectionStatus()<Error class: unknown class><Boolean>getForceUserGuidance()<Error class: unknown class><List<AspectRatio>>getRequiredAspectRatio()<Error class: unknown class><Boolean>getShutterSoundEnabled()<Error class: unknown class><Boolean>getPictureProcessing()<Error class: unknown class><Boolean>getMultiPage()<Error class: unknown class><Boolean>getIgnoreOrientationMistmatch()BooleangetShutterButtonHidden()UnitsetShutterButtonHidden(Boolean shutterButtonHidden)<Error class: unknown class><Integer>getSnappedPagesCount()<Error class: unknown class><ParametricFilter>getParametricFilter()<Error class: unknown class><Float>getAutosnapSensitivity()<Error class: unknown class><Unit>getSnapEvent()DocumentScannergetScanner()final Unitpause()UnitonCameraOpened()Camera has been opened. UnitonCancelClicked()User wants to cancel snapping. UnitonLicenseInvalid()License is now invalid. UnitonAutoSnappingClicked()User wants to change auto snapping mode. UnitonMultiPageClicked()User wants to change multi page mode. UnitonFlashClicked()User wants to change flash mode. UnitonSavePagesClicked()User wants to snapped pages. UnitonFinishCurrentState()Triggered when the signal to finish was received from outside. UnitpageSnapped(ByteArray image, CaptureInfo captureInfo)User have snapped an image. final UnitsetAutoSnappingEnabled(Boolean autoSnappingEnabled)Enables/Disables autosnapping final UnitsetForceUserGuidance(Boolean forceUserGuidance)Enables/Disables forceUserGuidance final UnitsetParametricFilter(ParametricFilter parametricFilter)Enables pages filtration for given ParametricFilter final UnitsetFlashEnabled(Boolean flashEnabled)Enables/Disables flash final UnitsetShutterSoundEnabled(Boolean shutterSoundEnabled)Set camera shutter sound state. final UnitsetMultiPageEnabled(Boolean multiPageEnabled)Enables/Disables multipage final UnitsetMaxNumberOfPages(Integer maxNumberOfPages)Set max number of scanned pages final UnitsetImageScale(Float imageScale)Sets imageScale final UnitsetDocumentImageSizeLimit(PageStorageProcessor.Configuration.Size documentImageSizeLimit)Sets documentImageSizeLimit final UnitsetAcceptedAngleScore(Double acceptedAngleScore)The minimum score in percent (0 - 100) of the perspective distortion to accept a detected document. final UnitsetAcceptedSizeScore(Double acceptedSizeScore)The minimum size in percent (0 - 100) of the screen size to accept a detected document. final UnitsetAcceptedBrightnessThreshold(Double acceptedBrightnessThreshold)The brightness threshold to accept a detected document in the range of 0 (very dark) to 255 (very bright). final UnitsetRequiredAspectRatio(List<AspectRatio> requiredAspectRatios)Set required AspectRatio. final UnitsetAutosnappingSensitivity(Float sensitivity)final BooleanonKeyEvent(Integer keyCode)UnitsetIgnoreOrientationMistmatch(Boolean ignoreOrientationMistmatch)Sets flag which enables/disables ignoreOrientationMismatch detection ignoring. UnitupdateScanningStatus(DocumentDetectionStatus status)Update status of polygon detection from document scanner. -
-
Constructor Detail
-
DocumentScannerCameraViewModel
DocumentScannerCameraViewModel(DocumentScanner scanner, SaveTakenPictureUseCase saveTakenPictureUseCase, FilterDraftDocumentPageUseCase filterDraftDocumentPageUseCase, RemoveDraftPageUseCase removeDraftPageUseCase, FinalizePagesUseCase finalizePagesUseCase, IDispatchersProvider dispatchersProvider)
-
-
Method Detail
-
getHardwareButtonKeyCode
Integer getHardwareButtonKeyCode()
-
setHardwareButtonKeyCode
Unit setHardwareButtonKeyCode(Integer hardwareButtonKeyCode)
-
getCameraOpened
<Error class: unknown class><Boolean> getCameraOpened()
-
getStopNewFrames
<Error class: unknown class><Boolean> getStopNewFrames()
-
getSnappedPages
<Error class: unknown class><List<Page>> getSnappedPages()
-
getAutoSnapping
<Error class: unknown class><Boolean> getAutoSnapping()
-
getDetectionStatus
<Error class: unknown class><DocumentDetectionStatus> getDetectionStatus()
-
getForceUserGuidance
<Error class: unknown class><Boolean> getForceUserGuidance()
-
getRequiredAspectRatio
<Error class: unknown class><List<AspectRatio>> getRequiredAspectRatio()
-
getShutterSoundEnabled
<Error class: unknown class><Boolean> getShutterSoundEnabled()
-
getPictureProcessing
<Error class: unknown class><Boolean> getPictureProcessing()
-
getMultiPage
<Error class: unknown class><Boolean> getMultiPage()
-
getIgnoreOrientationMistmatch
<Error class: unknown class><Boolean> getIgnoreOrientationMistmatch()
-
getShutterButtonHidden
Boolean getShutterButtonHidden()
-
setShutterButtonHidden
Unit setShutterButtonHidden(Boolean shutterButtonHidden)
-
getSnappedPagesCount
<Error class: unknown class><Integer> getSnappedPagesCount()
-
getParametricFilter
<Error class: unknown class><ParametricFilter> getParametricFilter()
-
getAutosnapSensitivity
<Error class: unknown class><Float> getAutosnapSensitivity()
-
getSnapEvent
<Error class: unknown class><Unit> getSnapEvent()
-
getScanner
DocumentScanner getScanner()
-
onCameraOpened
Unit onCameraOpened()
Camera has been opened.
-
onCancelClicked
Unit onCancelClicked()
User wants to cancel snapping.
-
onLicenseInvalid
Unit onLicenseInvalid()
License is now invalid.
-
onAutoSnappingClicked
Unit onAutoSnappingClicked()
User wants to change auto snapping mode.
-
onMultiPageClicked
Unit onMultiPageClicked()
User wants to change multi page mode.
-
onFlashClicked
Unit onFlashClicked()
User wants to change flash mode.
-
onSavePagesClicked
Unit onSavePagesClicked()
User wants to snapped pages.
-
onFinishCurrentState
Unit onFinishCurrentState()
Triggered when the signal to finish was received from outside.
-
pageSnapped
Unit pageSnapped(ByteArray image, CaptureInfo captureInfo)
User have snapped an image.
- Parameters:
image- snapped imagecaptureInfo- additional information about the picture
-
setAutoSnappingEnabled
final Unit setAutoSnappingEnabled(Boolean autoSnappingEnabled)
Enables/Disables autosnapping
-
setForceUserGuidance
final Unit setForceUserGuidance(Boolean forceUserGuidance)
Enables/Disables forceUserGuidance
-
setParametricFilter
final Unit setParametricFilter(ParametricFilter parametricFilter)
Enables pages filtration for given ParametricFilter
-
setFlashEnabled
final Unit setFlashEnabled(Boolean flashEnabled)
Enables/Disables flash
-
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
- Parameters:
shutterSoundEnabled- if shutter sound should be enabled
-
setMultiPageEnabled
final Unit setMultiPageEnabled(Boolean multiPageEnabled)
Enables/Disables multipage
-
setMaxNumberOfPages
final Unit setMaxNumberOfPages(Integer maxNumberOfPages)
Set max number of scanned pages
-
setImageScale
final Unit setImageScale(Float imageScale)
Sets imageScale
-
setDocumentImageSizeLimit
final Unit setDocumentImageSizeLimit(PageStorageProcessor.Configuration.Size documentImageSizeLimit)
Sets documentImageSizeLimit
-
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. Set lower values to accept more perspective distortion.
Warning: Lower values result in more blurred document images.
-
setAcceptedSizeScore
final Unit setAcceptedSizeScore(Double acceptedSizeScore)
The minimum size in percent (0 - 100) of the screen size to accept a detected document. It is sufficient that height or width match the score. Default is 80.0.
Warning: Lower values result in low resolution document images.
-
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). Default is 50.
-
setRequiredAspectRatio
final Unit setRequiredAspectRatio(List<AspectRatio> requiredAspectRatios)
Set required AspectRatio.
- Parameters:
requiredAspectRatios- for finder and detector
-
setAutosnappingSensitivity
final Unit setAutosnappingSensitivity(Float sensitivity)
-
onKeyEvent
final Boolean onKeyEvent(Integer keyCode)
-
setIgnoreOrientationMistmatch
Unit setIgnoreOrientationMistmatch(Boolean ignoreOrientationMistmatch)
Sets flag which enables/disables ignoreOrientationMismatch detection ignoring. Default value is
false.
-
updateScanningStatus
Unit updateScanningStatus(DocumentDetectionStatus status)
Update status of polygon detection from document scanner.
-
-
-
-