Package-level declarations Package

The text-recognition screen: a fragment that runs recognition on a page and shows the result, and the contract its host implements.

Types

ConfirmRestoreScope

interface ConfirmRestoreScope

A scope for RecognizedText onConfirmRestore parameter

ImageRect

data class ImageRect(val left: Float, val top: Float, val right: Float, val bottom: Float)

A rectangle in image coordinates, independent of any Android or Compose geometry type.

ReadFragment

class ReadFragment : Fragment

A androidx.fragment.app.Fragment to show and edit results of recognition

ReadHandler

interface ReadHandler

What a recognition screen needs from its host: the page to recognise, the progress to show, and where the resulting text is kept.

RecognizedStatus

sealed interface RecognizedStatus

What a recognition screen is currently doing, for driving its progress display.

Functions

RecognizedText

@Composable fun RecognizedText(modifier: Modifier = Modifier, picture: ScanPicture?, lookupRect: Rect?, lookupProgress: Int, originalText: ScanText, modifiedText: ScanText, zoomImageParams: ZoomImageParams = defaultZoomImageParams( scrollPadding = PaddingValues(0.dp) ), onCancel: () -> Unit = { }, onConfirmRestore: ConfirmRestoreScope.(List<CharSequence>) -> Unit = { }, onModifiedTextChanged: (ScanText) -> Unit = { }, onProgress: (RecognizedStatus) -> Unit = { }, emptyTextMessage: @Composable (modifier: Modifier) -> Unit)

Shows the recognised text over the page and lets the user correct it.

toImageRect

fun RectF.toImageRect(): ImageRect

Converts an Android RectF into an ImageRect.

Top