本文整理汇总了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;
}
示例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;
}