类com.google.zxing.aztec.decoder.Decoder源码实例Demo

下面列出了怎么用com.google.zxing.aztec.decoder.Decoder的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: reacteu-app   文件: AztecReader.java

@Override
public Result decode(BinaryBitmap image, Map<DecodeHintType,?> hints)
    throws NotFoundException, FormatException {

  AztecDetectorResult detectorResult = new Detector(image.getBlackMatrix()).detect();
  ResultPoint[] points = detectorResult.getPoints();

  if (hints != null) {
    ResultPointCallback rpcb = (ResultPointCallback) hints.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK);
    if (rpcb != null) {
      for (ResultPoint point : points) {
        rpcb.foundPossibleResultPoint(point);
      }
    }
  }

  DecoderResult decoderResult = new Decoder().decode(detectorResult);

  Result result = new Result(decoderResult.getText(), decoderResult.getRawBytes(), points, BarcodeFormat.AZTEC);
  
  List<byte[]> byteSegments = decoderResult.getByteSegments();
  if (byteSegments != null) {
    result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, byteSegments);
  }
  String ecLevel = decoderResult.getECLevel();
  if (ecLevel != null) {
    result.putMetadata(ResultMetadataType.ERROR_CORRECTION_LEVEL, ecLevel);
  }
  
  return result;
}
 
源代码2 项目: MiBandDecompiled   文件: AztecReader.java

public Result decode(BinaryBitmap binarybitmap, Map map)
{
    AztecDetectorResult aztecdetectorresult = (new Detector(binarybitmap.getBlackMatrix())).detect();
    com.google.zxing.ResultPoint aresultpoint[] = aztecdetectorresult.getPoints();
    if (map != null)
    {
        ResultPointCallback resultpointcallback = (ResultPointCallback)map.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK);
        if (resultpointcallback != null)
        {
            int i = aresultpoint.length;
            for (int j = 0; j < i; j++)
            {
                resultpointcallback.foundPossibleResultPoint(aresultpoint[j]);
            }

        }
    }
    DecoderResult decoderresult = (new Decoder()).decode(aztecdetectorresult);
    Result result = new Result(decoderresult.getText(), decoderresult.getRawBytes(), aresultpoint, BarcodeFormat.AZTEC);
    java.util.List list = decoderresult.getByteSegments();
    if (list != null)
    {
        result.putMetadata(ResultMetadataType.BYTE_SEGMENTS, list);
    }
    String s = decoderresult.getECLevel();
    if (s != null)
    {
        result.putMetadata(ResultMetadataType.ERROR_CORRECTION_LEVEL, s);
    }
    return result;
}
 
 类所在包
 同包方法