Label Capture Basic Overlay

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

LabelCaptureBasicOverlay
class LabelCaptureBasicOverlay : DataCaptureOverlay

Added in version 6.0.0

Overlay for label capture that displays captured labels and their fields on top of the frames. When labels are successfully recognized, the label background as well as the fields are highlighted. Fields are highlighted using a default brush (capturedFieldBrush, predictedFieldBrush), a brush set through a user-defined LabelCaptureBasicOverlayListener or calls to setBrushForField().

newInstance(mode, view)
static @NonNull LabelCaptureBasicOverlay newInstance(
        @NonNull LabelCapture mode,
        @Nullable DataCaptureView view)

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().

listener
@Nullable LabelCaptureBasicOverlayListener getListener()
void setListener(@Nullable LabelCaptureBasicOverlayListener value)

Added in version 6.0.0

setBrushForField(brush, field, label)
void setBrushForField(@Nullable Brush brush,
        @NonNull LabelField field,
        @NonNull CapturedLabel label)

Added in version 6.0.0

The method can be called to change the visualization style of a field. 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)
void setBrushForLabel(@Nullable Brush brush,
        @NonNull CapturedLabel label)

Added in version 6.0.0

The method can be called to change the visualization style of a label. 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().

DEFAULT_PREDICTED_FIELD_BRUSH
static final @NonNull Brush DEFAULT_PREDICTED_FIELD_BRUSH

Added in version 6.4.0

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

Deprecated since version 6.10.1: Replaced by defaultPredictedFieldBrush().

defaultPredictedFieldBrush()
static Brush defaultPredictedFieldBrush()

Added in version 6.10.0

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

DEFAULT_CAPTURED_FIELD_BRUSH
static final @NonNull Brush DEFAULT_CAPTURED_FIELD_BRUSH

Added in version 6.4.0

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

Deprecated since version 6.10.1: Replaced by defaultCapturedFieldBrush().

defaultCapturedFieldBrush()
static Brush defaultCapturedFieldBrush()

Added in version 6.10.0

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

DEFAULT_LABEL_BRUSH
static final @NonNull Brush DEFAULT_LABEL_BRUSH

Added in version 6.4.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.

Deprecated since version 6.10.1: Replaced by defaultLabelBrush().

defaultLabelBrush()
static Brush defaultLabelBrush()

Added in version 6.10.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
@Nullable Brush getPredictedFieldBrush()
void setPredictedFieldBrush(@Nullable Brush value)

Added in version 6.4.0

The brush applied to predicted fields if no LabelCaptureBasicOverlayListener is set. By default this brush is set to DEFAULT_PREDICTED_FIELD_BRUSH.

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

capturedFieldBrush
@Nullable Brush getCapturedFieldBrush()
void setCapturedFieldBrush(@Nullable Brush value)

Added in version 6.4.0

The brush applied to captured fields if no LabelCaptureBasicOverlayListener is set. By default this brush is set to DEFAULT_CAPTURED_FIELD_BRUSH.

labelBrush
@Nullable Brush getLabelBrush()
void setLabelBrush(@Nullable Brush value)

Added in version 6.4.0

The brush used for drawing labels if no listener is set, or the LabelCaptureBasicOverlayListener.brushForLabel() returns a null brush. By default this brush is set to DEFAULT_LABEL_BRUSH.

defaultPredictedFieldBrush
@Nullable Brush getDefaultPredictedFieldBrush()
void setDefaultPredictedFieldBrush(@Nullable Brush value)

Added in version 6.0.0

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

Deprecated since version 6.4.0: Replaced by predictedFieldBrush.

defaultCapturedFieldBrush
@Nullable Brush getDefaultCapturedFieldBrush()
void setDefaultCapturedFieldBrush(@Nullable Brush value)

Added in version 6.0.0

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

Deprecated since version 6.4.0: Replaced by capturedFieldBrush.

defaultLabelBrush
@Nullable Brush getDefaultLabelBrush()
void setDefaultLabelBrush(@Nullable Brush value)

Added in version 6.0.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.

Deprecated since version 6.4.0: Replaced by labelBrush.

getFieldBrush(state)
@Nullable Brush getFieldBrush(LabelFieldState state)

Added in version 6.4.0

Returns the default brush to draw fields of the provided state. Valid values for state are LabelFieldState.PREDICTED and LabelFieldState.CAPTURED. See defaultPredictedFieldBrush, and defaultCapturedFieldBrush for details.

setFieldBrush(state, brush)
void setFieldBrush(LabelFieldState state,
        @Nullable Brush brush)

Added in version 6.4.0

Sets the default brush to draw fields of the provided state. Valid values for state are LabelFieldState.PREDICTED and LabelFieldState.CAPTURED. See defaultPredictedFieldBrush, and defaultCapturedFieldBrush for details.

getDefaultFieldBrush(state)
@Nullable Brush getDefaultFieldBrush(LabelFieldState state)

Added in version 6.0.0

Returns the default brush to draw fields of the provided state. Valid values for state are LabelFieldState.PREDICTED and LabelFieldState.CAPTURED. See defaultPredictedFieldBrush, and defaultCapturedFieldBrush for details.

Deprecated since version 6.4.0: Replaced by getFieldBrush().

setDefaultFieldBrush(state, brush)
void setDefaultFieldBrush(LabelFieldState state,
        @Nullable Brush brush)

Added in version 6.0.0

Sets the default brush to draw fields of the provided state. Valid values for state are LabelFieldState.PREDICTED and LabelFieldState.CAPTURED. See defaultPredictedFieldBrush, and defaultCapturedFieldBrush for details.

Deprecated since version 6.4.0: Replaced by setFieldBrush().

shouldShowScanAreaGuides
boolean getShouldShowScanAreaGuides()
void setShouldShowScanAreaGuides(boolean value)

Added in version 6.0.0

Whether to show scan area guides on top of the preview. This property is useful during development to visualize the current scan areas on screen. It is not meant to be used for production. By default this property is false.

viewfinder
@Nullable Viewfinder getViewfinder()
void setViewfinder(@Nullable Viewfinder value)

Added in version 6.8.0

Sets the viewfinder. By default, the viewfinder is null. Set this to an instance of Viewfinder if you want to draw a viewfinder.