Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ScanSettings

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; codeDuplicateFilter: number; enabledSymbologies: SymbologyParameter; gpuAcceleration: boolean; maxNumberOfCodesPerFrame: number; searchArea: object }): ScanSettings
  • Create a ScanSettings instance.

    Parameters

    • Default value parameters: { blurryRecognition: boolean; codeDuplicateFilter: number; enabledSymbologies: SymbologyParameter; gpuAcceleration: boolean; maxNumberOfCodesPerFrame: number; searchArea: object } = {}
      • 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 decode/scan difficult codes.
      • 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.
      • enabledSymbologies: SymbologyParameter
        Default = []
        The single symbology or list/set of symbologies that should be initialized as enabled for recognition.
      • 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)).
      • maxNumberOfCodesPerFrame: number
        Default = 1
        The maximum number of barcodes to be recognized every frame.
      • searchArea: object
        Default = { x: 0, y: 0, width: 1.0, height: 1.0 }
        The area of the image in which barcodes are searched.
        • height: number
        • width: number
        • x: number
        • y: number

    Returns ScanSettings

Methods

disableSymbologies

  • disableSymbologies(symbology: SymbologyParameter): ScanSettings
  • Disable recognition of a symbology or list/set of symbologies.

    Parameters

    • symbology: SymbologyParameter

      The single symbology or list/set of symbologies to disable.

    Returns ScanSettings

    The updated ScanSettings object.

enableSymbologies

  • enableSymbologies(symbology: SymbologyParameter): ScanSettings
  • Enable recognition of a symbology or list/set of symbologies.

    Parameters

    • symbology: SymbologyParameter

      The single symbology or list/set of symbologies to enable.

    Returns ScanSettings

    The updated ScanSettings object.

getCodeDuplicateFilter

  • getCodeDuplicateFilter(): number
  • 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.

    Returns number

    The code duplicate filter value.

getMaxNumberOfCodesPerFrame

  • getMaxNumberOfCodesPerFrame(): number
  • Returns number

    The maximum number of barcodes to be recognized every 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

  • Returns SearchArea

    The area of the image in which barcodes are searched.

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
  • Returns boolean

    Whether blurry recognition is configured to be enabled ot not.

isGpuAccelerationEnabled

  • isGpuAccelerationEnabled(): boolean
  • Returns boolean

    Whether GPU acceleration is configured to be enabled ot not.

    Note that this refers to the settings: depending on browser capabilities the actual GPU usage might be prevented.

isSymbologyEnabled

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

    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 decode/scan difficult codes.

    Parameters

    • enabled: boolean

      Whether to enable or disable blurry recognition.

    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.

    Parameters

    • durationMilliseconds: number

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

    Returns ScanSettings

    The updated ScanSettings object.

setGpuAccelerationEnabled

  • Enable or disable GPU acceleration.

    Provide faster and more accurate barcode localization. The GPU can and will 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.

    Parameters

    • limit: number

      The new value (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

toJSONString

  • toJSONString(): string
  • Returns string

    The configuration object as a JSON string.

Generated using TypeDoc