ReaderOptions class final

How thoroughly the engine searches an image.

The defaults are tuned for photos and files (robust, still fast because BarcodeReader.read stops at the first barcode). For camera frames use ReaderOptions.camera, which leaves out what a camera rarely sees.

Annotations

Constructors

ReaderOptions({bool tryHarder = true, bool tryRotate = true, bool tryInvert = true, bool tryDownscale = true, bool isPure = false, bool returnErrors = false, bool validateOptionalChecksum = false, Binarizer binarizer = Binarizer.localAverage, int minLineCount = 2, EanAddOn eanAddOn = EanAddOn.ignore, CharacterSet? characterSet})
Options for photos and files: every search strategy on.
const
ReaderOptions.camera()
Options for live camera frames: like the defaults, without looking for inverted (light on dark) barcodes.
const

Properties

binarizer → Binarizer
How the image is turned into black and white before detection.
final
characterSet → CharacterSet?
The character set of barcodes that do not declare one (with an ECI), e.g. CharacterSet.cp1251 for old Russian labels or CharacterSet.shiftJis for Japanese ones. null: the engine guesses it from the bytes, which can go wrong for short texts.
final
eanAddOn → EanAddOn
What to do with the EAN-2/EAN-5 add-on symbol printed next to some EAN and UPC codes (the price on books, the issue on magazines). It comes with an EAN-13, EAN-8, UPC-A or UPC-E.
final
hashCode → int
The hash code for this object.
no setteroverride
isPure → bool
The image contains exactly one clean, unrotated, tightly cropped symbol (e.g. a generated barcode). Much faster, fails on photos.
final
minLineCount → int
For linear barcodes: how many scan lines must agree on a result. Higher values reduce false positives on noisy images. The engine takes 1 to 255: a larger value counts as 255, and 0 or less as the default, 2.
final
returnErrors → bool
Also return barcodes that were found but failed to decode, with Barcode.error set.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
tryDownscale → bool
Also search a downscaled copy of large images (finds big, blurry codes).
final
tryHarder → bool
Spend more time to find barcodes in difficult images.
final
tryInvert → bool
Also look for inverted (light on dark) barcodes.
final
tryRotate → bool
Also look for barcodes rotated by 90°, 180° and 270°.
final
validateOptionalChecksum → bool
Check optional checksums (Code 39, ITF) and reject codes that fail.
final

Methods

copyWith({bool? tryHarder, bool? tryRotate, bool? tryInvert, bool? tryDownscale, bool? isPure, bool? returnErrors, bool? validateOptionalChecksum, Binarizer? binarizer, int? minLineCount, EanAddOn? eanAddOn, CharacterSet? characterSet}) → ReaderOptions
Creates a copy with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
The fields that differ from the defaults: ReaderOptions() for the defaults, ReaderOptions(tryInvert: false) for ReaderOptions.camera.
override

Operators

operator ==(Object other) → bool
The equality operator.
override