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


Java PDF417Common.MIN_ROWS_IN_BARCODE属性代码示例

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


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

示例1: getBarcodeMetadata

BarcodeMetadata getBarcodeMetadata() {
  Codeword[] codewords = getCodewords();
  BarcodeValue barcodeColumnCount = new BarcodeValue();
  BarcodeValue barcodeRowCountUpperPart = new BarcodeValue();
  BarcodeValue barcodeRowCountLowerPart = new BarcodeValue();
  BarcodeValue barcodeECLevel = new BarcodeValue();
  for (Codeword codeword : codewords) {
    if (codeword == null) {
      continue;
    }
    codeword.setRowNumberAsRowIndicatorColumn();
    int rowIndicatorValue = codeword.getValue() % 30;
    int codewordRowNumber = codeword.getRowNumber();
    if (!isLeft) {
      codewordRowNumber += 2;
    }
    switch (codewordRowNumber % 3) {
      case 0:
        barcodeRowCountUpperPart.setValue(rowIndicatorValue * 3 + 1);
        break;
      case 1:
        barcodeECLevel.setValue(rowIndicatorValue / 3);
        barcodeRowCountLowerPart.setValue(rowIndicatorValue % 3);
        break;
      case 2:
        barcodeColumnCount.setValue(rowIndicatorValue + 1);
        break;
    }
  }
  // Maybe we should check if we have ambiguous values?
  if ((barcodeColumnCount.getValue().length == 0) ||
      (barcodeRowCountUpperPart.getValue().length == 0) ||
      (barcodeRowCountLowerPart.getValue().length == 0) ||
      (barcodeECLevel.getValue().length == 0) ||
      barcodeColumnCount.getValue()[0] < 1 ||
      barcodeRowCountUpperPart.getValue()[0] + barcodeRowCountLowerPart.getValue()[0] < PDF417Common.MIN_ROWS_IN_BARCODE ||
      barcodeRowCountUpperPart.getValue()[0] + barcodeRowCountLowerPart.getValue()[0] > PDF417Common.MAX_ROWS_IN_BARCODE) {
    return null;
  }
  BarcodeMetadata barcodeMetadata = new BarcodeMetadata(barcodeColumnCount.getValue()[0],
      barcodeRowCountUpperPart.getValue()[0], barcodeRowCountLowerPart.getValue()[0], barcodeECLevel.getValue()[0]);
  removeIncorrectCodewords(codewords, barcodeMetadata);
  return barcodeMetadata;
}
 
开发者ID:amap-demo,项目名称:weex-3d-map,代码行数:44,代码来源:DetectionResultRowIndicatorColumn.java

示例2: getBarcodeMetadata

BarcodeMetadata getBarcodeMetadata() {
    Codeword[] codewords = getCodewords();
    BarcodeValue barcodeColumnCount = new BarcodeValue();
    BarcodeValue barcodeRowCountUpperPart = new BarcodeValue();
    BarcodeValue barcodeRowCountLowerPart = new BarcodeValue();
    BarcodeValue barcodeECLevel = new BarcodeValue();
    for (Codeword codeword : codewords) {
        if (codeword == null) {
            continue;
        }
        codeword.setRowNumberAsRowIndicatorColumn();
        int rowIndicatorValue = codeword.getValue() % 30;
        int codewordRowNumber = codeword.getRowNumber();
        if (!isLeft) {
            codewordRowNumber += 2;
        }
        switch (codewordRowNumber % 3) {
            case 0:
                barcodeRowCountUpperPart.setValue(rowIndicatorValue * 3 + 1);
                break;
            case 1:
                barcodeECLevel.setValue(rowIndicatorValue / 3);
                barcodeRowCountLowerPart.setValue(rowIndicatorValue % 3);
                break;
            case 2:
                barcodeColumnCount.setValue(rowIndicatorValue + 1);
                break;
        }
    }
    // Maybe we should check if we have ambiguous values?
    if ((barcodeColumnCount.getValue().length == 0) ||
            (barcodeRowCountUpperPart.getValue().length == 0) ||
            (barcodeRowCountLowerPart.getValue().length == 0) ||
            (barcodeECLevel.getValue().length == 0) ||
            barcodeColumnCount.getValue()[0] < 1 ||
            barcodeRowCountUpperPart.getValue()[0] + barcodeRowCountLowerPart.getValue()[0] < PDF417Common.MIN_ROWS_IN_BARCODE ||
            barcodeRowCountUpperPart.getValue()[0] + barcodeRowCountLowerPart.getValue()[0] > PDF417Common.MAX_ROWS_IN_BARCODE) {
        return null;
    }
    BarcodeMetadata barcodeMetadata = new BarcodeMetadata(barcodeColumnCount.getValue()[0],
            barcodeRowCountUpperPart.getValue()[0], barcodeRowCountLowerPart.getValue()[0], barcodeECLevel.getValue()[0]);
    removeIncorrectCodewords(codewords, barcodeMetadata);
    return barcodeMetadata;
}
 
开发者ID:Ag47,项目名称:TrueTone,代码行数:44,代码来源:DetectionResultRowIndicatorColumn.java


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