|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.zxing.oned.AbstractOneDReader
public abstract class AbstractOneDReader
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 | ||
|---|---|---|
AbstractOneDReader()
|
||
| Method Summary | ||
|---|---|---|
Result |
decode(BinaryBitmap image)
Locates and decodes a barcode in some format within an image. |
|
Result |
decode(BinaryBitmap image,
Hashtable hints)
Locates and decodes a barcode in some format within an image. |
|
abstract Result |
decodeRow(int rowNumber,
BitArray row,
Hashtable 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)
|
|
| Methods inherited from class java.lang.Object |
|---|
equals, 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 AbstractOneDReader()
| Method Detail |
|---|
public Result decode(BinaryBitmap image)
throws NotFoundException,
FormatException
Reader
decode in interface Readerimage - image of barcode to decode
NotFoundException - if the barcode cannot be located or decoded for any reason
FormatException
public Result decode(BinaryBitmap image,
Hashtable hints)
throws NotFoundException,
FormatException
Reader
decode in interface Readerimage - image of barcode to decodehints - passed as a Hashtable 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
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 pixels
protected 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,
Hashtable hints)
throws NotFoundException,
ChecksumException,
FormatException
Attempts to decode a one-dimensional barcode format given a single row of an image.
decodeRow in interface OneDReaderrowNumber - 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 | ||||||||
Copyright 1999-2011 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Java is a trademark of Oracle America Inc. in the US and other countries.
Legal