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 float
private static final int[]
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final float
private 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 float
private static final int
private final List
<ExpandedPair> private final List
<ExpandedRow> private final int[]
private boolean
private 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 void
adjustOddEvenCounts
(int numModules) private boolean
private List
<ExpandedPair> checkRows
(boolean reverse) private List
<ExpandedPair> checkRows
(List<ExpandedRow> collectedRows, int currentRow) (package private) static Result
constructResult
(List<ExpandedPair> pairs) (package private) DataCharacter
decodeDataCharacter
(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 void
findNextPair
(BitArray row, List<ExpandedPair> previousPairs, int forcedOffset) private static int
getNextSecondBar
(BitArray row, int initialPos) (package private) List
<ExpandedRow> getRows()
private static boolean
isNotA1left
(FinderPattern pattern, boolean isOddPattern, boolean leftChar) private static boolean
isPartialRow
(Iterable<ExpandedPair> pairs, Iterable<ExpandedRow> rows) private static boolean
isValidSequence
(List<ExpandedPair> pairs, boolean complete) private static boolean
mayFollow
(List<ExpandedPair> pairs, int value) private FinderPattern
parseFoundFinderPattern
(BitArray row, int rowNumber, boolean oddPattern, List<ExpandedPair> previousPairs) private static void
removePartialRows
(Collection<ExpandedPair> pairs, Collection<ExpandedRow> rows) void
reset()
Resets any internal state the implementation has after a decode, to prepare it for reuse.(package private) ExpandedPair
retrieveNextPair
(BitArray row, List<ExpandedPair> previousPairs, int rowNumber) private static void
reverseCounters
(int[] counters) private void
storeRow
(int rowNumber) 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 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, FormatExceptionDescription 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 invalid
-
reset
public void reset()Description copied from interface:Reader
Resets any internal state the implementation has after a decode, to prepare it for reuse.- Specified by:
reset
in interfaceReader
- Overrides:
reset
in 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:
NotFoundException
FormatException
-
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
-