Class RSSExpandedReader
java.lang.Object
com.google.zxing.oned.OneDReader
com.google.zxing.oned.rss.AbstractRSSReader
com.google.zxing.oned.rss.expanded.RSSExpandedReader
- All Implemented Interfaces:
Reader
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final floatprivate static final int[]private static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final intprivate static final floatprivate static final int[][]The possible finder pattern sequences, from section 7.2.7 of ISO/IEC 24724:2006.private static final int[][]Finder pattern element widths, from section 7.2.7 of ISO/IEC 24724:2006.private static final int[]private static final floatprivate static final intprivate final List<ExpandedPair> private final List<ExpandedRow> private final int[]private booleanprivate static final int[]private static final int[][]The element weights used in the checksum calculation, from section 7.2.6 of ISO/IEC 24724:2006. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidadjustOddEvenCounts(int numModules) private booleanprivate List<ExpandedPair> checkRows(boolean reverse) private List<ExpandedPair> checkRows(List<ExpandedRow> collectedRows, int currentRow) (package private) static ResultconstructResult(List<ExpandedPair> pairs) (package private) DataCharacterdecodeDataCharacter(BitArray row, FinderPattern pattern, boolean isOddPattern, boolean leftChar) decodeRow(int rowNumber, BitArray row, Map<DecodeHintType, ?> hints) Attempts to decode a one-dimensional barcode format given a single row of an image.(package private) List<ExpandedPair> decodeRow2pairs(int rowNumber, BitArray row) private voidfindNextPair(BitArray row, List<ExpandedPair> previousPairs, int forcedOffset) private static intgetNextSecondBar(BitArray row, int initialPos) (package private) List<ExpandedRow> getRows()private static booleanisNotA1left(FinderPattern pattern, boolean isOddPattern, boolean leftChar) private static booleanisPartialRow(Iterable<ExpandedPair> pairs, Iterable<ExpandedRow> rows) private static booleanisValidSequence(List<ExpandedPair> pairs, boolean complete) private static booleanmayFollow(List<ExpandedPair> pairs, int value) private FinderPatternparseFoundFinderPattern(BitArray row, int rowNumber, boolean oddPattern, List<ExpandedPair> previousPairs) private static voidremovePartialRows(Collection<ExpandedPair> pairs, Collection<ExpandedRow> rows) voidreset()Resets any internal state the implementation has after a decode, to prepare it for reuse.(package private) ExpandedPairretrieveNextPair(BitArray row, List<ExpandedPair> previousPairs, int rowNumber) private static voidreverseCounters(int[] counters) private voidstoreRow(int rowNumber) Methods inherited from class AbstractRSSReader
count, decrement, getDataCharacterCounters, getDecodeFinderCounters, getEvenCounts, getEvenRoundingErrors, getOddCounts, getOddRoundingErrors, increment, isFinderPattern, parseFinderValueMethods inherited from class OneDReader
decode, decode, patternMatchVariance, recordPattern, recordPatternInReverse
-
Field Details
-
SYMBOL_WIDEST
private static final int[] SYMBOL_WIDEST -
EVEN_TOTAL_SUBSET
private static final int[] EVEN_TOTAL_SUBSET -
GSUM
private static final int[] GSUM -
FINDER_PATTERNS
private static final int[][] FINDER_PATTERNSFinder pattern element widths, from section 7.2.7 of ISO/IEC 24724:2006. -
WEIGHTS
private static final int[][] WEIGHTSThe element weights used in the checksum calculation, from section 7.2.6 of ISO/IEC 24724:2006. -
FINDER_PAT_A
private static final int FINDER_PAT_A- See Also:
-
FINDER_PAT_B
private static final int FINDER_PAT_B- See Also:
-
FINDER_PAT_C
private static final int FINDER_PAT_C- See Also:
-
FINDER_PAT_D
private static final int FINDER_PAT_D- See Also:
-
FINDER_PAT_E
private static final int FINDER_PAT_E- See Also:
-
FINDER_PAT_F
private static final int FINDER_PAT_F- See Also:
-
FINDER_PATTERN_SEQUENCES
private static final int[][] FINDER_PATTERN_SEQUENCESThe possible finder pattern sequences, from section 7.2.7 of ISO/IEC 24724:2006. -
MAX_PAIRS
private static final int MAX_PAIRS- See Also:
-
FINDER_PATTERN_MODULES
private static final float FINDER_PATTERN_MODULES- See Also:
-
DATA_CHARACTER_MODULES
private static final float DATA_CHARACTER_MODULES- See Also:
-
MAX_FINDER_PATTERN_DISTANCE_VARIANCE
private static final float MAX_FINDER_PATTERN_DISTANCE_VARIANCE- See Also:
-
pairs
-
rows
-
startEnd
private final int[] startEnd -
startFromEven
private boolean startFromEven
-
-
Constructor Details
-
RSSExpandedReader
public RSSExpandedReader()
-
-
Method Details
-
decodeRow
public Result decodeRow(int rowNumber, BitArray row, Map<DecodeHintType, ?> hints) throws NotFoundException, FormatException 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 foundFormatException- if a potential barcode is found but format is invalid
-
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
-
decodeRow2pairs
- Throws:
NotFoundException
-
checkRows
-
checkRows
private List<ExpandedPair> checkRows(List<ExpandedRow> collectedRows, int currentRow) throws NotFoundException - Throws:
NotFoundException
-
isValidSequence
-
mayFollow
-
storeRow
private void storeRow(int rowNumber) -
removePartialRows
-
isPartialRow
-
getRows
List<ExpandedRow> getRows() -
constructResult
- Throws:
NotFoundExceptionFormatException
-
checkChecksum
private boolean checkChecksum() -
getNextSecondBar
-
retrieveNextPair
ExpandedPair retrieveNextPair(BitArray row, List<ExpandedPair> previousPairs, int rowNumber) throws NotFoundException - Throws:
NotFoundException
-
findNextPair
private void findNextPair(BitArray row, List<ExpandedPair> previousPairs, int forcedOffset) throws NotFoundException - Throws:
NotFoundException
-
reverseCounters
private static void reverseCounters(int[] counters) -
parseFoundFinderPattern
private FinderPattern parseFoundFinderPattern(BitArray row, int rowNumber, boolean oddPattern, List<ExpandedPair> previousPairs) -
decodeDataCharacter
DataCharacter decodeDataCharacter(BitArray row, FinderPattern pattern, boolean isOddPattern, boolean leftChar) throws NotFoundException - Throws:
NotFoundException
-
isNotA1left
-
adjustOddEvenCounts
- Throws:
NotFoundException
-