Label Capture Basic Overlay

Defined in package com.scandit.datacapture.label.ui

LabelOverlayStyle

Added in version 8.6.0

Selects which label capture overlay a LabelCaptureView composable renders. Pass it to the LabelCaptureView composable from Compose Multiplatform to choose the overlay style declaratively.

Basic

Added in version 8.6.0

Renders the basic overlay (LabelCaptureBasicOverlay).

Advanced

Added in version 8.6.0

Renders the advanced overlay (LabelCaptureAdvancedOverlay).

ValidationFlow

Added in version 8.6.0

Renders the validation-flow overlay (LabelCaptureValidationFlowOverlay).

AdaptiveRecognition

Added in version 8.6.0

Renders the adaptive-recognition overlay.

LabelCaptureBasicOverlay
class LabelCaptureBasicOverlay : DataCaptureOverlay

Added in version 8.6.0

Overlay for label capture that provides visual feedback and customization capabilities for the scanning process. This overlay displays captured labels and their fields on top of the camera preview, offering extensive customization options through listener interfaces.

Key visualization features:

  • Label highlighting - Configurable visual feedback for detected labels

  • Field state indication - Different visual styles for predicted vs. captured fields

  • Custom brush configuration - Fully customizable appearance for labels and fields

  • Listener-based customization - Programmatic control over field appearances

The overlay distinguishes between different field states:

  • Predicted fields - Fields that have been detected but not yet captured

  • Captured fields - Fields that have been successfully scanned and validated

Advanced customization is available through LabelCaptureBasicOverlayListener, allowing dynamic styling based on field content, validation status, or other contextual information.,

withLabelCaptureForView(labelCapture, view)
fun LabelCaptureBasicOverlay.withLabelCaptureForView(labelCapture: LabelCapture,
        view: DataCaptureView?): LabelCaptureBasicOverlay

Added in version 8.6.0

Constructs a new overlay to visualize the process of label capture. When view is non-null, the overlay is automatically added to the view. Otherwise, the overlay needs to be added through a call to DataCaptureView.addOverlay().

withLabelCapture(labelCapture)
fun LabelCaptureBasicOverlay.withLabelCapture(labelCapture: LabelCapture): LabelCaptureBasicOverlay

Added in version 8.6.0

Creates a new overlay for the provided mode.

listener
var listener: LabelCaptureBasicOverlayListener?

Added in version 8.6.0

setBrushForField(brush, field, label)
fun setBrushForField(brush: Brush,
        field: LabelField,
        label: CapturedLabel)

Added in version 8.6.0

Sets a custom brush to visually highlight a specific field within a captured label. This allows for dynamic styling based on field content, validation status, or other contextual information.

Use this method to provide visual feedback for specific fields, such as highlighting errors, successful captures, or fields requiring attention.

This method is thread-safe; it can be called from any thread. When listener is set to a non-null instance, the listener continues to be asked for the brush to use for this field whenever the state changes, thereby replacing any brushes set by calling setBrushForField().

setBrushForLabel(brush, label)
fun setBrushForLabel(brush: Brush,
        label: CapturedLabel)

Added in version 8.6.0

Sets a custom brush to visually highlight a specific captured label. This allows for dynamic styling of entire labels based on their completion status, validation results, or other contextual information.

Use this method to provide visual feedback for labels, such as highlighting complete vs. incomplete labels, or marking labels that require validation. This method is thread-safe; it can be called from any thread.

When listener is set to a non-null instance, the listener continues to be asked for the brush to use for this label whenever the state of one its fields changes, thereby replacing any brushes set by calling setBrushForLabel().

defaultPredictedFieldBrush()
fun LabelCaptureBasicOverlay.defaultPredictedFieldBrush(): Brush

Added in version 8.6.0

The default brush applied to predicted fields. This is the brush used if LabelCaptureBasicOverlayListener is not set.

defaultCapturedFieldBrush()
fun LabelCaptureBasicOverlay.defaultCapturedFieldBrush(): Brush

Added in version 8.6.0

The default brush applied to captured fields. This is the brush used if LabelCaptureBasicOverlayListener is not set.

defaultLabelBrush()
fun LabelCaptureBasicOverlay.defaultLabelBrush(): Brush

Added in version 8.6.0

The default brush used for drawing labels. This brush is used when no listener is set, or the LabelCaptureBasicOverlayListener.brushForLabel() returns a null brush.

predictedFieldBrush
var predictedFieldBrush: Brush

Added in version 8.6.0

The brush applied to predicted fields if no LabelCaptureBasicOverlayListener is set.

capturedFieldBrush
var capturedFieldBrush: Brush

Added in version 8.6.0

labelBrush
var labelBrush: Brush

Added in version 8.6.0

shouldShowScanAreaGuides
var shouldShowScanAreaGuides: Boolean

Added in version 8.6.0

Controls whether scan area guides are displayed over the camera preview. These guides help visualize the active scanning regions during development and debugging.

This feature is intended for development purposes only and should not be enabled in production applications. By default this property is false.

viewfinder
var viewfinder: Viewfinder?

Added in version 8.6.0

The viewfinder used to guide users during the scanning process. The viewfinder provides visual cues about the optimal scanning area and helps users position labels correctly.

By default, no viewfinder is displayed. Set this to an instance of Viewfinder (such as RectangularViewfinder) to provide scanning guidance to users.