Table of Contents

Class UPCEANReader

Namespace
ZXing.OneD
Assembly
zxing.dll

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

dswitkin@google.com (Daniel Switkin) Sean Owen alasdair@google.com (Alasdair Mackintosh)
public abstract class UPCEANReader : OneDReader, Reader
Inheritance
UPCEANReader
Implements
Derived
Inherited Members

Constructors

UPCEANReader()

Initializes a new instance of the UPCEANReader class.

protected UPCEANReader()

Methods

checkChecksum(string)

protected virtual bool checkChecksum(string s)

Parameters

s string

string of digits to check

Returns

bool

see ZXing.OneD.UPCEANReader.checkStandardUPCEANChecksum(System.String)

decodeEnd(BitArray, int)

Decodes the end.

protected virtual int[] decodeEnd(BitArray row, int endStart)

Parameters

row BitArray

The row.

endStart int

The end start.

Returns

int[]

decodeMiddle(BitArray, int[], StringBuilder)

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

protected abstract int decodeMiddle(BitArray row, int[] startRange, StringBuilder resultString)

Parameters

row BitArray

row of black/white values to search

startRange int[]

start/end offset of start guard pattern

resultString StringBuilder

StringBuilderto append decoded chars to

Returns

int

horizontal offset of first pixel after the "middle" that was decoded or -1 if decoding could not complete successfully

decodeRow(int, BitArray, IDictionary<DecodeHintType, object>)

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

public override Result decodeRow(int rowNumber, BitArray row, IDictionary<DecodeHintType, object> hints)

Parameters

rowNumber int

row number from top of the row

row BitArray

the black/white pixel data of the row

hints IDictionary<DecodeHintType, object>

decode hints

Returns

Result

Resultcontaining encoded string and start/end of barcode or null, if an error occurs or barcode cannot be found

decodeRow(int, BitArray, int[], IDictionary<DecodeHintType, object>)

Like decodeRow(int, BitArray, IDictionary<DecodeHintType, object>), 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.

public virtual Result decodeRow(int rowNumber, BitArray row, int[] startGuardRange, IDictionary<DecodeHintType, object> hints)

Parameters

rowNumber int

row index into the image

row BitArray

encoding of the row of the barcode image

startGuardRange int[]

start/end column where the opening start pattern was found

hints IDictionary<DecodeHintType, object>

optional hints that influence decoding

Returns

Result

Result encapsulating the result of decoding a barcode in the row