TUPCEANReader Class

Definition

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

Delphi
type TUPCEANReader = class(TOneDReader)
Inheritance
TInterfacedObject
TUPCEANReader
Derived

Constants

G_PATTERNS

"Even", or "G" patterns used to encode UPC/EAN digits.

INTEGER_MATH_SHIFT (Inherited from TOneDReader)
L_PATTERNS
MAX_AVG_VARIANCE
MAX_INDIVIDUAL_VARIANCE
MIDDLE_PATTERN

Pattern marking the middle of a UPC/EAN pattern, separating the two halves.

START_END_PATTERN

Start/end guard pattern.

Constructors

Create

Initializes a new instance of the TUPCEANReader class.

Destroy

Methods

BarcodeFormat

Get the format of this decoder.

DecodeMiddle(IBitArray, TArray<Integer>, TStringBuilder)

Subclasses override this to decode the portion of a barcode between the start and end guard patterns.

DoDecodeRow(Integer, IBitArray, TArray<Integer>, TDictionary<TDecodeHintType,TObject>)

Like decodeRow(int, BitArray, java.util.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.

RecordPatternInReverse(IBitArray, Integer, TArray<Integer>)

Records the pattern in reverse.

(Inherited from TOneDReader)
checkChecksum(string)
checkStandardUPCEANChecksum(string)

Computes the UPC/EAN checksum on a string of digits, and reports whether the checksum is correct or not.

decode(TBinaryBitmap, TDictionary<TDecodeHintType,TObject>)

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. Note that we don't try rotation without the try harder flag, even if rotation was supported.

(Inherited from TOneDReader)
decodeDigit(IBitArray, TArray<Integer>, Integer, TOneDPatterns, Integer)

Attempts to decode a single UPC/EAN-encoded digit.

decodeEnd(IBitArray, Integer)

Decodes the end.

decodeRow(Integer, IBitArray, TDictionary<TDecodeHintType,TObject>)

Attempts to decode a one-dimensional barcode format given a single row of an image.

findGuardPattern(IBitArray, Integer, Boolean, TOneDPattern)
findGuardPattern(IBitArray, Integer, Boolean, TOneDPattern, TArray<Integer>)
findStartGuardPattern(IBitArray)
patternMatchVariance(TArray<Integer>, TOneDPattern, Integer)

Determines how closely a set of observed counts of runs of black/white values matches a given target pattern. This is reported as the ratio of the total variance from the expected pattern proportions across all pattern elements, to the length of the pattern.

(Inherited from TOneDReader)
recordPattern(IBitArray, Integer, TArray<Integer>)

Records the size of successive runs of white and black pixels in a row, starting at a given point. The values are recorded in the given array, and the number of runs recorded is equal to the size of the array. If the row starts on a white pixel at the given start point, then the first count recorded is the run of white pixels starting from that point; likewise it is the count of a run of black pixels if the row begin on a black pixels at that point.

(Inherited from TOneDReader)
reset

Resets any internal state the implementation has after a decode, to prepare it for reuse.

(Inherited from TOneDReader)

Fields