Scandit.ScanSettings Class Reference

Classes

enum  CameraFacing
 
enum  RecognitionMode
 
enum  WorkingRange
 

Public Member Functions

SymbologySettings getSymbologySettings (Scandit.Barcode.Symbology symbology)
 
void setSymbologyEnabled (int symbology, boolean enabled)
 

Public Attributes

RecognitionMode recognitionMode
 
boolean highDensityModeEnabled
 
String deviceName
 
HashMap< Barcode.Symbology,
SymbologySettings
symbologies
 
CameraFacing cameraFacingPreference
 
number relativeZoom
 
int maxNumberOfCodesPerFrame
 
boolean codeRejectionEnabled
 
Rect activeScanningAreaPortrait
 
Rect activeScanningAreaLandscape
 
Point scanningHotSpot
 
boolean matrixScanEnabled
 
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

Possible recognition modes.

Class Members
TEXT Text recognition.
CODE Barcode/2d code recognition.
CODE_AND_TEXT Barcode/2d code recognition and text recognition.
enum Scandit::ScanSettings::WorkingRange

Possible working ranges for the barcode picker.

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

Member Data Documentation

int workingRange

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

When set to WorkingRange.WORKING_RANGE_STANDARD (the default), the focus is optimized for barcodes close to the camera. When set to WorkingRange.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

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.

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.

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.

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
ScanSession.rejectCode(Barcode)
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 (even if the BarcodePicker view is cropped). 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.

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 (even if the BarcodePicker view is cropped). 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.

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

boolean matrixScanEnabled

Whether MatrixScan should be enabled.

MatrixScan allows you to show the locations of all localized codes. In order to get MatrixScan, it is recommended to implement the didRecognizeNewCodes callback and to use newlyTrackedCodes. To use the default MatrixScan UI, it is necessary to set setGuiStyle() to ScanOverlay.GuiStyle.GUI_STYLE_MATRIX_SCAN. Implementing a custom MatrixScan UI is not possible.

TextRecognitionSettings textRecognition

Settings related to to text recognition.