SBSScanSettings Class Reference

Inherits NSObject, and <NSCopying>.

Instance Methods

(void) - enableSymbologies:
 
(void) - setSymbology:enabled:
 
(nonnull NSSet< NSNumber * > *) - enabledSymbologies
 
(nonnull SBSSymbologySettings *) - settingsForSymbology:
 
(void) - setActiveScanningArea:
 
(void) - setProperty:toValue:
 
(int) - valueForProperty:
 

Class Methods

(nonnull instancetype) + defaultSettings
 
(nonnull instancetype) + pre47DefaultSettings
 
(nullable instancetype) + settingsWithDictionary:error:
 

Properties

SBSWorkingRange workingRange
 
BOOL force2dRecognition
 
NSInteger maxNumberOfCodesPerFrame
 
NSInteger codeDuplicateFilter
 
NSInteger codeCachingDuration
 
float relativeZoom
 
SBSCameraFacingDirection cameraFacingPreference
 
NSString * deviceName
 
BOOL highDensityModeEnabled
 
CGRect activeScanningAreaLandscape
 
CGRect activeScanningAreaPortrait
 
BOOL restrictedAreaScanningEnabled
 
CGPoint scanningHotSpot
 
BOOL motionCompensationEnabled
 
BOOL codeRejectionEnabled
 
SBSScanAreaSettingsareaSettingsPortrait
 
SBSScanAreaSettingsareaSettingsLandscape
 
BOOL matrixScanEnabled
 
SBSTextRecognitionSettingstextRecognitionSettings
 
SBSRecognitionMode recognitionMode
 

Detailed Description

Holds settings that affect the recognition of barcodes, such as enabled barcode symbologies, scanning hot spot etc.

The SBSScanSettings class was introduced in ScanditSDK 4.7 to hold all scan-specific settings. The settings are passed to the SBSBarcodePicker when it is constructed.

Scan settings are not directly allocated, instead you should use one of the factory settings (defaultSettings (SBSScanSettings) or pre47DefaultSettings (SBSScanSettings)) to receive a settings instance.

Since
4.7.0

Method Documentation

+ (nonnull instancetype) defaultSettings

Settings object with default values.

Returns
new settings object
+ (nonnull instancetype) pre47DefaultSettings

Convenience method to retrieve default settings as they were before ScanditSDK 4.7.

This method will return a settings object with symbologies on that were on by default for ScanditSDK 4.6 and older. These symbologies include EAN13, UPC12, EAN8, UPCE, CODE39, ITF, CODE128, QR, DATAMATRIX.

The use of this method is discouraged. Use defaultSettings instead and explicitly enable the symbologies that are required by your app.

Returns
new settings object
+ (nullable instancetype) settingsWithDictionary: (nonnull NSDictionary< NSString *, id > *)  dictionary
error: (NSError *_Nullable *_Nullable)  error 

Returns a settings instance initialized with the values contained in dictionary.

Parameters
dictionaryDictionary, e.g. as deserialized from JSON to use for initializing the settings.
errorUpon failure, will contain further details on why the settings instance could not be created.
- (void) enableSymbologies: (nonnull NSSet< NSNumber * > *)  symbologies

Enable decoding of the given symbologies.

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

By default, all symbologies are turned off and symbologies need to be explicitly enabled.

Parameters
symbologiesThe symbologies that should be enabled.
Since
4.7.0
- (void) setSymbology: (SBSSymbology symbology
enabled: (BOOL)  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 SBSSymbologySettings.

SBSScanSettings* settings = ... ;
[settings setSymbology:SymbologyQR enabled:YES];
// the following line has the same effect:
[settings settingsForSymbology:SymbologyQR].enabled = YES;

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 "active symbol counts" for the symbology in addition to enabling it. 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.
enabledYES when decoding of the symbology should be enabled, NO if not.
Since
4.7.0
- (nonnull NSSet<NSNumber *> *) enabledSymbologies

Returns the set of enabled symbologies.

- (nonnull SBSSymbologySettings *) settingsForSymbology: (SBSSymbology symbology

Retrieve symbology-specific settings.

Parameters
symbologyThe symbology for which to retrieve the settings.
Returns
The symbology-specific settings object.
Since
4.7.0
- (void) setActiveScanningArea: (CGRect)  area

Convenience function to set the landscape and portrait active scanning area.

Use this method to set activeScanningAreaLandscape and activeScanningAreaPortrait to the same value.

Since
4.7.0
- (void) setProperty: (nonnull NSString *)  property
toValue: (int)  value 

Set a custom property to configure the scanner.

Use this method to set scan settings that are not part of the public API yet. There are no stability guarantees for these properties and they might get renamed, or disappear completely in future releases. Setting properties that no longer exist is not an error, but they will be ignored.

Parameters
propertyThe name of the property to set. Must not be nil.
valueThe value to set the property to.
Since
4.10
- (int) valueForProperty: (nonnull NSString *)  key

Get the value of the custom property identified by key.

If the property is not set a default value of -1 is returned.

Parameters
keyThe name of the property to retrieve. Must not be nil.
Since
5.5.0

Property Documentation

- (SBSWorkingRange) workingRange
readwritenonatomicassign

The focus working range for the barcode picker.

By default, focus is optimized for scanning barcodes which are close to the device (SBSWorkingRangeStandard). You can change this property to SBSWorkingRangeLong to optimize the focus for scanning codes that are further away.

- (BOOL) force2dRecognition
readwritenonatomicassign

Forces the barcode scanner to always run the 2D decoders (QR Code, Data Matrix, etc.), even when the 2D detector did not detect the presence of a 2D code.

This slows down the overall scanning speed, but can be useful when your application only tries to read 2D codes. Force 2d recognition is set to on when micro data matrix mode is enabled.

By default forced 2d recognition is disabled.

- (NSInteger) maxNumberOfCodesPerFrame
readwritenonatomicassign

The maximum number of barcodes to be decoded every frame.

If set to values smaller than one, it is set to 1.

The default value is 1.

Since
4.7.0
- (NSInteger) codeDuplicateFilter
readwritenonatomicassign

Specifies the duplicate filter to use for the session.

Duplicate filtering affects the handling of codes with the same data and symbology. When the filter is set to -1, each unique code is only added once to the session, 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 withing the specified interval is it filtered out as a duplicate.

The default value is 500ms.

Since
4.7.0
- (NSInteger) codeCachingDuration
readwritenonatomicassign

Determines how long codes are kept in the session.

When set to -1, codes are kept for the duration of the session. When set to 0, codes are kept until the next frame processing call finishes. For all other values, codeCachingDuration specifies a duration in milliseconds for how long the codes are kept.

The default value is -1.

Since
4.7.0
- (float) relativeZoom
readwritenonatomicassign

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

Note that this value may be overwritten by calls to setRelativeZoom: (SBSBarcodePicker), or by a manual zoom operation through pinch-to-zoom.

- (SBSCameraFacingDirection) cameraFacingPreference
readwritenonatomicassign

The preferred camera direction.

The picker first gives preference to cameras of the given 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.7.0
- (NSString*) deviceName
readwritenonatomicstrong

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.

Since
4.7.0
- (BOOL) highDensityModeEnabled
readwritenonatomicassign

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.

Since
4.7.0
- (CGRect) activeScanningAreaLandscape
readwritenonatomicassign

The active scanning area when the picker is in landscape orientation.

The active scanning area defines the rectangle in which barcodes and 2D codes are searched and decoded when the picker is in landscape orientation. By default, this area is set to the full camera preview.

The rectangle is defined in relative coordinates, where the top-left corner is (0,0) and the bottom right corner of the camera preview is (1,1).

Since
4.7.0
- (CGRect) activeScanningAreaPortrait
readwritenonatomicassign

The active scanning area when the picker is in portrait orientation.

The active scanning area defines the rectangle in which barcodes and 2D codes are searched and decoded when the picker is in portrait orientation. By default, this area is set to the full camera preview.

When setting this property, restricted area scanning (restrictedAreaScanningEnabled) is automatically set to true.

The rectangle is defined in relative coordinates, where the top-left corner is (0,0) and the bottom right corner of the camera preview is (1,1).

Since
4.7.0
- (BOOL) restrictedAreaScanningEnabled
readwritenonatomicassign
Since
4.7.0

When set to true, barcode recognition is restricted to the rectangles defined by activeScanningAreaPortrait and activeScanningAreaLandscape, depending on the orientation of the phone. When false, the whole image is searched for barcodes.

- (CGPoint) scanningHotSpot
readwritenonatomicassign

Defines the point at which barcodes and 2D codes are expected.

The hot spot is defined in relative view coordinates, where the top-left corner is (0,0) and the bottom right corner of the view is (1,1).

The default values is (0.5, 0.5).

Since
4.7.0
- (BOOL) motionCompensationEnabled
readwritenonatomicassign

Enable/disable motion compensation.

When motion compensation is enabled, special algorithms are run to improve the image quality when the phone or the barcode to be scanned are moving. Motion compensation requires an OpenGLES 3.0 compatible device. For devices that do not support OpenGLES 3.0, setting the motion compensation flag has no effect.

Motion compensation is enabled by default.

Since
4.7.0
- (BOOL) codeRejectionEnabled
readwritenonatomicassign

Whether code rejection should be enabled.

Code rejection allows you to implement custom code verification features and reject certain codes by calling rejectCode: (SBSScanSession). By default, code rejection is disabled.

Since
4.15
- (SBSScanAreaSettings*) areaSettingsPortrait
readwritenonatomicstrong

Portrait area settings, if present.

This property allows a more fine-grained control over where codes are searched and scanned. By default, this property is set to nil and the settings specified by activeScanningAreaPortrait and activeScanningAreaLandscape are used to control where codes are scanned. As soon as this property is set to an instance, activeScanningAreaPortrait and activeScanningAreaLandscape have no longer any effect on the scan area.

Since
5.0
- (SBSScanAreaSettings*) areaSettingsLandscape
readwritenonatomicstrong

Landscape area settings, if present.

This property allows a more fine-grained control over where codes are searched and scanned. By default, this property is set to nil and the settings specified by activeScanningAreaPortrait and activeScanningAreaLandscape are used to control where codes are scanned. As soon as this property is set to an instance, activeScanningAreaPortrait and activeScanningAreaLandscape have no longer any effect on the scan area.

Since
5.0
- (BOOL) matrixScanEnabled
readwritenonatomicassign

Whether matrix scan should be enabled.

Matrix scan allows you to know the location of all localized codes. In order to get the tracked codes, it is recommended to implement the SBSProcessFrameDelegate protocol and to use SBSScanSession::trackedCodes. To use the default matrix scan UI, it is necessary to set SBSOverlayController::guiStyle to SBSGuiStyleMatrixScan. When implementing a custom matrix scan UI, it is recommended to set SBSOverlayController::guiStyle to SBSGuiStyleNone.

Since
5.2
- (SBSTextRecognitionSettings*) textRecognitionSettings
readwritenonatomicstrong

The text recognition settings to be used.

By default, the text recognition settings are set to nil. If you want to use the text recognition feature, you must set this property and configure the settings accordingly.

This feature is only available if you have text recognition enabled.

Since
5.1

Provided by category SBSScanSettings(TextRecognition).

- (SBSRecognitionMode) recognitionMode
readwritenonatomicassign

The recognition mode to use for the barcode picker.

Use this property to programmatically switch between text and barcode recognition. By default, barcode recognition is on (SBSRecognitionModeCode).

Since
5.1

Provided by category SBSScanSettings(TextRecognition).


The documentation for this class was generated from the following file: