Package com.google.zxing.oned
Class CodaBarReader
java.lang.Object
com.google.zxing.oned.OneDReader
com.google.zxing.oned.CodaBarReader
- All Implemented Interfaces:
Reader
Decodes Codabar barcodes.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final char[]
private static final String
(package private) static final int[]
These represent the encodings of characters, as patterns of wide and narrow bars.private int
private int[]
private final StringBuilder
private static final float
private static final int
private static final float
private static final char[]
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static boolean
arrayContains
(char[] array, char key) private void
counterAppend
(int e) decodeRow
(int rowNumber, BitArray row, Map<DecodeHintType, ?> hints) Attempts to decode a one-dimensional barcode format given a single row of an image.private int
private void
setCounters
(BitArray row) Records the size of all runs of white and black pixels, starting with white.private int
toNarrowWidePattern
(int position) private void
validatePattern
(int start) Methods inherited from class com.google.zxing.oned.OneDReader
decode, decode, patternMatchVariance, recordPattern, recordPatternInReverse, reset
-
Field Details
-
MAX_ACCEPTABLE
private static final float MAX_ACCEPTABLE- See Also:
-
PADDING
private static final float PADDING- See Also:
-
ALPHABET_STRING
- See Also:
-
ALPHABET
static final char[] ALPHABET -
CHARACTER_ENCODINGS
static final int[] CHARACTER_ENCODINGSThese represent the encodings of characters, as patterns of wide and narrow bars. The 7 least-significant bits of each int correspond to the pattern of wide and narrow, with 1s representing "wide" and 0s representing narrow. -
MIN_CHARACTER_LENGTH
private static final int MIN_CHARACTER_LENGTH- See Also:
-
STARTEND_ENCODING
private static final char[] STARTEND_ENCODING -
decodeRowResult
-
counters
private int[] counters -
counterLength
private int counterLength
-
-
Constructor Details
-
CodaBarReader
public CodaBarReader()
-
-
Method Details
-
decodeRow
public Result decodeRow(int rowNumber, BitArray row, Map<DecodeHintType, ?> hints) throws NotFoundExceptionDescription copied from class:OneDReader
Attempts to decode a one-dimensional barcode format given a single row of an image.
- Specified by:
decodeRow
in classOneDReader
- Parameters:
rowNumber
- row number from top of the rowrow
- the black/white pixel data of the rowhints
- decode hints- Returns:
Result
containing encoded string and start/end of barcode- Throws:
NotFoundException
- if no potential barcode is found
-
validatePattern
- Throws:
NotFoundException
-
setCounters
Records the size of all runs of white and black pixels, starting with white. This is just like recordPattern, except it records all the counters, and uses our builtin "counters" member for storage.- Parameters:
row
- row to count from- Throws:
NotFoundException
-
counterAppend
private void counterAppend(int e) -
findStartPattern
- Throws:
NotFoundException
-
arrayContains
static boolean arrayContains(char[] array, char key) -
toNarrowWidePattern
private int toNarrowWidePattern(int position)
-