DocumentScannerCustomUI

fun DocumentScannerCustomUI(modifier: <Error class: unknown class> = Modifier, cameraEnabled: Boolean = true, cameraModule: CameraModule = CameraModule.BACK, cameraPreviewMode: CameraPreviewMode = CameraPreviewMode.FILL_IN, touchToFocusEnabled: Boolean = false, torchEnabled: Boolean = false, snapAnimationEnabled: Boolean = true, zoomLevel: Float = 1.0f, documentScanningEnabled: Boolean = true, autoSnappingConfiguration: AutoSnappingConfiguration = AutoSnappingConfiguration(), documentScannerConfiguration: DocumentScannerConfiguration = DocumentScannerConfiguration(), finderConfiguration: FinderConfiguration? = null, arPolygonView: (<Error class: unknown class><Pair<DocumentDetectionResult, FrameHandler.Frame>?>) -> Unit = { _ -> }, permissionView: () -> Unit = {}, onTakePictureControllerCreated: (TakePictureActionController) -> Unit = {}, onDocumentScanningResult: (Result<DocumentDetectionResult>) -> Unit = {}, onTakePictureCalled: () -> Unit = {}, onTakePictureCanceled: () -> Unit = {}, onPictureSnapped: (ImageRef, CaptureInfo) -> Unit? = null, onAutoSnapping: () -> Boolean = { false })

Composable Document Scanner with customizable UI.

Parameters

modifier

Modifier to be applied to the scanner view.

cameraEnabled

Enables or disables the camera in the scanner.

cameraModule

Selects the camera module (front or back).

cameraPreviewMode

Sets the mode of the camera preview FIT_IN or FILL_IN.

touchToFocusEnabled

Enables touch to focus functionality.

torchEnabled

Enables or disables the torch (flashlight).

snapAnimationEnabled

Enables or disables snap animation (preview white flash) when picture is taken.

zoomLevel

Sets the zoom level of the camera (1.0 to 5.0 if supported by the device).

documentScanningEnabled

Enables or disables document detection process.

autoSnappingConfiguration

Configuration for the auto-snapping behavior. See AutoSnappingConfiguration.

documentScannerConfiguration

Configuration for the document scanner. All document scanning parameters, aspect ratios size ratios. etc. See DocumentScannerConfiguration.

finderConfiguration

Configuration for the finder overlay. See FinderConfiguration.

arPolygonView

Composable slot to display AR polygon view over the camera preview.

permissionView

Composable slot to display view when camera permission is not granted.

onDocumentScanningResult

Callback invoked each frame when document found. Provides DocumentDetectionResult.

onTakePictureControllerCreated

Callback invoked when TakePictureActionController is created. Use this controller to trigger picture taking manually.

onTakePictureCalled

Callback invoked when take picture action is called.

onTakePictureCanceled

Callback invoked when take picture action is canceled.

onPictureSnapped

Callback invoked when picture is taken successfully. Provides ImageRef and CaptureInfo.

onAutoSnapping

Callback that is called right before auto-snapping should be triggered. Return true to allow auto-snapping, false to prevent it.