Package com.google.zxing.oned
Class Code128Reader
- java.lang.Object
-
- com.google.zxing.oned.OneDReader
-
- com.google.zxing.oned.Code128Reader
-
- All Implemented Interfaces:
Reader
public final class Code128Reader extends OneDReader
Decodes Code 128 barcodes.
-
-
Field Summary
Fields Modifier and Type Field Description private static int
CODE_CODE_A
private static int
CODE_CODE_B
private static int
CODE_CODE_C
private static int
CODE_FNC_1
private static int
CODE_FNC_2
private static int
CODE_FNC_3
private static int
CODE_FNC_4_A
private static int
CODE_FNC_4_B
(package private) static int[][]
CODE_PATTERNS
private static int
CODE_SHIFT
private static int
CODE_START_A
private static int
CODE_START_B
private static int
CODE_START_C
private static int
CODE_STOP
private static float
MAX_AVG_VARIANCE
private static float
MAX_INDIVIDUAL_VARIANCE
-
Constructor Summary
Constructors Constructor Description Code128Reader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static int
decodeCode(BitArray row, int[] counters, int rowOffset)
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.private static int[]
findStartPattern(BitArray row)
-
Methods inherited from class com.google.zxing.oned.OneDReader
decode, decode, patternMatchVariance, recordPattern, recordPatternInReverse, reset
-
-
-
-
Field Detail
-
CODE_PATTERNS
static final int[][] CODE_PATTERNS
-
MAX_AVG_VARIANCE
private static final float MAX_AVG_VARIANCE
- See Also:
- Constant Field Values
-
MAX_INDIVIDUAL_VARIANCE
private static final float MAX_INDIVIDUAL_VARIANCE
- See Also:
- Constant Field Values
-
CODE_SHIFT
private static final int CODE_SHIFT
- See Also:
- Constant Field Values
-
CODE_CODE_C
private static final int CODE_CODE_C
- See Also:
- Constant Field Values
-
CODE_CODE_B
private static final int CODE_CODE_B
- See Also:
- Constant Field Values
-
CODE_CODE_A
private static final int CODE_CODE_A
- See Also:
- Constant Field Values
-
CODE_FNC_1
private static final int CODE_FNC_1
- See Also:
- Constant Field Values
-
CODE_FNC_2
private static final int CODE_FNC_2
- See Also:
- Constant Field Values
-
CODE_FNC_3
private static final int CODE_FNC_3
- See Also:
- Constant Field Values
-
CODE_FNC_4_A
private static final int CODE_FNC_4_A
- See Also:
- Constant Field Values
-
CODE_FNC_4_B
private static final int CODE_FNC_4_B
- See Also:
- Constant Field Values
-
CODE_START_A
private static final int CODE_START_A
- See Also:
- Constant Field Values
-
CODE_START_B
private static final int CODE_START_B
- See Also:
- Constant Field Values
-
CODE_START_C
private static final int CODE_START_C
- See Also:
- Constant Field Values
-
CODE_STOP
private static final int CODE_STOP
- See Also:
- Constant Field Values
-
-
Method Detail
-
findStartPattern
private static int[] findStartPattern(BitArray row) throws NotFoundException
- Throws:
NotFoundException
-
decodeCode
private static int decodeCode(BitArray row, int[] counters, int rowOffset) throws NotFoundException
- Throws:
NotFoundException
-
decodeRow
public Result decodeRow(int rowNumber, BitArray row, java.util.Map<DecodeHintType,?> hints) throws NotFoundException, FormatException, ChecksumException
Description 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 foundFormatException
- if a potential barcode is found but format is invalidChecksumException
- if a potential barcode is found but does not pass its checksum
-
-