Java 类com.google.zxing.aztec.encoder.AztecCode 实例源码

项目:weex-3d-map    文件:AztecWriter.java   
private static BitMatrix renderResult(AztecCode code, int width, int height) {
  BitMatrix input = code.getMatrix();
  if (input == null) {
    throw new IllegalStateException();
  }
  int inputWidth = input.getWidth();
  int inputHeight = input.getHeight();
  int outputWidth = Math.max(width, inputWidth);
  int outputHeight = Math.max(height, inputHeight);

  int multiple = Math.min(outputWidth / inputWidth, outputHeight / inputHeight);
  int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
  int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

  BitMatrix output = new BitMatrix(outputWidth, outputHeight);

  for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
    // Write the contents of this row of the barcode
    for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
      if (input.get(inputX, inputY)) {
        output.setRegion(outputX, outputY, multiple, multiple);
      }
    }
  }
  return output;
}
项目:PortraitZXing    文件:AztecWriter.java   
private static BitMatrix renderResult(AztecCode code, int width, int height) {
  BitMatrix input = code.getMatrix();
  if (input == null) {
    throw new IllegalStateException();
  }
  int inputWidth = input.getWidth();
  int inputHeight = input.getHeight();
  int outputWidth = Math.max(width, inputWidth);
  int outputHeight = Math.max(height, inputHeight);

  int multiple = Math.min(outputWidth / inputWidth, outputHeight / inputHeight);
  int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
  int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

  BitMatrix output = new BitMatrix(outputWidth, outputHeight);

  for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
    // Write the contents of this row of the barcode
    for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
      if (input.get(inputX, inputY)) {
        output.setRegion(outputX, outputY, multiple, multiple);
      }
    }
  }
  return output;
}
项目:PortraitZXing    文件:AztecWriter.java   
private static BitMatrix renderResult(AztecCode code, int width, int height) {
  BitMatrix input = code.getMatrix();
  if (input == null) {
    throw new IllegalStateException();
  }
  int inputWidth = input.getWidth();
  int inputHeight = input.getHeight();
  int outputWidth = Math.max(width, inputWidth);
  int outputHeight = Math.max(height, inputHeight);

  int multiple = Math.min(outputWidth / inputWidth, outputHeight / inputHeight);
  int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
  int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

  BitMatrix output = new BitMatrix(outputWidth, outputHeight);

  for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
    // Write the contents of this row of the barcode
    for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
      if (input.get(inputX, inputY)) {
        output.setRegion(outputX, outputY, multiple, multiple);
      }
    }
  }
  return output;
}
项目:ZXing-Orient    文件:AztecWriter.java   
private static BitMatrix renderResult(AztecCode code, int width, int height) {
  BitMatrix input = code.getMatrix();
  if (input == null) {
    throw new IllegalStateException();
  }
  int inputWidth = input.getWidth();
  int inputHeight = input.getHeight();
  int outputWidth = Math.max(width, inputWidth);
  int outputHeight = Math.max(height, inputHeight);

  int multiple = Math.min(outputWidth / inputWidth, outputHeight / inputHeight);
  int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
  int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

  BitMatrix output = new BitMatrix(outputWidth, outputHeight);

  for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
    // Write the contents of this row of the barcode
    for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
      if (input.get(inputX, inputY)) {
        output.setRegion(outputX, outputY, multiple, multiple);
      }
    }
  }
  return output;
}
项目:event-app    文件:AztecWriter.java   
private static BitMatrix renderResult(AztecCode code, int width, int height) {
  BitMatrix input = code.getMatrix();
  if (input == null) {
    throw new IllegalStateException();
  }
  int inputWidth = input.getWidth();
  int inputHeight = input.getHeight();
  int outputWidth = Math.max(width, inputWidth);
  int outputHeight = Math.max(height, inputHeight);

  int multiple = Math.min(outputWidth / inputWidth, outputHeight / inputHeight);
  int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
  int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

  BitMatrix output = new BitMatrix(outputWidth, outputHeight);

  for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
    // Write the contents of this row of the barcode
    for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
      if (input.get(inputX, inputY)) {
        output.setRegion(outputX, outputY, multiple, multiple);
      }
    }
  }
  return output;
}
项目:weex-analyzer-android    文件:AztecWriter.java   
private static BitMatrix renderResult(AztecCode code, int width, int height) {
  BitMatrix input = code.getMatrix();
  if (input == null) {
    throw new IllegalStateException();
  }
  int inputWidth = input.getWidth();
  int inputHeight = input.getHeight();
  int outputWidth = Math.max(width, inputWidth);
  int outputHeight = Math.max(height, inputHeight);

  int multiple = Math.min(outputWidth / inputWidth, outputHeight / inputHeight);
  int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
  int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

  BitMatrix output = new BitMatrix(outputWidth, outputHeight);

  for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
    // Write the contents of this row of the barcode
    for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
      if (input.get(inputX, inputY)) {
        output.setRegion(outputX, outputY, multiple, multiple);
      }
    }
  }
  return output;
}
项目:weex-3d-map    文件:AztecWriter.java   
private static BitMatrix renderResult(AztecCode code, int width, int height) {
  BitMatrix input = code.getMatrix();
  if (input == null) {
    throw new IllegalStateException();
  }
  int inputWidth = input.getWidth();
  int inputHeight = input.getHeight();
  int outputWidth = Math.max(width, inputWidth);
  int outputHeight = Math.max(height, inputHeight);

  int multiple = Math.min(outputWidth / inputWidth, outputHeight / inputHeight);
  int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
  int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

  BitMatrix output = new BitMatrix(outputWidth, outputHeight);

  for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
    // Write the contents of this row of the barcode
    for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
      if (input.get(inputX, inputY)) {
        output.setRegion(outputX, outputY, multiple, multiple);
      }
    }
  }
  return output;
}
项目:Weex-TestDemo    文件:AztecWriter.java   
private static BitMatrix renderResult(AztecCode code, int width, int height) {
  BitMatrix input = code.getMatrix();
  if (input == null) {
    throw new IllegalStateException();
  }
  int inputWidth = input.getWidth();
  int inputHeight = input.getHeight();
  int outputWidth = Math.max(width, inputWidth);
  int outputHeight = Math.max(height, inputHeight);

  int multiple = Math.min(outputWidth / inputWidth, outputHeight / inputHeight);
  int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
  int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

  BitMatrix output = new BitMatrix(outputWidth, outputHeight);

  for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
    // Write the contents of this row of the barcode
    for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
      if (input.get(inputX, inputY)) {
        output.setRegion(outputX, outputY, multiple, multiple);
      }
    }
  }
  return output;
}
项目:Cardstore    文件:AztecWriter.java   
private static BitMatrix renderResult(AztecCode code, int width, int height) {
  BitMatrix input = code.getMatrix();
  if (input == null) {
    throw new IllegalStateException();
  }
  int inputWidth = input.getWidth();
  int inputHeight = input.getHeight();
  int outputWidth = Math.max(width, inputWidth);
  int outputHeight = Math.max(height, inputHeight);

  int multiple = Math.min(outputWidth / inputWidth, outputHeight / inputHeight);
  int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
  int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

  BitMatrix output = new BitMatrix(outputWidth, outputHeight);

  for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
    // Write the contents of this row of the barcode
    for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
      if (input.get(inputX, inputY)) {
        output.setRegion(outputX, outputY, multiple, multiple);
      }
    }
  }
  return output;
}
项目:QrScan_Demo    文件:AztecWriter.java   
private static BitMatrix renderResult(AztecCode code, int width, int height) {
  BitMatrix input = code.getMatrix();
  if (input == null) {
    throw new IllegalStateException();
  }
  int inputWidth = input.getWidth();
  int inputHeight = input.getHeight();
  int outputWidth = Math.max(width, inputWidth);
  int outputHeight = Math.max(height, inputHeight);

  int multiple = Math.min(outputWidth / inputWidth, outputHeight / inputHeight);
  int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
  int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

  BitMatrix output = new BitMatrix(outputWidth, outputHeight);

  for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
    // Write the contents of this row of the barcode
    for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
      if (input.get(inputX, inputY)) {
        output.setRegion(outputX, outputY, multiple, multiple);
      }
    }
  }
  return output;
}
项目:weex    文件:AztecWriter.java   
private static BitMatrix renderResult(AztecCode code, int width, int height) {
  BitMatrix input = code.getMatrix();
  if (input == null) {
    throw new IllegalStateException();
  }
  int inputWidth = input.getWidth();
  int inputHeight = input.getHeight();
  int outputWidth = Math.max(width, inputWidth);
  int outputHeight = Math.max(height, inputHeight);

  int multiple = Math.min(outputWidth / inputWidth, outputHeight / inputHeight);
  int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
  int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

  BitMatrix output = new BitMatrix(outputWidth, outputHeight);

  for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
    // Write the contents of this row of the barcode
    for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
      if (input.get(inputX, inputY)) {
        output.setRegion(outputX, outputY, multiple, multiple);
      }
    }
  }
  return output;
}
项目:TrueTone    文件:AztecWriter.java   
private static BitMatrix renderResult(AztecCode code, int width, int height) {
    BitMatrix input = code.getMatrix();
    if (input == null) {
        throw new IllegalStateException();
    }
    int inputWidth = input.getWidth();
    int inputHeight = input.getHeight();
    int outputWidth = Math.max(width, inputWidth);
    int outputHeight = Math.max(height, inputHeight);

    int multiple = Math.min(outputWidth / inputWidth, outputHeight / inputHeight);
    int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
    int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

    BitMatrix output = new BitMatrix(outputWidth, outputHeight);

    for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
        // Write the contents of this row of the barcode
        for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
            if (input.get(inputX, inputY)) {
                output.setRegion(outputX, outputY, multiple, multiple);
            }
        }
    }
    return output;
}
项目:bushido-android-app    文件:AztecWriter.java   
private static BitMatrix renderResult(AztecCode code, int width, int height) {
  BitMatrix input = code.getMatrix();
  if (input == null) {
    throw new IllegalStateException();
  }
  int inputWidth = input.getWidth();
  int inputHeight = input.getHeight();
  int outputWidth = Math.max(width, inputWidth);
  int outputHeight = Math.max(height, inputHeight);

  int multiple = Math.min(outputWidth / inputWidth, outputHeight / inputHeight);
  int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
  int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

  BitMatrix output = new BitMatrix(outputWidth, outputHeight);

  for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
    // Write the contents of this row of the barcode
    for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
      if (input.get(inputX, inputY)) {
        output.setRegion(outputX, outputY, multiple, multiple);
      }
    }
  }
  return output;
}
项目:Android-Birdcopy-Application    文件:AztecWriter.java   
private static BitMatrix renderResult(AztecCode code, int width, int height) {
  BitMatrix input = code.getMatrix();
  if (input == null) {
    throw new IllegalStateException();
  }
  int inputWidth = input.getWidth();
  int inputHeight = input.getHeight();
  int outputWidth = Math.max(width, inputWidth);
  int outputHeight = Math.max(height, inputHeight);

  int multiple = Math.min(outputWidth / inputWidth, outputHeight / inputHeight);
  int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
  int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

  BitMatrix output = new BitMatrix(outputWidth, outputHeight);

  for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
    // Write the contents of this row of the barcode
    for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
      if (input.get(inputX, inputY)) {
        output.setRegion(outputX, outputY, multiple, multiple);
      }
    }
  }
  return output;
}
项目:zxing-bsplus    文件:AztecWriter.java   
private static BitMatrix renderResult(AztecCode code, int width, int height) {
  BitMatrix input = code.getMatrix();
  if (input == null) {
    throw new IllegalStateException();
  }
  int inputWidth = input.getWidth();
  int inputHeight = input.getHeight();
  int outputWidth = Math.max(width, inputWidth);
  int outputHeight = Math.max(height, inputHeight);

  int multiple = Math.min(outputWidth / inputWidth, outputHeight / inputHeight);
  int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
  int topPadding = (outputHeight - (inputHeight * multiple)) / 2;

  BitMatrix output = new BitMatrix(outputWidth, outputHeight);

  for (int inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
    // Write the contents of this row of the barcode
    for (int inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
      if (input.get(inputX, inputY)) {
        output.setRegion(outputX, outputY, multiple, multiple);
      }
    }
  }
  return output;
}
项目:weex-3d-map    文件:AztecWriter.java   
private static BitMatrix encode(String contents, BarcodeFormat format,
                                int width, int height,
                                Charset charset, int eccPercent, int layers) {
  if (format != BarcodeFormat.AZTEC) {
    throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
  }
  AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent, layers);
  return renderResult(aztec, width, height);
}
项目:boohee_v5.6    文件:AztecWriter.java   
private static BitMatrix renderResult(AztecCode code, int width, int height) {
    BitMatrix input = code.getMatrix();
    if (input == null) {
        throw new IllegalStateException();
    }
    int inputWidth = input.getWidth();
    int inputHeight = input.getHeight();
    int outputWidth = Math.max(width, inputWidth);
    int outputHeight = Math.max(height, inputHeight);
    int multiple = Math.min(outputWidth / inputWidth, outputHeight / inputHeight);
    int leftPadding = (outputWidth - (inputWidth * multiple)) / 2;
    int topPadding = (outputHeight - (inputHeight * multiple)) / 2;
    BitMatrix output = new BitMatrix(outputWidth, outputHeight);
    int inputY = 0;
    int outputY = topPadding;
    while (inputY < inputHeight) {
        int inputX = 0;
        int outputX = leftPadding;
        while (inputX < inputWidth) {
            if (input.get(inputX, inputY)) {
                output.setRegion(outputX, outputY, multiple, multiple);
            }
            inputX++;
            outputX += multiple;
        }
        inputY++;
        outputY += multiple;
    }
    return output;
}
项目:PortraitZXing    文件:AztecWriter.java   
private static BitMatrix encode(String contents, BarcodeFormat format,
                                int width, int height,
                                Charset charset, int eccPercent, int layers) {
  if (format != BarcodeFormat.AZTEC) {
    throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
  }
  AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent, layers);
  return renderResult(aztec, width, height);
}
项目:PortraitZXing    文件:AztecWriter.java   
private static BitMatrix encode(String contents, BarcodeFormat format,
                                int width, int height,
                                Charset charset, int eccPercent, int layers) {
  if (format != BarcodeFormat.AZTEC) {
    throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
  }
  AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent, layers);
  return renderResult(aztec, width, height);
}
项目:ZXing-Orient    文件:AztecWriter.java   
private static BitMatrix encode(String contents, BarcodeFormat format,
                                int width, int height,
                                Charset charset, int eccPercent, int layers) {
  if (format != BarcodeFormat.AZTEC) {
    throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
  }
  AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent, layers);
  return renderResult(aztec, width, height);
}
项目:event-app    文件:AztecWriter.java   
private static BitMatrix encode(String contents, BarcodeFormat format,
                                int width, int height,
                                Charset charset, int eccPercent, int layers) {
  if (format != BarcodeFormat.AZTEC) {
    throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
  }
  AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent, layers);
  return renderResult(aztec, width, height);
}
项目:weex-analyzer-android    文件:AztecWriter.java   
private static BitMatrix encode(String contents, BarcodeFormat format,
                                int width, int height,
                                Charset charset, int eccPercent, int layers) {
  if (format != BarcodeFormat.AZTEC) {
    throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
  }
  AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent, layers);
  return renderResult(aztec, width, height);
}
项目:weex-3d-map    文件:AztecWriter.java   
private static BitMatrix encode(String contents, BarcodeFormat format,
                                int width, int height,
                                Charset charset, int eccPercent, int layers) {
  if (format != BarcodeFormat.AZTEC) {
    throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
  }
  AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent, layers);
  return renderResult(aztec, width, height);
}
项目:Weex-TestDemo    文件:AztecWriter.java   
private static BitMatrix encode(String contents, BarcodeFormat format,
                                int width, int height,
                                Charset charset, int eccPercent, int layers) {
  if (format != BarcodeFormat.AZTEC) {
    throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
  }
  AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent, layers);
  return renderResult(aztec, width, height);
}
项目:Cardstore    文件:AztecWriter.java   
private static BitMatrix encode(String contents, BarcodeFormat format,
                                int width, int height,
                                Charset charset, int eccPercent, int layers) {
  if (format != BarcodeFormat.AZTEC) {
    throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
  }
  AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent, layers);
  return renderResult(aztec, width, height);
}
项目:QrScan_Demo    文件:AztecWriter.java   
private static BitMatrix encode(String contents, BarcodeFormat format,
                                int width, int height,
                                Charset charset, int eccPercent, int layers) {
  if (format != BarcodeFormat.AZTEC) {
    throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
  }
  AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent, layers);
  return renderResult(aztec, width, height);
}
项目:weex    文件:AztecWriter.java   
private static BitMatrix encode(String contents, BarcodeFormat format,
                                int width, int height,
                                Charset charset, int eccPercent, int layers) {
  if (format != BarcodeFormat.AZTEC) {
    throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
  }
  AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent, layers);
  return renderResult(aztec, width, height);
}
项目:TrueTone    文件:AztecWriter.java   
private static BitMatrix encode(String contents, BarcodeFormat format,
                                int width, int height,
                                Charset charset, int eccPercent, int layers) {
    if (format != BarcodeFormat.AZTEC) {
        throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
    }
    AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent, layers);
    return renderResult(aztec, width, height);
}
项目:Discounty    文件:AztecWriter.java   
private static BitMatrix encode(String contents, BarcodeFormat format, Charset charset, int eccPercent) {
    if (format != BarcodeFormat.AZTEC) {
        throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
    }
    AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent);
    return aztec.getMatrix();
}
项目:bushido-android-app    文件:AztecWriter.java   
private static BitMatrix encode(String contents, BarcodeFormat format,
                                int width, int height,
                                Charset charset, int eccPercent, int layers) {
  if (format != BarcodeFormat.AZTEC) {
    throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
  }
  AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent, layers);
  return renderResult(aztec, width, height);
}
项目:Android-Birdcopy-Application    文件:AztecWriter.java   
private static BitMatrix encode(String contents, BarcodeFormat format,
                                int width, int height,
                                Charset charset, int eccPercent, int layers) {
  if (format != BarcodeFormat.AZTEC) {
    throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
  }
  AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent, layers);
  return renderResult(aztec, width, height);
}
项目:zxing-bsplus    文件:AztecWriter.java   
private static BitMatrix encode(String contents, BarcodeFormat format,
                                int width, int height,
                                Charset charset, int eccPercent, int layers) {
  if (format != BarcodeFormat.AZTEC) {
    throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
  }
  AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent, layers);
  return renderResult(aztec, width, height);
}
项目:zxing-bsplus    文件:DetectorTest.java   
private static List<Point> getOrientationPoints(AztecCode code) {
  int center = code.getMatrix().getWidth() / 2;
  int offset = code.isCompact() ? 5 : 7;
  List<Point> result = new ArrayList<>();
  for (int xSign = -1; xSign <= 1; xSign += 2) {
    for (int ySign = -1; ySign <= 1; ySign += 2) {
      result.add(new Point(center + xSign * offset, center + ySign * offset));
      result.add(new Point(center + xSign * (offset - 1), center + ySign * offset));
      result.add(new Point(center + xSign * offset, center + ySign * (offset - 1)));
    }
  }
  return result;
}
项目:ZxingCore    文件:AztecWriter.java   
private static BitMatrix encode(String contents, BarcodeFormat format, Charset charset, int eccPercent) {
  if (format != BarcodeFormat.AZTEC) {
    throw new IllegalArgumentException("Can only encode AZTEC, but got " + format);
  }
  AztecCode aztec = Encoder.encode(contents.getBytes(charset), eccPercent);
  return aztec.getMatrix();
}