Inherits NSObject.
Class Methods | |
(nonnull instancetype) | + defaultPortraitSettings |
(nonnull instancetype) | + defaultLandscapeSettings |
(nullable instancetype) | + settingsWithDictionary:error: |
Detailed Description
Scanning area settings control where codes are to be searched in images/frames.
The areas as well as the hot-spot is specified in relative coordinates. The coordinates are rotated with the device: The top-left corner of the camera preview is 0,0, whereas 1,1 is the bottom-right corner. Coordinates specified outside of the supported range raise an exception.
For most use-cases, the "active scanning area portrait/active scanning area landscape" available as part of the SBSScanSettings is sufficient and is simpler to use. We only recommend to use the SBSScanAreaSettings if you have very specific needs for your application that can't be met with the "active scanning area" interface.
This class allows to control the areas separately for wide and square symbologies. Classification of symbologies into square and wide is according to their aspect ratio: symbologies that have a width/height ratio different from one (1d codes, PDF417, etc.) are classified as wide, symbologies whose width/height aspect ratio is close to 1.0 (QR, Aztec etc.) are classified as square. Symbologies whose aspect ratio can vary, e.g. DataMatrix, or DataBar, are classified according to their pre-dominant aspect ratio.
- Note
- This interface is not part of the stable API yet and is subject to change. Functionality may dissappear, or change in future releases.
- Since
- 5.0
Method Documentation
+ (nonnull instancetype) defaultPortraitSettings |
Returns a new instance with default settings for portrait scanning.
- Since
- 5.0
+ (nonnull instancetype) defaultLandscapeSettings |
Returns a new instance with default settings for landscape scanning.
- Since
- 5.0
+ (nullable instancetype) settingsWithDictionary: | (nonnull NSDictionary< NSString *, id > *) | dict | |
error: | (NSError *_Nullable *_Nullable) | error | |
Create scan area settings from a JSON object.
- Parameters
-
dict the JSON object. The following keys are understood: wideCodeLocationArea
andsquareCodeLocationArea
can be used to specify the code location area rectangles. The rectangles can either be objects withx
,y
,width
andheight
key-value pairs, or a list of four floating-point values ordered as [x, y, width, height].squareCodeLocationConstraint
andwideCodeLocationConstraint
can be used to set the the respective constraint for the areas. The stringsrestrict
andhint
are mapped to their enum counter-part.primaryDirection
can either be set tovertical
orhorizontal
to specify the primary direction for scanning. Additional keys are ignored. Keys which are not set are left as default values.error in case of an invalid JSON dictionary, error
will contain more details on the error.
- Returns
- The scan area settings, or null if it could not be parsed.
- Since
- 5.1.0
Property Documentation
|
readwritenonatomicassign |
The area in which codes are searched.
By default, codes are searched in the whole image.
- Since
- 5.0
|
readwritenonatomicassign |
Code location area for wide codes.
- Since
- 5.0
|
readwritenonatomicassign |
Code location constraint for wide codes.
- Since
- 5.0
|
readwritenonatomicassign |
Code location area for square codes.
- Since
- 5.0
|
readwritenonatomicassign |
Code location constraint for square codes.
- Since
- 5.0
|
readwritenonatomicassign |
The primary direction to be used for scanning.
The primary direction for scanning. By default, preference is given to codes in horizontal direction. Change this to SBSDirectionVertical to optimize the engine for scanning vertical codes. This only incluences recognition of wide codes and has no influence on square codes.
- Since
- 5.1
The documentation for this class was generated from the following file: