Package com.google.zxing.oned.rss
Class RSS14Reader
- java.lang.Object
-
- com.google.zxing.oned.OneDReader
-
- com.google.zxing.oned.rss.AbstractRSSReader
-
- com.google.zxing.oned.rss.RSS14Reader
-
- All Implemented Interfaces:
Reader
public final class RSS14Reader extends AbstractRSSReader
Decodes RSS-14, including truncated and stacked variants. See ISO/IEC 24724:2006.
-
-
Field Summary
Fields Modifier and Type Field Description private static int[][]FINDER_PATTERNSprivate static int[]INSIDE_GSUMprivate static int[]INSIDE_ODD_TOTAL_SUBSETprivate static int[]INSIDE_ODD_WIDESTprivate static int[]OUTSIDE_EVEN_TOTAL_SUBSETprivate static int[]OUTSIDE_GSUMprivate static int[]OUTSIDE_ODD_WIDESTprivate java.util.List<Pair>possibleLeftPairsprivate java.util.List<Pair>possibleRightPairs
-
Constructor Summary
Constructors Constructor Description RSS14Reader()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static voidaddOrTally(java.util.Collection<Pair> possiblePairs, Pair pair)private voidadjustOddEvenCounts(boolean outsideChar, int numModules)private static booleancheckChecksum(Pair leftPair, Pair rightPair)private static ResultconstructResult(Pair leftPair, Pair rightPair)private DataCharacterdecodeDataCharacter(BitArray row, FinderPattern pattern, boolean outsideChar)private PairdecodePair(BitArray row, boolean right, int rowNumber, java.util.Map<DecodeHintType,?> hints)ResultdecodeRow(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 int[]findFinderPattern(BitArray row, boolean rightFinderPattern)private FinderPatternparseFoundFinderPattern(BitArray row, int rowNumber, boolean right, int[] startEnd)voidreset()Resets any internal state the implementation has after a decode, to prepare it for reuse.-
Methods inherited from class com.google.zxing.oned.rss.AbstractRSSReader
count, decrement, getDataCharacterCounters, getDecodeFinderCounters, getEvenCounts, getEvenRoundingErrors, getOddCounts, getOddRoundingErrors, increment, isFinderPattern, parseFinderValue
-
Methods inherited from class com.google.zxing.oned.OneDReader
decode, decode, patternMatchVariance, recordPattern, recordPatternInReverse
-
-
-
-
Field Detail
-
OUTSIDE_EVEN_TOTAL_SUBSET
private static final int[] OUTSIDE_EVEN_TOTAL_SUBSET
-
INSIDE_ODD_TOTAL_SUBSET
private static final int[] INSIDE_ODD_TOTAL_SUBSET
-
OUTSIDE_GSUM
private static final int[] OUTSIDE_GSUM
-
INSIDE_GSUM
private static final int[] INSIDE_GSUM
-
OUTSIDE_ODD_WIDEST
private static final int[] OUTSIDE_ODD_WIDEST
-
INSIDE_ODD_WIDEST
private static final int[] INSIDE_ODD_WIDEST
-
FINDER_PATTERNS
private static final int[][] FINDER_PATTERNS
-
possibleLeftPairs
private final java.util.List<Pair> possibleLeftPairs
-
possibleRightPairs
private final java.util.List<Pair> possibleRightPairs
-
-
Method Detail
-
decodeRow
public Result decodeRow(int rowNumber, BitArray row, java.util.Map<DecodeHintType,?> hints) throws NotFoundException
Description copied from class:OneDReaderAttempts to decode a one-dimensional barcode format given a single row of an image.
- Specified by:
decodeRowin classOneDReader- Parameters:
rowNumber- row number from top of the rowrow- the black/white pixel data of the rowhints- decode hints- Returns:
Resultcontaining encoded string and start/end of barcode- Throws:
NotFoundException- if no potential barcode is found
-
reset
public void reset()
Description copied from interface:ReaderResets any internal state the implementation has after a decode, to prepare it for reuse.- Specified by:
resetin interfaceReader- Overrides:
resetin classOneDReader
-
decodePair
private Pair decodePair(BitArray row, boolean right, int rowNumber, java.util.Map<DecodeHintType,?> hints)
-
decodeDataCharacter
private DataCharacter decodeDataCharacter(BitArray row, FinderPattern pattern, boolean outsideChar) throws NotFoundException
- Throws:
NotFoundException
-
findFinderPattern
private int[] findFinderPattern(BitArray row, boolean rightFinderPattern) throws NotFoundException
- Throws:
NotFoundException
-
parseFoundFinderPattern
private FinderPattern parseFoundFinderPattern(BitArray row, int rowNumber, boolean right, int[] startEnd) throws NotFoundException
- Throws:
NotFoundException
-
adjustOddEvenCounts
private void adjustOddEvenCounts(boolean outsideChar, int numModules) throws NotFoundException- Throws:
NotFoundException
-
-