Class UPCEANReader
Encapsulates functionality and implementation that is common to UPC and EAN families of one-dimensional barcodes.
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
stringstring 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
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
BitArrayrow of black/white values to search
startRange
int[]start/end offset of start guard pattern
resultString
StringBuilderStringBuilderto 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
introw number from top of the row
row
BitArraythe 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
introw index into the image
row
BitArrayencoding 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