com.google.zxing.oned.rss.DataCharacter Java Examples
The following examples show how to use
com.google.zxing.oned.rss.DataCharacter.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: RSSExpandedReader.java From MiBandDecompiled with Apache License 2.0 | 6 votes |
private boolean a() { b b1 = (b)o.get(0); DataCharacter datacharacter = b1.b(); int i1 = b1.c().getChecksumPortion(); int j1 = 2; int k1 = i1; for (int l1 = 1; l1 < o.size(); l1++) { b b2 = (b)o.get(l1); k1 += b2.b().getChecksumPortion(); j1++; DataCharacter datacharacter1 = b2.c(); if (datacharacter1 != null) { k1 += datacharacter1.getChecksumPortion(); j1++; } } return k1 % 211 + 211 * (j1 - 4) == datacharacter.getValue(); }
Example #2
Source File: RSSExpandedReader.java From reacteu-app with MIT License | 6 votes |
private boolean checkChecksum() { ExpandedPair firstPair = this.pairs.get(0); DataCharacter checkCharacter = firstPair.getLeftChar(); DataCharacter firstCharacter = firstPair.getRightChar(); int checksum = firstCharacter.getChecksumPortion(); int s = 2; for(int i = 1; i < this.pairs.size(); ++i){ ExpandedPair currentPair = this.pairs.get(i); checksum += currentPair.getLeftChar().getChecksumPortion(); s++; DataCharacter currentRightChar = currentPair.getRightChar(); if (currentRightChar != null) { checksum += currentRightChar.getChecksumPortion(); s++; } } checksum %= 211; int checkCharacterValue = 211 * (s - 4) + checksum; return checkCharacterValue == checkCharacter.getValue(); }
Example #3
Source File: RSSExpandedReader.java From ScreenCapture with MIT License | 5 votes |
ExpandedPair retrieveNextPair(BitArray row, List<ExpandedPair> previousPairs, int rowNumber) throws NotFoundException { boolean isOddPattern = previousPairs.size() % 2 == 0; if (startFromEven) { isOddPattern = !isOddPattern; } FinderPattern pattern; boolean keepFinding = true; int forcedOffset = -1; do { this.findNextPair(row, previousPairs, forcedOffset); pattern = parseFoundFinderPattern(row, rowNumber, isOddPattern); if (pattern == null) { forcedOffset = getNextSecondBar(row, this.startEnd[0]); } else { keepFinding = false; } } while (keepFinding); // When stacked symbol is split over multiple rows, there's no way to guess if this pair can be last or not. // boolean mayBeLast = checkPairSequence(previousPairs, pattern); DataCharacter leftChar = this.decodeDataCharacter(row, pattern, isOddPattern, true); if (!previousPairs.isEmpty() && previousPairs.get(previousPairs.size() - 1).mustBeLast()) { throw NotFoundException.getNotFoundInstance(); } DataCharacter rightChar; try { rightChar = this.decodeDataCharacter(row, pattern, isOddPattern, false); } catch (NotFoundException ignored) { rightChar = null; } return new ExpandedPair(leftChar, rightChar, pattern, true); }
Example #4
Source File: b.java From MiBandDecompiled with Apache License 2.0 | 5 votes |
b(DataCharacter datacharacter, DataCharacter datacharacter1, FinderPattern finderpattern, boolean flag) { b = datacharacter; c = datacharacter1; d = finderpattern; a = flag; }
Example #5
Source File: ExpandedPair.java From reacteu-app with MIT License | 5 votes |
ExpandedPair(DataCharacter leftChar, DataCharacter rightChar, FinderPattern finderPattern, boolean mayBeLast) { this.leftChar = leftChar; this.rightChar = rightChar; this.finderPattern = finderPattern; this.mayBeLast = mayBeLast; }
Example #6
Source File: RSSExpandedReader.java From reacteu-app with MIT License | 5 votes |
ExpandedPair retrieveNextPair(BitArray row, List<ExpandedPair> previousPairs, int rowNumber) throws NotFoundException { boolean isOddPattern = previousPairs.size() % 2 == 0; FinderPattern pattern; boolean keepFinding = true; int forcedOffset = -1; do{ this.findNextPair(row, previousPairs, forcedOffset); pattern = parseFoundFinderPattern(row, rowNumber, isOddPattern); if (pattern == null){ forcedOffset = getNextSecondBar(row, this.startEnd[0]); } else { keepFinding = false; } }while(keepFinding); boolean mayBeLast = checkPairSequence(previousPairs, pattern); DataCharacter leftChar = this.decodeDataCharacter(row, pattern, isOddPattern, true); DataCharacter rightChar; try{ rightChar = this.decodeDataCharacter(row, pattern, isOddPattern, false); }catch(NotFoundException nfe){ if(mayBeLast) { rightChar = null; } else { throw nfe; } } return new ExpandedPair(leftChar, rightChar, pattern, mayBeLast); }
Example #7
Source File: ExpandedPair.java From barcodescanner-lib-aar with MIT License | 5 votes |
ExpandedPair(DataCharacter leftChar, DataCharacter rightChar, FinderPattern finderPattern, boolean mayBeLast) { this.leftChar = leftChar; this.rightChar = rightChar; this.finderPattern = finderPattern; this.mayBeLast = mayBeLast; }
Example #8
Source File: RSSExpandedReader.java From barcodescanner-lib-aar with MIT License | 5 votes |
ExpandedPair retrieveNextPair(BitArray row, List<ExpandedPair> previousPairs, int rowNumber) throws NotFoundException { boolean isOddPattern = previousPairs.size() % 2 == 0; if (startFromEven) { isOddPattern = !isOddPattern; } FinderPattern pattern; boolean keepFinding = true; int forcedOffset = -1; do { this.findNextPair(row, previousPairs, forcedOffset); pattern = parseFoundFinderPattern(row, rowNumber, isOddPattern); if (pattern == null) { forcedOffset = getNextSecondBar(row, this.startEnd[0]); } else { keepFinding = false; } } while (keepFinding); // When stacked symbol is split over multiple rows, there's no way to guess if this pair can be last or not. // boolean mayBeLast = checkPairSequence(previousPairs, pattern); DataCharacter leftChar = this.decodeDataCharacter(row, pattern, isOddPattern, true); if (!previousPairs.isEmpty() && previousPairs.get(previousPairs.size() - 1).mustBeLast()) { throw NotFoundException.getNotFoundInstance(); } DataCharacter rightChar; try { rightChar = this.decodeDataCharacter(row, pattern, isOddPattern, false); } catch (NotFoundException ignored) { rightChar = null; } return new ExpandedPair(leftChar, rightChar, pattern, true); }
Example #9
Source File: RSSExpandedReader.java From barcodescanner-lib-aar with MIT License | 5 votes |
private boolean checkChecksum() { ExpandedPair firstPair = this.pairs.get(0); DataCharacter checkCharacter = firstPair.getLeftChar(); DataCharacter firstCharacter = firstPair.getRightChar(); if (firstCharacter == null) { return false; } int checksum = firstCharacter.getChecksumPortion(); int s = 2; for (int i = 1; i < this.pairs.size(); ++i) { ExpandedPair currentPair = this.pairs.get(i); checksum += currentPair.getLeftChar().getChecksumPortion(); s++; DataCharacter currentRightChar = currentPair.getRightChar(); if (currentRightChar != null) { checksum += currentRightChar.getChecksumPortion(); s++; } } checksum %= 211; int checkCharacterValue = 211 * (s - 4) + checksum; return checkCharacterValue == checkCharacter.getValue(); }
Example #10
Source File: ExpandedPair.java From weex with Apache License 2.0 | 5 votes |
ExpandedPair(DataCharacter leftChar, DataCharacter rightChar, FinderPattern finderPattern, boolean mayBeLast) { this.leftChar = leftChar; this.rightChar = rightChar; this.finderPattern = finderPattern; this.mayBeLast = mayBeLast; }
Example #11
Source File: RSSExpandedReader.java From weex with Apache License 2.0 | 5 votes |
ExpandedPair retrieveNextPair(BitArray row, List<ExpandedPair> previousPairs, int rowNumber) throws NotFoundException { boolean isOddPattern = previousPairs.size() % 2 == 0; if (startFromEven) { isOddPattern = !isOddPattern; } FinderPattern pattern; boolean keepFinding = true; int forcedOffset = -1; do{ this.findNextPair(row, previousPairs, forcedOffset); pattern = parseFoundFinderPattern(row, rowNumber, isOddPattern); if (pattern == null){ forcedOffset = getNextSecondBar(row, this.startEnd[0]); } else { keepFinding = false; } }while(keepFinding); // When stacked symbol is split over multiple rows, there's no way to guess if this pair can be last or not. // boolean mayBeLast = checkPairSequence(previousPairs, pattern); DataCharacter leftChar = this.decodeDataCharacter(row, pattern, isOddPattern, true); if (!previousPairs.isEmpty() && previousPairs.get(previousPairs.size()-1).mustBeLast()) { throw NotFoundException.getNotFoundInstance(); } DataCharacter rightChar; try { rightChar = this.decodeDataCharacter(row, pattern, isOddPattern, false); } catch(NotFoundException ignored) { rightChar = null; } boolean mayBeLast = true; return new ExpandedPair(leftChar, rightChar, pattern, mayBeLast); }
Example #12
Source File: RSSExpandedReader.java From weex with Apache License 2.0 | 5 votes |
private boolean checkChecksum() { ExpandedPair firstPair = this.pairs.get(0); DataCharacter checkCharacter = firstPair.getLeftChar(); DataCharacter firstCharacter = firstPair.getRightChar(); if (firstCharacter == null) { return false; } int checksum = firstCharacter.getChecksumPortion(); int s = 2; for(int i = 1; i < this.pairs.size(); ++i){ ExpandedPair currentPair = this.pairs.get(i); checksum += currentPair.getLeftChar().getChecksumPortion(); s++; DataCharacter currentRightChar = currentPair.getRightChar(); if (currentRightChar != null) { checksum += currentRightChar.getChecksumPortion(); s++; } } checksum %= 211; int checkCharacterValue = 211 * (s - 4) + checksum; return checkCharacterValue == checkCharacter.getValue(); }
Example #13
Source File: ExpandedPair.java From analyzer-of-android-for-Apache-Weex with Apache License 2.0 | 5 votes |
ExpandedPair(DataCharacter leftChar, DataCharacter rightChar, FinderPattern finderPattern, boolean mayBeLast) { this.leftChar = leftChar; this.rightChar = rightChar; this.finderPattern = finderPattern; this.mayBeLast = mayBeLast; }
Example #14
Source File: RSSExpandedReader.java From analyzer-of-android-for-Apache-Weex with Apache License 2.0 | 5 votes |
ExpandedPair retrieveNextPair(BitArray row, List<ExpandedPair> previousPairs, int rowNumber) throws NotFoundException { boolean isOddPattern = previousPairs.size() % 2 == 0; if (startFromEven) { isOddPattern = !isOddPattern; } FinderPattern pattern; boolean keepFinding = true; int forcedOffset = -1; do{ this.findNextPair(row, previousPairs, forcedOffset); pattern = parseFoundFinderPattern(row, rowNumber, isOddPattern); if (pattern == null){ forcedOffset = getNextSecondBar(row, this.startEnd[0]); } else { keepFinding = false; } }while(keepFinding); // When stacked symbol is split over multiple rows, there's no way to guess if this pair can be last or not. // boolean mayBeLast = checkPairSequence(previousPairs, pattern); DataCharacter leftChar = this.decodeDataCharacter(row, pattern, isOddPattern, true); if (!previousPairs.isEmpty() && previousPairs.get(previousPairs.size()-1).mustBeLast()) { throw NotFoundException.getNotFoundInstance(); } DataCharacter rightChar; try { rightChar = this.decodeDataCharacter(row, pattern, isOddPattern, false); } catch(NotFoundException ignored) { rightChar = null; } boolean mayBeLast = true; return new ExpandedPair(leftChar, rightChar, pattern, mayBeLast); }
Example #15
Source File: RSSExpandedReader.java From analyzer-of-android-for-Apache-Weex with Apache License 2.0 | 5 votes |
private boolean checkChecksum() { ExpandedPair firstPair = this.pairs.get(0); DataCharacter checkCharacter = firstPair.getLeftChar(); DataCharacter firstCharacter = firstPair.getRightChar(); if (firstCharacter == null) { return false; } int checksum = firstCharacter.getChecksumPortion(); int s = 2; for(int i = 1; i < this.pairs.size(); ++i){ ExpandedPair currentPair = this.pairs.get(i); checksum += currentPair.getLeftChar().getChecksumPortion(); s++; DataCharacter currentRightChar = currentPair.getRightChar(); if (currentRightChar != null) { checksum += currentRightChar.getChecksumPortion(); s++; } } checksum %= 211; int checkCharacterValue = 211 * (s - 4) + checksum; return checkCharacterValue == checkCharacter.getValue(); }
Example #16
Source File: ExpandedPair.java From ZXing-Orient with Apache License 2.0 | 5 votes |
ExpandedPair(DataCharacter leftChar, DataCharacter rightChar, FinderPattern finderPattern, boolean mayBeLast) { this.leftChar = leftChar; this.rightChar = rightChar; this.finderPattern = finderPattern; this.mayBeLast = mayBeLast; }
Example #17
Source File: RSSExpandedReader.java From ZXing-Orient with Apache License 2.0 | 5 votes |
private boolean checkChecksum() { ExpandedPair firstPair = this.pairs.get(0); DataCharacter checkCharacter = firstPair.getLeftChar(); DataCharacter firstCharacter = firstPair.getRightChar(); if (firstCharacter == null) { return false; } int checksum = firstCharacter.getChecksumPortion(); int s = 2; for(int i = 1; i < this.pairs.size(); ++i){ ExpandedPair currentPair = this.pairs.get(i); checksum += currentPair.getLeftChar().getChecksumPortion(); s++; DataCharacter currentRightChar = currentPair.getRightChar(); if (currentRightChar != null) { checksum += currentRightChar.getChecksumPortion(); s++; } } checksum %= 211; int checkCharacterValue = 211 * (s - 4) + checksum; return checkCharacterValue == checkCharacter.getValue(); }
Example #18
Source File: RSSExpandedReader.java From Tesseract-OCR-Scanner with Apache License 2.0 | 5 votes |
ExpandedPair retrieveNextPair(BitArray row, List<ExpandedPair> previousPairs, int rowNumber) throws NotFoundException { boolean isOddPattern = previousPairs.size() % 2 == 0; if (startFromEven) { isOddPattern = !isOddPattern; } FinderPattern pattern; boolean keepFinding = true; int forcedOffset = -1; do { this.findNextPair(row, previousPairs, forcedOffset); pattern = parseFoundFinderPattern(row, rowNumber, isOddPattern); if (pattern == null) { forcedOffset = getNextSecondBar(row, this.startEnd[0]); } else { keepFinding = false; } } while (keepFinding); // When stacked symbol is split over multiple rows, there's no way to guess if this pair can be last or not. // boolean mayBeLast = checkPairSequence(previousPairs, pattern); DataCharacter leftChar = this.decodeDataCharacter(row, pattern, isOddPattern, true); if (!previousPairs.isEmpty() && previousPairs.get(previousPairs.size() - 1).mustBeLast()) { throw NotFoundException.getNotFoundInstance(); } DataCharacter rightChar; try { rightChar = this.decodeDataCharacter(row, pattern, isOddPattern, false); } catch (NotFoundException ignored) { rightChar = null; } return new ExpandedPair(leftChar, rightChar, pattern, true); }
Example #19
Source File: ExpandedPair.java From Tesseract-OCR-Scanner with Apache License 2.0 | 5 votes |
ExpandedPair(DataCharacter leftChar, DataCharacter rightChar, FinderPattern finderPattern, boolean mayBeLast) { this.leftChar = leftChar; this.rightChar = rightChar; this.finderPattern = finderPattern; this.mayBeLast = mayBeLast; }
Example #20
Source File: RSSExpandedReader.java From Tesseract-OCR-Scanner with Apache License 2.0 | 5 votes |
private boolean checkChecksum() { ExpandedPair firstPair = this.pairs.get(0); DataCharacter checkCharacter = firstPair.getLeftChar(); DataCharacter firstCharacter = firstPair.getRightChar(); if (firstCharacter == null) { return false; } int checksum = firstCharacter.getChecksumPortion(); int s = 2; for (int i = 1; i < this.pairs.size(); ++i) { ExpandedPair currentPair = this.pairs.get(i); checksum += currentPair.getLeftChar().getChecksumPortion(); s++; DataCharacter currentRightChar = currentPair.getRightChar(); if (currentRightChar != null) { checksum += currentRightChar.getChecksumPortion(); s++; } } checksum %= 211; int checkCharacterValue = 211 * (s - 4) + checksum; return checkCharacterValue == checkCharacter.getValue(); }
Example #21
Source File: RSSExpandedReader.java From QrCodeScanner with GNU General Public License v3.0 | 5 votes |
private boolean checkChecksum() { ExpandedPair firstPair = this.pairs.get(0); DataCharacter checkCharacter = firstPair.getLeftChar(); DataCharacter firstCharacter = firstPair.getRightChar(); if (firstCharacter == null) { return false; } int checksum = firstCharacter.getChecksumPortion(); int s = 2; for (int i = 1; i < this.pairs.size(); ++i) { ExpandedPair currentPair = this.pairs.get(i); checksum += currentPair.getLeftChar().getChecksumPortion(); s++; DataCharacter currentRightChar = currentPair.getRightChar(); if (currentRightChar != null) { checksum += currentRightChar.getChecksumPortion(); s++; } } checksum %= 211; int checkCharacterValue = 211 * (s - 4) + checksum; return checkCharacterValue == checkCharacter.getValue(); }
Example #22
Source File: RSSExpandedReader.java From QrCodeScanner with GNU General Public License v3.0 | 5 votes |
ExpandedPair retrieveNextPair(BitArray row, List<ExpandedPair> previousPairs, int rowNumber) throws NotFoundException { boolean isOddPattern = previousPairs.size() % 2 == 0; if (startFromEven) { isOddPattern = !isOddPattern; } FinderPattern pattern; boolean keepFinding = true; int forcedOffset = -1; do { this.findNextPair(row, previousPairs, forcedOffset); pattern = parseFoundFinderPattern(row, rowNumber, isOddPattern); if (pattern == null) { forcedOffset = getNextSecondBar(row, this.startEnd[0]); } else { keepFinding = false; } } while (keepFinding); // When stacked symbol is split over multiple rows, there's no way to guess if this pair can be last or not. // boolean mayBeLast = checkPairSequence(previousPairs, pattern); DataCharacter leftChar = this.decodeDataCharacter(row, pattern, isOddPattern, true); if (!previousPairs.isEmpty() && previousPairs.get(previousPairs.size() - 1).mustBeLast()) { throw NotFoundException.getNotFoundInstance(); } DataCharacter rightChar; try { rightChar = this.decodeDataCharacter(row, pattern, isOddPattern, false); } catch (NotFoundException ignored) { rightChar = null; } return new ExpandedPair(leftChar, rightChar, pattern, true); }
Example #23
Source File: ExpandedPair.java From QrCodeScanner with GNU General Public License v3.0 | 5 votes |
ExpandedPair(DataCharacter leftChar, DataCharacter rightChar, FinderPattern finderPattern, boolean mayBeLast) { this.leftChar = leftChar; this.rightChar = rightChar; this.finderPattern = finderPattern; this.mayBeLast = mayBeLast; }
Example #24
Source File: ExpandedPair.java From ScreenCapture with MIT License | 5 votes |
ExpandedPair(DataCharacter leftChar, DataCharacter rightChar, FinderPattern finderPattern, boolean mayBeLast) { this.leftChar = leftChar; this.rightChar = rightChar; this.finderPattern = finderPattern; this.mayBeLast = mayBeLast; }
Example #25
Source File: RSSExpandedReader.java From ScreenCapture with MIT License | 5 votes |
private boolean checkChecksum() { ExpandedPair firstPair = this.pairs.get(0); DataCharacter checkCharacter = firstPair.getLeftChar(); DataCharacter firstCharacter = firstPair.getRightChar(); if (firstCharacter == null) { return false; } int checksum = firstCharacter.getChecksumPortion(); int s = 2; for (int i = 1; i < this.pairs.size(); ++i) { ExpandedPair currentPair = this.pairs.get(i); checksum += currentPair.getLeftChar().getChecksumPortion(); s++; DataCharacter currentRightChar = currentPair.getRightChar(); if (currentRightChar != null) { checksum += currentRightChar.getChecksumPortion(); s++; } } checksum %= 211; int checkCharacterValue = 211 * (s - 4) + checksum; return checkCharacterValue == checkCharacter.getValue(); }
Example #26
Source File: RSSExpandedReader.java From ZXing-Orient with Apache License 2.0 | 5 votes |
ExpandedPair retrieveNextPair(BitArray row, List<ExpandedPair> previousPairs, int rowNumber) throws NotFoundException { boolean isOddPattern = previousPairs.size() % 2 == 0; if (startFromEven) { isOddPattern = !isOddPattern; } FinderPattern pattern; boolean keepFinding = true; int forcedOffset = -1; do{ this.findNextPair(row, previousPairs, forcedOffset); pattern = parseFoundFinderPattern(row, rowNumber, isOddPattern); if (pattern == null){ forcedOffset = getNextSecondBar(row, this.startEnd[0]); } else { keepFinding = false; } }while(keepFinding); // When stacked symbol is split over multiple rows, there's no way to guess if this pair can be last or not. // boolean mayBeLast = checkPairSequence(previousPairs, pattern); DataCharacter leftChar = this.decodeDataCharacter(row, pattern, isOddPattern, true); if (!previousPairs.isEmpty() && previousPairs.get(previousPairs.size()-1).mustBeLast()) { throw NotFoundException.getNotFoundInstance(); } DataCharacter rightChar; try { rightChar = this.decodeDataCharacter(row, pattern, isOddPattern, false); } catch(NotFoundException ignored) { rightChar = null; } boolean mayBeLast = true; return new ExpandedPair(leftChar, rightChar, pattern, mayBeLast); }
Example #27
Source File: ExpandedPair.java From reacteu-app with MIT License | 4 votes |
DataCharacter getRightChar() { return this.rightChar; }
Example #28
Source File: ExpandedPair.java From reacteu-app with MIT License | 4 votes |
DataCharacter getLeftChar() { return this.leftChar; }
Example #29
Source File: ExpandedPair.java From ScreenCapture with MIT License | 4 votes |
DataCharacter getLeftChar() { return this.leftChar; }
Example #30
Source File: ExpandedPair.java From ScreenCapture with MIT License | 4 votes |
DataCharacter getRightChar() { return this.rightChar; }