UPCEANReader class abstract

Encapsulates functionality and implementation that is common to UPC and EAN families of one-dimensional barcodes.

@author dswitkin@google.com (Daniel Switkin) @author Sean Owen @author alasdair@google.com (Alasdair Mackintosh)

Inheritance
Implementers

Constructors

UPCEANReader()

Properties

barcodeFormat BarcodeFormat
Get the format of this decoder.
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkChecksum(String s) bool
@param s string of digits to check @return {@link #checkStandardUPCEANChecksum(CharSequence)} @throws FormatException if the string does not contain only digits
decode(BinaryBitmap image, [DecodeHint? hints]) Result
Locates and decodes a barcode in some format within an image. This method also accepts hints, each possibly associated to some data, which may help the implementation decode.
inherited
decodeEnd(BitArray row, int endStart) List<int>
decodeMiddle(BitArray row, List<int> startRange, StringBuilder result) int
Subclasses override this to decode the portion of a barcode between the start and end guard patterns.
decodeRow(int rowNumber, BitArray row, DecodeHint? hints, [List<int>? startGuardRange]) Result
Like {@link #decodeRow(int, BitArray, Map)}, but allows caller to inform method about where the UPC/EAN start pattern is found. This allows this to be computed once and reused across many implementations.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Resets any internal state the implementation has after a decode, to prepare it for reuse.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

lAndGPatterns List<List<int>>
As above but also including the "even", or "G" patterns used to encode UPC/EAN digits.
final

Static Methods

checkStandardUPCEANChecksum(String s) bool
Computes the UPC/EAN checksum on a string of digits, and reports whether the checksum is correct or not.
decodeDigit(BitArray row, List<int> counters, int rowOffset, List<List<int>> patterns) int
Attempts to decode a single UPC/EAN-encoded digit.
findGuardPattern(BitArray row, int rowOffset, bool whiteFirst, List<int> pattern) List<int>
findStartGuardPattern(BitArray row) List<int>
getStandardUPCEANChecksum(String s) int

Constants

endPattern → const List<int>
end guard pattern.
lPatterns → const List<List<int>>
"Odd", or "L" patterns used to encode UPC/EAN digits.
middlePattern → const List<int>
Pattern marking the middle of a UPC/EAN pattern, separating the two halves.
startEndPattern → const List<int>
Start/end guard pattern.