当前位置: 首页>>代码示例>>Java>>正文


Java NotFoundException.getNotFoundInstance方法代码示例

本文整理汇总了Java中com.google.zxing.NotFoundException.getNotFoundInstance方法的典型用法代码示例。如果您正苦于以下问题:Java NotFoundException.getNotFoundInstance方法的具体用法?Java NotFoundException.getNotFoundInstance怎么用?Java NotFoundException.getNotFoundInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.zxing.NotFoundException的用法示例。


在下文中一共展示了NotFoundException.getNotFoundInstance方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: recordPatternInReverse

import com.google.zxing.NotFoundException; //导入方法依赖的package包/类
protected static void recordPatternInReverse(BitArray row, int start, int[] counters) throws
        NotFoundException {
    int numTransitionsLeft = counters.length;
    boolean last = row.get(start);
    while (start > 0 && numTransitionsLeft >= 0) {
        start--;
        if (row.get(start) != last) {
            numTransitionsLeft--;
            last = !last;
        }
    }
    if (numTransitionsLeft >= 0) {
        throw NotFoundException.getNotFoundInstance();
    }
    recordPattern(row, start + 1, counters);
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:17,代码来源:OneDReader.java

示例2: detectMulti

import com.google.zxing.NotFoundException; //导入方法依赖的package包/类
public DetectorResult[] detectMulti(Map<DecodeHintType,?> hints) throws NotFoundException {
  BitMatrix image = getImage();
  ResultPointCallback resultPointCallback =
      hints == null ? null : (ResultPointCallback) hints.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK);
  MultiFinderPatternFinder finder = new MultiFinderPatternFinder(image, resultPointCallback);
  FinderPatternInfo[] infos = finder.findMulti(hints);

  if (infos.length == 0) {
    throw NotFoundException.getNotFoundInstance();
  }

  List<DetectorResult> result = new ArrayList<>();
  for (FinderPatternInfo info : infos) {
    try {
      result.add(processFinderPatternInfo(info));
    } catch (ReaderException e) {
      // ignore
    }
  }
  if (result.isEmpty()) {
    return EMPTY_DETECTOR_RESULTS;
  } else {
    return result.toArray(new DetectorResult[result.size()]);
  }
}
 
开发者ID:10045125,项目名称:QrCode,代码行数:26,代码来源:MultiDetector.java

示例3: recordPatternInReverse

import com.google.zxing.NotFoundException; //导入方法依赖的package包/类
protected static void recordPatternInReverse(BitArray row, int start, int[] counters)
    throws NotFoundException {
  // This could be more efficient I guess
  int numTransitionsLeft = counters.length;
  boolean last = row.get(start);
  while (start > 0 && numTransitionsLeft >= 0) {
    if (row.get(--start) != last) {
      numTransitionsLeft--;
      last = !last;
    }
  }
  if (numTransitionsLeft >= 0) {
    throw NotFoundException.getNotFoundInstance();
  }
  recordPattern(row, start + 1, counters);
}
 
开发者ID:simplezhli,项目名称:Tesseract-OCR-Scanner,代码行数:17,代码来源:OneDReader.java

示例4: findStartPattern

import com.google.zxing.NotFoundException; //导入方法依赖的package包/类
private int findStartPattern() throws NotFoundException {
  for (int i = 1; i < counterLength; i += 2) {
    int charOffset = toNarrowWidePattern(i);
    if (charOffset != -1 && arrayContains(STARTEND_ENCODING, ALPHABET[charOffset])) {
      // Look for whitespace before start pattern, >= 50% of width of start pattern
      // We make an exception if the whitespace is the first element.
      int patternSize = 0;
      for (int j = i; j < i + 7; j++) {
        patternSize += counters[j];
      }
      if (i == 1 || counters[i-1] >= patternSize / 2) {
        return i;
      }
    }
  }
  throw NotFoundException.getNotFoundInstance();
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:18,代码来源:CodaBarReader.java

示例5: computeDimension

import com.google.zxing.NotFoundException; //导入方法依赖的package包/类
/**
 * <p>Computes the dimension (number of modules on a size) of the QR Code based on the position
 * of the finder patterns and estimated module size.</p>
 */
private static int computeDimension(ResultPoint topLeft,
                                    ResultPoint topRight,
                                    ResultPoint bottomLeft,
                                    float moduleSize) throws NotFoundException {
  int tltrCentersDimension = MathUtils.round(ResultPoint.distance(topLeft, topRight) / moduleSize);
  int tlblCentersDimension = MathUtils.round(ResultPoint.distance(topLeft, bottomLeft) / moduleSize);
  int dimension = ((tltrCentersDimension + tlblCentersDimension) / 2) + 7;
  switch (dimension & 0x03) { // mod 4
    case 0:
      dimension++;
      break;
      // 1? do nothing
    case 2:
      dimension--;
      break;
    case 3:
      throw NotFoundException.getNotFoundInstance();
  }
  return dimension;
}
 
开发者ID:10045125,项目名称:QrCode,代码行数:25,代码来源:Detector.java

示例6: decodeDigit

import com.google.zxing.NotFoundException; //导入方法依赖的package包/类
/**
 * Attempts to decode a sequence of ITF black/white lines into single
 * digit.
 *
 * @param counters the counts of runs of observed black/white/black/... values
 * @return The decoded digit
 * @throws NotFoundException if digit cannot be decoded
 */
private static int decodeDigit(int[] counters) throws NotFoundException {
  float bestVariance = MAX_AVG_VARIANCE; // worst variance we'll accept
  int bestMatch = -1;
  int max = PATTERNS.length;
  for (int i = 0; i < max; i++) {
    int[] pattern = PATTERNS[i];
    float variance = patternMatchVariance(counters, pattern, MAX_INDIVIDUAL_VARIANCE);
    if (variance < bestVariance) {
      bestVariance = variance;
      bestMatch = i;
    }
  }
  if (bestMatch >= 0) {
    return bestMatch;
  } else {
    throw NotFoundException.getNotFoundInstance();
  }
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:27,代码来源:ITFReader.java

示例7: determineCheckDigit

import com.google.zxing.NotFoundException; //导入方法依赖的package包/类
private static int determineCheckDigit(int lgPatternFound)
    throws NotFoundException {
  for (int d = 0; d < 10; d++) {
    if (lgPatternFound == CHECK_DIGIT_ENCODINGS[d]) {
      return d;
    }
  }
  throw NotFoundException.getNotFoundInstance();
}
 
开发者ID:simplezhli,项目名称:Tesseract-OCR-Scanner,代码行数:10,代码来源:UPCEANExtension5Support.java

示例8: parseInformation

import com.google.zxing.NotFoundException; //导入方法依赖的package包/类
public String parseInformation() throws NotFoundException {
    if (getInformation().getSize() != 84) {
        throw NotFoundException.getNotFoundInstance();
    }
    StringBuilder buf = new StringBuilder();
    encodeCompressedGtin(buf, 8);
    encodeCompressedWeight(buf, 48, 20);
    encodeCompressedDate(buf, 68);
    return buf.toString();
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:AI013x0x1xDecoder.java

示例9: BoundingBox

import com.google.zxing.NotFoundException; //导入方法依赖的package包/类
BoundingBox(BitMatrix image, ResultPoint topLeft, ResultPoint bottomLeft, ResultPoint
        topRight, ResultPoint bottomRight) throws NotFoundException {
    if (!(topLeft == null && topRight == null) && (!(bottomLeft == null && bottomRight ==
            null) && ((topLeft == null || bottomLeft != null) && (topRight == null ||
            bottomRight != null)))) {
        init(image, topLeft, bottomLeft, topRight, bottomRight);
        return;
    }
    throw NotFoundException.getNotFoundInstance();
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:11,代码来源:BoundingBox.java

示例10: patternToChar

import com.google.zxing.NotFoundException; //导入方法依赖的package包/类
private static char patternToChar(int pattern) throws NotFoundException {
  for (int i = 0; i < CHARACTER_ENCODINGS.length; i++) {
    if (CHARACTER_ENCODINGS[i] == pattern) {
      return ALPHABET[i];
    }
  }
  throw NotFoundException.getNotFoundInstance();
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:9,代码来源:Code93Reader.java

示例11: patternToChar

import com.google.zxing.NotFoundException; //导入方法依赖的package包/类
private static char patternToChar(int pattern) throws NotFoundException {
  for (int i = 0; i < CHARACTER_ENCODINGS.length; i++) {
    if (CHARACTER_ENCODINGS[i] == pattern) {
      return ALPHABET_STRING.charAt(i);
    }
  }
  throw NotFoundException.getNotFoundInstance();
}
 
开发者ID:10045125,项目名称:QrCode,代码行数:9,代码来源:Code39Reader.java

示例12: parseInformation

import com.google.zxing.NotFoundException; //导入方法依赖的package包/类
@Override
public String parseInformation() throws NotFoundException {
  if (this.getInformation().getSize() != HEADER_SIZE + GTIN_SIZE + WEIGHT_SIZE) {
    throw NotFoundException.getNotFoundInstance();
  }

  StringBuilder buf = new StringBuilder();

  encodeCompressedGtin(buf, HEADER_SIZE);
  encodeCompressedWeight(buf, HEADER_SIZE + GTIN_SIZE, WEIGHT_SIZE);

  return buf.toString();
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:14,代码来源:AI013x0xDecoder.java

示例13: decodeRow

import com.google.zxing.NotFoundException; //导入方法依赖的package包/类
@Override
public Result decodeRow(int rowNumber,
                        BitArray row,
                        Map<DecodeHintType,?> hints) throws NotFoundException {
  for (OneDReader reader : readers) {
    try {
      return reader.decodeRow(rowNumber, row, hints);
    } catch (ReaderException re) {
      // continue
    }
  }

  throw NotFoundException.getNotFoundInstance();
}
 
开发者ID:simplezhli,项目名称:Tesseract-OCR-Scanner,代码行数:15,代码来源:MultiFormatOneDReader.java

示例14: decodeRow2pairs

import com.google.zxing.NotFoundException; //导入方法依赖的package包/类
List<ExpandedPair> decodeRow2pairs(int rowNumber, BitArray row) throws NotFoundException {
    while (true) {
        try {
            this.pairs.add(retrieveNextPair(row, this.pairs, rowNumber));
        } catch (NotFoundException nfe) {
            if (this.pairs.isEmpty()) {
                throw nfe;
            } else if (checkChecksum()) {
                return this.pairs;
            } else {
                boolean tryStackedDecode;
                if (this.rows.isEmpty()) {
                    tryStackedDecode = false;
                } else {
                    tryStackedDecode = true;
                }
                storeRow(rowNumber, false);
                if (tryStackedDecode) {
                    List<ExpandedPair> ps = checkRows(false);
                    if (ps != null) {
                        return ps;
                    }
                    ps = checkRows(true);
                    if (ps != null) {
                        return ps;
                    }
                }
                throw NotFoundException.getNotFoundInstance();
            }
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:33,代码来源:RSSExpandedReader.java

示例15: findAsteriskPattern

import com.google.zxing.NotFoundException; //导入方法依赖的package包/类
private static int[] findAsteriskPattern(BitArray row, int[] counters) throws NotFoundException {
  int width = row.getSize();
  int rowOffset = row.getNextSet(0);

  int counterPosition = 0;
  int patternStart = rowOffset;
  boolean isWhite = false;
  int patternLength = counters.length;

  for (int i = rowOffset; i < width; i++) {
    if (row.get(i) ^ isWhite) {
      counters[counterPosition]++;
    } else {
      if (counterPosition == patternLength - 1) {
        // Look for whitespace before start pattern, >= 50% of width of start pattern
        if (toNarrowWidePattern(counters) == ASTERISK_ENCODING &&
            row.isRange(Math.max(0, patternStart - ((i - patternStart) / 2)), patternStart, false)) {
          return new int[]{patternStart, i};
        }
        patternStart += counters[0] + counters[1];
        System.arraycopy(counters, 2, counters, 0, patternLength - 2);
        counters[patternLength - 2] = 0;
        counters[patternLength - 1] = 0;
        counterPosition--;
      } else {
        counterPosition++;
      }
      counters[counterPosition] = 1;
      isWhite = !isWhite;
    }
  }
  throw NotFoundException.getNotFoundInstance();
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:34,代码来源:Code39Reader.java


注:本文中的com.google.zxing.NotFoundException.getNotFoundInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。