Deprecation warning

Please note that this is outdated documentation for an older release of the Scandit Barcode Scanner SDK.

We are deprecating the 5.x API on all platforms (except Linux). Release 5.19 in April 2021 will be our final. Applications running 5.x will continue to work, and we will continue to release critical bug fixes and security patches only, for one year. We encourage you to migrate to 6.x and take advantage of our latest / advanced features and improved performance.

You'll find the updated documentation at: Data Capture SDK Documentation for Cordova

Scandit.ScanSettings Class Reference

Classes

enum  CameraFacing
 
enum  RecognitionMode
 
enum  WorkingRange
 

Public Member Functions

SymbologySettings getSymbologySettings (Barcode.Symbology symbology)
 
void setSymbologyEnabled (int symbology, boolean enabled)
 
void setProperty (String key, Object value)
 

Public Attributes

RecognitionMode recognitionMode
 
boolean highDensityModeEnabled
 
Rect activeScanningAreaPortrait
 
Rect activeScanningAreaLandscape
 
String deviceName
 
Boolean matrixScanEnabled
 
HashMap< Barcode.Symbology, SymbologySettingssymbologies
 
CameraFacing cameraFacingPreference
 
Point scanningHotSpot
 
number relativeZoom
 
int maxNumberOfCodesPerFrame
 
boolean codeRejectionEnabled
 
TextRecognitionSettings textRecognition
 
Working Range/Focus Control
int workingRange
 
Scan Session Configuration
int codeCachingDuration
 
int codeDuplicateFilter
 

Detailed Description

Settings to configure the decoding process.


Class Documentation

enum Scandit::ScanSettings::CameraFacing

Camera facing direction.

Class Members
BACK Facing away from the user.
FRONT Facing towards the user (Facetime camera).
enum Scandit::ScanSettings::RecognitionMode

The possible recognition modes.

Since
5.3.0
Class Members
TEXT Text recognition.
CODE Barcode/2d code recognition.
enum Scandit::ScanSettings::WorkingRange

The possible working ranges for the barcode picker.

Since
4.11.0
Class Members
STANDARD The camera tries to focus on barcodes which are close to the camera.

To scan far- away codes (30-40cm+), user must tap the screen. This is the default working range and works best for most use-cases. Only change the default value if you expect the users to often scan codes which are far away.

LONG The camera tries to focus on barcodes which are far from the camera.

This will make it easier to scan codes that are far away but degrade performance for very close codes.

Member Function Documentation

SymbologySettings getSymbologySettings ( Barcode.Symbology  symbology)

Retrieve symbology specific-settings.

Parameters
symbologythe symbology settings to retrieve
Returns
the symbology settings object, or null, if symbology is an invalid symbology.
Since
4.11.0
void setSymbologyEnabled ( int  symbology,
boolean  enabled 
)

Enable/disable decoding of a certain symbology.

This function provides a convenient shortcut to enabling/disabling decoding of a particular symbology without having to go through SymbologySettings.

Some 1d barcode symbologies allow you to encode variable-length data. By default, the Scandit BarcodeScanner SDK only scans barcodes in a certain length range. If your application requires scanning of one of these symbologies, and the length is falling outside the default range, you may need to adjust the SymbologySettings.activeSymbolCounts for this symbology. For details on defaults and how to calculate the symbol counts for each symbology, take a look at the barcode length page.

Parameters
symbologyThe symbology to be enabled.
enabledtrue when decoding of the symbology should be enabled, false if not.
Since
4.11.0
void setProperty ( String  key,
Object  value 
)

Sets a 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
keyThe property's name.
valueThe property's value.

Member Data Documentation

int workingRange

The working range tells the engine at which distance barcodes are to be expected.

When set to {} (the default), the focus is optimized for barcodes close to the camera. When set to { WORKING_RANGE_LONG}, the focus is optimized for far-away codes. When using non-standard working range, it is better to directly pass the working range when constructing the barcode picker, because the camera can already start to adjust the focus at an earlier point in time.

The working range hint is ignored on cameras with fixed-focus.

int codeCachingDuration

The duration (in milliseconds) for which barcodes are kept in the session.

When set to values larger than zero, the value is interpreted as milliseconds for which the barcodes should be kept in the session. If set to zero, barcodes are discarded before processing the next frame. Passing -1 will keep the codes for the duration of the scan session.

The default value is -1

int codeDuplicateFilter

The duration of the duplicate filter in milliseconds.

When set to values larger than zero, barcodes with the same symbology and data are filtered out if they are decoded less than the specified milliseconds apart. Set this value to zero, if you do not want to filter duplicates. When set to -1, barcodes are filtered as duplicates if they match an already decoded barcode in the session.

By default, the duplicate filter is set to 500ms

See also
codeCachingDuration
RecognitionMode recognitionMode

The recognition mode to use for the barcode picker.

Use this function to programmatically switch between text and barcode recognition. By default, barcode recognition is on (RecognitionMode.CODE).

boolean highDensityModeEnabled

High density mode enables phones to work at higher camera resolution, provided they support it.

When enabled, phones that are able to run the video preview at 1080p (1920x1080) will use 1080p and not just 720p (1280x720). High density mode gives better decode ranges at the expense of processing speed and allows to decode smaller code in the near range, or codes that further away.

By default, high density mode is disabled.

Rect activeScanningAreaPortrait

Sets the active scan area for portrait mode scanning.

By default, the barcode recognition engine searches the whole image for barcodes. Use this method to define the area in which barcodes are to be searched. Rectangle coordinates run from 0 to 1. The coordinates are relative to the whole camera preview frames and not the view in which the preview frames are displayed. When displaying the picker as a subview with an aspect ratio different from the camera image, it is generally a good idea to restrict the active scanning area to the visible part of the preview.

Since
4.11.0

Invoking this method with invalid rectangles, e.g. rectangles whose x, y, width or height attributes are outside the allowed range of 0.0-1.0 will have no effect.

Rect activeScanningAreaLandscape

Sets the active scan area for landscape mode scanning.

By default, the barcode recognition engine searches the whole image for barcodes. Use this method to define the area in which barcodes are to be searched. Rectangle coordinates run from 0 to 1. The coordinates are relative to the whole camera preview frames and not the view in which the preview frames are displayed. When displaying the picker as a subview with an aspect ratio different from the camera image, it is generally a good idea to restrict the active scanning area to the visible part of the preview.

Since
4.11.0

Invoking this method with invalid rectangles, e.g. rectangles whose top, left, right, or bottom attributes are outside the allowed range of 0.0-1.0, or rectangles with negative width/height will have no effect.

String deviceName

Sets the device name to identify the current device when looking at analytics tools.

Sends a request to the server to set this as soon as a connection is available.

Parameters
deviceNameA device name.
HashMap<Barcode.Symbology, SymbologySettings> symbologies

Hash containing the symbology settings for each available symbology.

CameraFacing cameraFacingPreference

The picker first gives preference to cameras of the specified direction.

When the device has no such camera, cameras of the opposite face are tried as well.

By default, the back-facing camera is preferred.

Since
4.11.0
Point scanningHotSpot

The location in the image where barcodes are decoded with the highest priority.

This variable shows a slightly different behavior depending on whether the full screen scanning is active or not. In Full screen scanning mode:

Sets the location in the image which is decoded with the highest priority when multiple barcodes are present in the image.

In restrictActiveScanningArea mode (activated with setting either {activeScanningAreaPortrait} or { ScanSettings.activeScanningAreaLandscape activeScanningAreaLandscape}): Changes the location of the spot where the barcode decoder actively scans for barcodes.

X and Y can be between 0 and 1, where 0/0 corresponds to the top left corner and 1/1 to the bottom right corner of the screen.

The default hotspot is centered on the image (0.5,0.5)

When setting the hot spot to values outside the allowed range, the hot spot value is ignored.

number relativeZoom

The percentage of the max zoom (between 0 and 1).

int maxNumberOfCodesPerFrame

Maximum number of codes to be decoded every frame.

The value is set to 1 if a negative value is supplied.

boolean codeRejectionEnabled

Whether code rejection is enabled.

Property indicating whether code rejection is enabled. This feature allows you to implement custom integrity checks for recognized barcodes by rejecting codes that don't satisfy additional criteria. By default, code rejection is disabled.

See also
{} 4.15.0
TextRecognitionSettings textRecognition

Settings to configure the text recognition.

Note that text recognition is not available in the default builds.