|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.zxing.oned.OneDReader
public abstract class OneDReader
Encapsulates functionality and implementation that is common to all families of one-dimensional barcodes.
Field Summary | |
---|---|
protected static int |
INTEGER_MATH_SHIFT
|
protected static int |
PATTERN_MATCH_RESULT_SCALE_FACTOR
|
Constructor Summary | |
---|---|
OneDReader()
|
Method Summary | |
---|---|
Result |
decode(BinaryBitmap image)
Locates and decodes a barcode in some format within an image. |
Result |
decode(BinaryBitmap image,
java.util.Map<DecodeHintType,?> hints)
Locates and decodes a barcode in some format within an image. |
abstract Result |
decodeRow(int rowNumber,
BitArray row,
java.util.Map<DecodeHintType,?> hints)
Attempts to decode a one-dimensional barcode format given a single row of an image. |
protected static int |
patternMatchVariance(int[] counters,
int[] pattern,
int maxIndividualVariance)
Determines how closely a set of observed counts of runs of black/white values matches a given target pattern. |
protected static void |
recordPattern(BitArray row,
int start,
int[] counters)
Records the size of successive runs of white and black pixels in a row, starting at a given point. |
protected static void |
recordPatternInReverse(BitArray row,
int start,
int[] counters)
|
void |
reset()
Resets any internal state the implementation has after a decode, to prepare it for reuse. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int INTEGER_MATH_SHIFT
protected static final int PATTERN_MATCH_RESULT_SCALE_FACTOR
Constructor Detail |
---|
public OneDReader()
Method Detail |
---|
public Result decode(BinaryBitmap image) throws NotFoundException, FormatException
Reader
decode
in interface Reader
image
- image of barcode to decode
NotFoundException
- if the barcode cannot be located or decoded for any reason
FormatException
public Result decode(BinaryBitmap image, java.util.Map<DecodeHintType,?> hints) throws NotFoundException, FormatException
Reader
decode
in interface Reader
image
- image of barcode to decodehints
- passed as a Map
from DecodeHintType
to arbitrary data. The
meaning of the data depends upon the hint type. The implementation may or may not do
anything with these hints.
NotFoundException
- if the barcode cannot be located or decoded for any reason
FormatException
public void reset()
Reader
reset
in interface Reader
protected static void recordPattern(BitArray row, int start, int[] counters) throws NotFoundException
row
- row to count fromstart
- offset into row to start atcounters
- array into which to record counts
NotFoundException
- if counters cannot be filled entirely from row before running out
of pixelsprotected static void recordPatternInReverse(BitArray row, int start, int[] counters) throws NotFoundException
NotFoundException
protected static int patternMatchVariance(int[] counters, int[] pattern, int maxIndividualVariance)
counters
- observed counterspattern
- expected patternmaxIndividualVariance
- The most any counter can differ before we give up
public abstract Result decodeRow(int rowNumber, BitArray row, java.util.Map<DecodeHintType,?> hints) throws NotFoundException, ChecksumException, FormatException
Attempts to decode a one-dimensional barcode format given a single row of an image.
rowNumber
- row number from top of the rowrow
- the black/white pixel data of the rowhints
- decode hints
Result
containing encoded string and start/end of barcode
NotFoundException
- if an error occurs or barcode cannot be found
ChecksumException
FormatException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |