Label Capture Basic Overlay
Defined in framework ScanditLabelCapture
- LabelCaptureBasicOverlay
open class LabelCaptureBasicOverlay : NSObject, DataCaptureOverlay
Added in version 6.0.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 LabelCaptureBasicOverlayDelegate, allowing dynamic styling based on field content, validation status, or other contextual information.,
Fields are highlighted using a default brush (capturedFieldBrush, predictedFieldBrush), a brush set through a user-defined LabelCaptureBasicOverlayDelegate or calls to setBrush().
- init
convenience init(labelCapture: LabelCapture, view: DataCaptureView?)
Added in version 6.0.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().
- init
convenience init(labelCapture: LabelCapture)
Added in version 6.0.0
Constructs a new overlay to visualize the process of label capture. The overlay needs to be added through a call to DataCaptureView.addOverlay().
- delegate
open weak var delegate: LabelCaptureBasicOverlayDelegate? { get, set }
Added in version 6.0.0
- setBrush
open func setBrush(_ brush: Brush, for field: LabelField, of label: CapturedLabel) ->
VoidAdded in version 6.0.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 delegate 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 setBrush().
- setBrush
open func setBrush(_ brush: Brush, for label: CapturedLabel) ->
VoidAdded in version 6.0.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 delegate 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 setBrush().
- defaultPredictedFieldBrush
open class var defaultPredictedFieldBrush: Brush { get }
Added in version 6.4.0
The default brush applied to predicted fields. This is the brush used if LabelCaptureBasicOverlayDelegate is not set.
- defaultCapturedFieldBrush
open class var defaultCapturedFieldBrush: Brush { get }
Added in version 6.4.0
The default brush applied to captured fields. This is the brush used if LabelCaptureBasicOverlayDelegate is not set.
- defaultLabelBrush
open class var defaultLabelBrush: Brush { get }
Added in version 6.4.0
The default brush used for drawing labels. This brush is used when no delegate is set, or the LabelCaptureBasicOverlayDelegate.labelCaptureBasicOverlay() returns a null brush.
- predictedFieldBrush
open var predictedFieldBrush: Brush { get, set }
Added in version 6.4.0
The brush applied to predicted fields if no LabelCaptureBasicOverlayDelegate is set. By default this brush is set to defaultPredictedFieldBrush.
The brush applied to predicted fields if no LabelCaptureBasicOverlayDelegate is set.
- capturedFieldBrush
open var capturedFieldBrush: Brush { get, set }
Added in version 6.4.0
The brush applied to captured fields if no LabelCaptureBasicOverlayDelegate is set. By default this brush is set to defaultCapturedFieldBrush.
- labelBrush
open var labelBrush: Brush { get, set }
Added in version 6.4.0
The brush used for drawing labels if no delegate is set, or the LabelCaptureBasicOverlayDelegate.labelCaptureBasicOverlay() returns a null brush. By default this brush is set to defaultLabelBrush.
- shouldShowScanAreaGuides
open var shouldShowScanAreaGuides:
Bool{ get, set }Added in version 6.0.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
open var viewfinder: (any Viewfinder)? { get, set }
Added in version 6.8.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.