Class UPCAReader
Implements decoding of the UPC-A format.
public sealed class UPCAReader : UPCEANReader, Reader
- Inheritance
-
UPCAReader
- Implements
- Inherited Members
Constructors
UPCAReader()
public UPCAReader()
Methods
decode(BinaryBitmap, IDictionary<DecodeHintType, object>)
Decodes the specified image.
public override Result decode(BinaryBitmap image, IDictionary<DecodeHintType, object> hints)
Parameters
image
BinaryBitmapThe image.
hints
IDictionary<DecodeHintType, object>The hints.
Returns
decodeMiddle(BitArray, int[], StringBuilder)
Subclasses override this to decode the portion of a barcode between the start and end guard patterns.
protected override 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, 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.
public override Result decodeRow(int rowNumber, BitArray row, int[] startGuardRange, IDictionary<DecodeHintType, object> hints)
Parameters
rowNumber
introw
BitArraystartGuardRange
int[]hints
IDictionary<DecodeHintType, object>