Options
All
  • Public
  • Public/Protected
  • All
Menu

A configuration object for scanning options.

Modified ScanSettings need to be applied to a scanner via BarcodePicker.applyScanSettings or Scanner.applyScanSettings to take effect.

Hierarchy

  • ScanSettings

Index

Constructors

constructor

  • new ScanSettings(parameters?: { blurryRecognition?: boolean; codeDirectionHint?: CodeDirection; codeDuplicateFilter?: number; deviceName?: string; enabledSymbologies?: Symbology | Set<Symbology> | Symbology[]; gpuAcceleration?: boolean; maxNumberOfCodesPerFrame?: number; searchArea?: SearchArea }): ScanSettings
  • Create a ScanSettings instance.

    Parameters

    • parameters: { blurryRecognition?: boolean; codeDirectionHint?: CodeDirection; codeDuplicateFilter?: number; deviceName?: string; enabledSymbologies?: Symbology | Set<Symbology> | Symbology[]; gpuAcceleration?: boolean; maxNumberOfCodesPerFrame?: number; searchArea?: SearchArea } = ...
      • Optional blurryRecognition?: boolean
        Default = true
        Whether to enable/disable blurry recognition, to allow accurate scanning capabilities for out-of-focus (1D) codes. If enabled, more advanced algorithms are executed (and more resources/time is spent) every frame in order to successfully locate/scan difficult codes.
      • Optional codeDirectionHint?: CodeDirection
        Default = CodeDirection.LEFT_TO_RIGHT
        The code direction hint telling in what direction 1D codes are most likely orientated. More advanced algorithms are executed (and more resources/time is spent) every frame in order to successfully locate/scan difficult codes for each of the possible directions resulting by the direction hint. Note that this results in slow performance for `none` hints, average performance for `horizontal` and `vertical` hints and fast performance for the remaining hints.
      • Optional codeDuplicateFilter?: number
        Default = 0
        The duplicate filter specifying how often a code can be scanned. When the filter is set to -1, each unique code is only scanned once. When set to 0, duplicate filtering is disabled. Otherwise the duplicate filter specifies an interval in milliseconds. When the same code (data/symbology) is scanned within the specified interval it is filtered out as a duplicate.
      • Optional deviceName?: string
        Default = undefined
        The descriptive device name to identify the current device when looking at analytics tools.
      • Optional enabledSymbologies?: Symbology | Set<Symbology> | Symbology[]
        Default = []
        The single symbology or list/set of symbologies that should be initialized as enabled for recognition.
      • Optional gpuAcceleration?: boolean
        Default = true
        Whether to enable/disable GPU support via WebGL, to provide faster and more accurate barcode localization. The GPU can and will be used only if the browser also supports the needed technologies ([WebGL](https://caniuse.com/#feat=webgl) and [OffscreenCanvas](https://caniuse.com/#feat=offscreencanvas)).
      • Optional maxNumberOfCodesPerFrame?: number
        Default = 1
        The maximum number of barcodes to be recognized every frame.
      • Optional searchArea?: SearchArea
        Default = { x: 0, y: 0, width: 1.0, height: 1.0 }
        The area of the image in which barcodes are searched.

    Returns ScanSettings

Methods

disableSymbologies

  • Disable recognition of a symbology or list/set of symbologies.

    By default no symbologies are enabled.

    Parameters

    Returns ScanSettings

    The updated ScanSettings object.

enableSymbologies

  • Enable recognition of a symbology or list/set of symbologies.

    By default no symbologies are enabled.

    Parameters

    Returns ScanSettings

    The updated ScanSettings object.

getCodeDirectionHint

  • Get the code direction hint telling in what direction 1D codes are most likely orientated.

    By default left-to-right is used.

    Returns CodeDirection

    The code direction hint.

getCodeDuplicateFilter

  • getCodeDuplicateFilter(): number
  • Get the code duplicate filter value.

    By default duplicate filtering is disabled.

    Returns number

    The code duplicate filter value.

getDeviceName

  • getDeviceName(): undefined | string
  • Get the descriptive device name to identify the current device when looking at analytics tools.

    By default no name is used (the device is identified by its unique ID only).

    Returns undefined | string

    The device name.

getMaxNumberOfCodesPerFrame

  • getMaxNumberOfCodesPerFrame(): number
  • Get the maximum number of barcodes to be recognized every frame.

    By default the maximum number of barcodes per frame is 1.

    Returns number

    The maximum number of barcodes per frame.

getProperty

  • getProperty(key: string): number
  • Get a Scandit Engine library property.

    This function is for internal use only and any functionality that can be accessed through it can and will vanish without public notice from one version to the next. Do not call this function unless you specifically have to.

    Parameters

    • key: string

      The property name.

    Returns number

    The property value. For properties not previously set, -1 is returned.

getSearchArea

  • Get the area of the image in which barcodes are searched.

    By default the whole area is searched.

    Returns SearchArea

    The search area.

getSymbologySettings

  • Get the configuration object for a symbology (which can then be modified).

    Parameters

    • symbology: Symbology

      The symbology for which to retrieve the configuration.

    Returns SymbologySettings

    The symbology configuration object for the specified symbology.

isBlurryRecognitionEnabled

  • isBlurryRecognitionEnabled(): boolean
  • Get the blurry recognition enabled status.

    By default blurry recognition is enabled.

    Returns boolean

    Whether blurry recognition is configured to be enabled ot not.

isGpuAccelerationEnabled

  • isGpuAccelerationEnabled(): boolean
  • Get the GPU acceleration enabled status.

    By default GPU acceleration is enabled.

    Returns boolean

    Whether GPU acceleration is configured to be enabled ot not.

isSymbologyEnabled

  • isSymbologyEnabled(symbology: Symbology): boolean
  • Get the recognition enabled status for a symbology.

    By default no symbologies are enabled.

    Parameters

    • symbology: Symbology

      The symbology for which to retrieve the recognition enabled status.

    Returns boolean

    Whether the symbology enabled for recognition.

setBlurryRecognitionEnabled

  • setBlurryRecognitionEnabled(enabled: boolean): ScanSettings
  • Enable or disable blurry recognition.

    Allow accurate scanning capabilities for out-of-focus (1D) codes. If enabled, more advanced algorithms are executed (and more resources/time is spent) every frame in order to successfully locate/scan difficult codes.

    By default blurry recognition is enabled.

    Parameters

    • enabled: boolean

      Whether to enable or disable blurry recognition.

    Returns ScanSettings

    The updated ScanSettings object.

setCodeDirectionHint

  • Set the code direction hint telling in what direction 1D codes are most likely orientated.

    More advanced algorithms are executed (and more resources/time is spent) every frame in order to successfully locate/scan difficult codes for each of the possible directions resulting by the direction hint. Note that this results in slow performance for none hints, average performance for horizontal and vertical hints and fast performance for the remaining hints.

    By default left-to-right is used.

    Parameters

    Returns ScanSettings

    The updated ScanSettings object.

setCodeDuplicateFilter

  • setCodeDuplicateFilter(durationMilliseconds: number): ScanSettings
  • Set the code duplicate filter value.

    When the filter is set to -1, each unique code is only scanned once. When set to 0, duplicate filtering is disabled. Otherwise the duplicate filter specifies an interval in milliseconds.

    By default duplicate filtering is disabled.

    Parameters

    • durationMilliseconds: number

      The new value (-1, 0, or positive integer).

    Returns ScanSettings

    The updated ScanSettings object.

setDeviceName

  • setDeviceName(deviceName: undefined | string): ScanSettings
  • Set the descriptive device name to identify the current device when looking at analytics tools.

    By default no name is used (the device is identified by its unique ID only).

    Parameters

    • deviceName: undefined | string

      The new device name.

    Returns ScanSettings

    The updated ScanSettings object.

setGpuAccelerationEnabled

  • Enable or disable GPU acceleration.

    By default GPU acceleration is enabled.

    Provide faster and more accurate barcode localization. The GPU will in any case be used only if the browser also supports the needed technologies (WebGL and OffscreenCanvas).

    Parameters

    • enabled: boolean

      Whether to enable or disable GPU acceleration.

    Returns ScanSettings

    The updated ScanSettings object.

setMaxNumberOfCodesPerFrame

  • Set the maximum number of barcodes to be recognized every frame.

    By default the maximum number of barcodes per frame is 1.

    Parameters

    • limit: number

      The new maximum number of barcodes per frame alue (non-zero positive integer).

    Returns ScanSettings

    The updated ScanSettings object.

setProperty

  • Set a Scandit Engine library property.

    This function is for internal use only and any functionality that can be accessed through it can and will vanish without public notice from one version to the next. Do not call this function unless you specifically have to.

    Parameters

    • key: string

      The property name.

    • value: number

      The property value.

    Returns ScanSettings

    The updated ScanSettings object.

setSearchArea

  • Set the area of the image in which barcodes are searched.

    By default the whole area is searched.

    Parameters

    Returns ScanSettings

    The updated ScanSettings object.

toJSONString

  • toJSONString(): string
  • Returns string

    The configuration object as a JSON string.

Generated using TypeDoc