mirror of
https://github.com/zxing/zxing.git
synced 2025-02-02 05:41:08 -08:00
Issue 658
git-svn-id: https://zxing.googlecode.com/svn/trunk@1678 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
parent
5ccb14d81d
commit
8c172f4891
|
@ -85,6 +85,7 @@ public final class Decoder {
|
||||||
private int numCodewords;
|
private int numCodewords;
|
||||||
private int codewordSize;
|
private int codewordSize;
|
||||||
private AztecDetectorResult ddata;
|
private AztecDetectorResult ddata;
|
||||||
|
private int invertedBitCount;
|
||||||
|
|
||||||
public DecoderResult decode(AztecDetectorResult detectorResult) throws FormatException {
|
public DecoderResult decode(AztecDetectorResult detectorResult) throws FormatException {
|
||||||
ddata = detectorResult;
|
ddata = detectorResult;
|
||||||
|
@ -113,7 +114,7 @@ public final class Decoder {
|
||||||
*/
|
*/
|
||||||
private String getEncodedData(boolean[] correctedBits) throws FormatException {
|
private String getEncodedData(boolean[] correctedBits) throws FormatException {
|
||||||
|
|
||||||
int endIndex = codewordSize * ddata.getNbDatablocks();
|
int endIndex = codewordSize * ddata.getNbDatablocks() - invertedBitCount;
|
||||||
if (endIndex > correctedBits.length) {
|
if (endIndex > correctedBits.length) {
|
||||||
throw FormatException.getFormatInstance();
|
throw FormatException.getFormatInstance();
|
||||||
}
|
}
|
||||||
|
@ -303,6 +304,7 @@ public final class Decoder {
|
||||||
}
|
}
|
||||||
|
|
||||||
offset = 0;
|
offset = 0;
|
||||||
|
invertedBitCount = 0;
|
||||||
|
|
||||||
boolean[] correctedBits = new boolean[numDataCodewords*codewordSize];
|
boolean[] correctedBits = new boolean[numDataCodewords*codewordSize];
|
||||||
for (int i = 0; i < numDataCodewords; i ++) {
|
for (int i = 0; i < numDataCodewords; i ++) {
|
||||||
|
@ -325,6 +327,7 @@ public final class Decoder {
|
||||||
seriesColor = false;
|
seriesColor = false;
|
||||||
seriesCount = 0;
|
seriesCount = 0;
|
||||||
offset++;
|
offset++;
|
||||||
|
invertedBitCount++;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (seriesColor == color) {
|
if (seriesColor == color) {
|
||||||
|
|
BIN
core/test/data/blackbox/aztec-1/7.png
Normal file
BIN
core/test/data/blackbox/aztec-1/7.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 728 B |
1
core/test/data/blackbox/aztec-1/7.txt
Normal file
1
core/test/data/blackbox/aztec-1/7.txt
Normal file
|
@ -0,0 +1 @@
|
||||||
|
Code 2D!
|
|
@ -26,10 +26,10 @@ public final class AztecBlackBox1TestCase extends AbstractBlackBoxTestCase {
|
||||||
|
|
||||||
public AztecBlackBox1TestCase() {
|
public AztecBlackBox1TestCase() {
|
||||||
super("test/data/blackbox/aztec-1", new AztecReader(), BarcodeFormat.AZTEC);
|
super("test/data/blackbox/aztec-1", new AztecReader(), BarcodeFormat.AZTEC);
|
||||||
addTest(6, 6, 0.0f);
|
addTest(7, 7, 0.0f);
|
||||||
addTest(6, 6, 90.0f);
|
addTest(7, 7, 90.0f);
|
||||||
addTest(6, 6, 180.0f);
|
addTest(7, 7, 180.0f);
|
||||||
addTest(6, 6, 270.0f);
|
addTest(7, 7, 270.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in a new issue