-
public final class CameraViewModel extends AndroidViewModel
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classCameraViewModel.Companion
-
Field Summary
Fields Modifier and Type Field Description private Function1<Float, Unit>rotateDrawViewCallbackprivate final LiveData<List<ScannedPage>>capturedImagesprivate StringaspectRatioprivate <ERROR CLASS>isRetakeprivate IntegerindexToReplaceprivate StateFlow<CornerPointStatus>autoCapturePromptStateprivate BooleanisAutoCaptureTimeoutprivate final StateFlow<Boolean>isDeleteInProgressprivate final <ERROR CLASS>showCaptureAnimationprivate final <ERROR CLASS>animationImageUriprivate final <ERROR CLASS>dialogContentprivate StringdocumentNameprivate final TfliteHelpertfliteHelperprivate final StateFlow<List<ButtonState>>buttonStates
-
Constructor Summary
Constructors Constructor Description CameraViewModel(Application application)
-
Method Summary
-
Methods inherited from class androidx.lifecycle.AndroidViewModel
addCloseable, addCloseable, addCloseable, getCloseable -
Methods inherited from class one.zoop.sdk.scanner.viewmodel.CameraViewModel
getApplication -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
CameraViewModel
CameraViewModel(Application application)
-
-
Method Detail
-
getRotateDrawViewCallback
final Function1<Float, Unit> getRotateDrawViewCallback()
-
setRotateDrawViewCallback
final Unit setRotateDrawViewCallback(Function1<Float, Unit> rotateDrawViewCallback)
-
getCapturedImages
final LiveData<List<ScannedPage>> getCapturedImages()
-
getAspectRatio
final String getAspectRatio()
-
setAspectRatio
final Unit setAspectRatio(String aspectRatio)
-
getIsRetake
final <ERROR CLASS> getIsRetake()
-
setIsRetake
final Unit )>setIsRetake(<ERROR CLASS> isRetake)
-
getIndexToReplace
final Integer getIndexToReplace()
-
setIndexToReplace
final Unit setIndexToReplace(Integer indexToReplace)
-
getAutoCapturePromptState
final StateFlow<CornerPointStatus> getAutoCapturePromptState()
-
setAutoCapturePromptState
final Unit setAutoCapturePromptState(StateFlow<CornerPointStatus> autoCapturePromptState)
-
getIsAutoCaptureTimeout
final Boolean getIsAutoCaptureTimeout()
-
setIsAutoCaptureTimeout
final Unit setIsAutoCaptureTimeout(Boolean isAutoCaptureTimeout)
-
getIsDeleteInProgress
final StateFlow<Boolean> getIsDeleteInProgress()
-
getShowCaptureAnimation
final <ERROR CLASS> getShowCaptureAnimation()
-
getAnimationImageUri
final <ERROR CLASS> getAnimationImageUri()
-
getDialogContent
final <ERROR CLASS> getDialogContent()
-
getDocumentName
final String getDocumentName()
-
setDocumentName
final Unit setDocumentName(String documentName)
-
getTfliteHelper
final TfliteHelper getTfliteHelper()
-
getButtonStates
final StateFlow<List<ButtonState>> getButtonStates()
-
startCaptureAnimation
final Unit startCaptureAnimation(Uri imageUri)
-
endCaptureAnimation
final Unit endCaptureAnimation()
-
toggleButtonState
final Unit toggleButtonState(String id, NavHostController navController)
-
saveDrawViewState
final Unit saveDrawViewState(Integer pageIndex, DrawViewState state)
-
getDrawViewState
final DrawViewState getDrawViewState(Integer pageIndex)
-
setScanName
final Unit setScanName(String documentName)
-
getImageAnalyzer
final ImageAnalysis getImageAnalyzer()
-
setCameraController
final Unit setCameraController(CameraControl cameraControl)
-
setCameraInfo
final Unit setCameraInfo(CameraInfo cameraInfo)
-
changeAutoCapturePromptState
final Unit changeAutoCapturePromptState(CornerPointStatus cornerPointStatus)
-
setRetakeValue
final Unit setRetakeValue(Boolean isRetake)
-
addScannedPage
final Unit addScannedPage(ScannedPage newScannedPage)
-
deleteAllScannedPage
final Unit deleteAllScannedPage()
-
setCallback
final Unit setCallback(ScannerResultCallback scannerResultCallback)
-
updateCroppedPage
final Unit updateCroppedPage(List<PointF> correctedPoints, String processedPath, Integer index)
-
replaceScannedPage
final Unit replaceScannedPage(ScannedPage newScannedPage, Integer indexToReplace, Boolean isRetake)
-
rotateScannedPage
final Unit rotateScannedPage(Float rotation, Integer index)
-
deleteScannedPage
final Unit deleteScannedPage(Integer index)
-
getExifRotationFromImagePath
final Integer getExifRotationFromImagePath(String imagePath)
-
getCurrentScannedPage
final ScannedPage getCurrentScannedPage(Integer index)
-
addCroppedImageToScannedPage
final Unit addCroppedImageToScannedPage(Uri uri, String processedUri, List<PointF> corners)
-
reRunInference
final Unit reRunInference(Uri uri, Bitmap rotatedBitmap, Context context, Array<PointF> autoCaptureCorners, Function2<List<PointF>, String, Unit> onCornersDetected)
-
getFilePath
final String getFilePath()
-
saveBtnCallback
final Unit saveBtnCallback(Function0<Unit> onFinish)
-
sendErrorToActivity
final Unit sendErrorToActivity(String errorCode, String errorMessage)
-
getImageCapture
final ImageCapture getImageCapture()
-
saveBitmapAsPng
final Boolean saveBitmapAsPng(Bitmap bitmap, File file)
-
setImageCapture
final Unit setImageCapture(ImageCapture imageCapture)
-
setImageAnalyzer
final Unit setImageAnalyzer(ImageAnalysis imageAnalyzer)
-
onZoomChange
final Unit onZoomChange(Float zoomFactor)
-
onFocus
final Unit onFocus(Float x, Float y, PreviewView previewView)
-
processGalleryImages
final Unit processGalleryImages(List<Uri> selectedUris, Boolean isMultiImage, String filenameFormat, File outputDirectory, Function0<Unit> onImageCaptured, Function1<ImageCaptureException, Unit> onError, Double screenHeight, Double screenWidth, Array<PointF> corners, Context context)
-
adjustCorners
final Array<PointF> adjustCorners(Array<PointF> corners, Double scaleFactorWidth, Double scaleFactorHeight)
-
takePhoto
final Unit takePhoto(String filenameFormat, File outputDirectory, Function1<Object, Unit> onImageCaptured, Function1<ImageCaptureException, Unit> onError, Double screenHeight, Double screenWidth, Array<PointF> corners, Context context)
-
deleteImageFromUri
final Boolean deleteImageFromUri(Uri uri)
Deletes an image file from the given URI path.
- Parameters:
uri- The URI pointing to the image file to delete.
-
getBitmapFromUri
final Bitmap getBitmapFromUri(Context context, Uri uri)
-
deleteImageFromFilePath
final Boolean deleteImageFromFilePath(String filePath)
Deletes an image file from the given file path.
- Parameters:
filePath- The path of the file to delete.
-
areArraysEqualWithThreshold
final Boolean areArraysEqualWithThreshold(List<PointF> arr1, List<PointF> arr2, Float threshold)
-
getOutputDirectory
final File getOutputDirectory(Context context)
-
processOcrRequest
final Map<String, Object> processOcrRequest(String filePathFront, String filePathBack, OcrMode ocrMode)
Process Ocr Request via API call as per
ocrMode- Parameters:
ocrMode- : enum type to specify the ocr mode
-
initiateCrop
final String initiateCrop(Uri uriRawImagePath, Double imageHeight, Double imageWidth, Array<PointF> srcPoints, Context context)
-
-
-
-