DocumentCleanupCustomUI

fun DocumentCleanupCustomUI(image: ImageRef, modifier: <Error class: unknown class> = Modifier, documentCleanupConfiguration: DocumentCleanupConfiguration = DocumentCleanupConfiguration(), backgroundColor: <Error class: unknown class> = Color.Black, brushSize: <Error class: unknown class> = 40.dp, brushColor: <Error class: unknown class> = Color.Red, maxZoomScale: Float = DocConstants.maxZoomScale, onActionControllerCreated: (DocumentCleanupActionController) -> Unit = {}, onResultImageChanged: (ImageRef) -> Unit = {}, onError: (Result.Failure) -> Unit = {})

Composable Document Cleanup with customizable UI.

Renders the supplied image with mask-draw interaction backed by the Scanbot SDK Document Cleanup feature. Undo/redo/reset and the latest result are exposed via the DocumentCleanupActionController callback so the host UI is free to define its own top/bottom bars, sliders or other surrounding chrome.

Parameters

image

Input image to be cleaned up.

modifier

Modifier to be applied to the cleanup view.

documentCleanupConfiguration
backgroundColor

Background color behind the image canvas.

brushSize

Diameter of the drawing brush used to mark areas for cleanup.

brushColor

Color of the brush stroke preview while drawing.

maxZoomScale

Maximum zoom scale supported by the pinch-to-zoom gesture on the image.

onActionControllerCreated

Callback invoked when the DocumentCleanupActionController is created. Use this controller to trigger undo / redo / reset and to observe the current image and progress.

onResultImageChanged

Callback invoked every time a new cleaned image is produced (after a mask is applied, an undo, a redo or a reset). The provided ImageRef is owned by the composable and must not be closed by the caller.

onProgressChanged

Callback invoked whenever a heavy cleanup operation starts (true) or finishes (false). Use this to render a loading indicator or to disable interaction outside the composable while cleanup, undo, redo or reset is running.

onError

Callback invoked when the cleanup operation or the SDK setup fails.