@Test public void testAztecResult() throws FormatException { BitMatrix matrix = BitMatrix.parse( "X X X X X X X X X X X X X X \n" + "X X X X X X X X X X X X X X X \n" + " X X X X X X X X X X X X \n" + " X X X X X X X X X X \n" + " X X X X X X X X \n" + " X X X X X X X X X X X X X X X X X X \n" + " X X X X X X X X X \n" + " X X X X X X X X X X X X X X X X X \n" + " X X X X X X X X X \n" + " X X X X X X X X X X X X X X X X \n" + " X X X X X X X X X X X X \n" + " X X X X X X X X X X X \n" + " X X X X X X X X X X X X \n" + " X X X X X X X X X X X X X X X X X \n" + "X X X X X X X X X X X \n" + " X X X X X X X X X X X X X X \n" + " X X X X X X X X \n" + " X X X X X X X X X X X X X X X X X X X \n" + "X X X X X X X X X \n" + "X X X X X X X X X X X X X X X \n" + "X X X X X X X X X X X X \n" + "X X X X X X X X X X X X X X \n" + " X X X X X X X X X X X X X \n", "X ", " "); AztecDetectorResult r = new AztecDetectorResult(matrix, NO_POINTS, false, 30, 2); DecoderResult result = new Decoder().decode(r); assertEquals("88888TTTTTTTTTTTTTTTTTTTTTTTTTTTTTT", result.getText()); assertArrayEquals( new byte[] {-11, 85, 85, 117, 107, 90, -42, -75, -83, 107, 90, -42, -75, -83, 107, 90, -42, -75, -83, 107, 90, -42, -80}, result.getRawBytes()); assertEquals(180, result.getNumBits()); }
public DecoderResult decode(AztecDetectorResult detectorResult) throws FormatException { ddata = detectorResult; BitMatrix matrix = detectorResult.getBits(); boolean[] rawbits = extractBits(matrix); boolean[] correctedBits = correctBits(rawbits); byte[] rawBytes = convertBoolArrayToByteArray(correctedBits); String result = getEncodedData(correctedBits); DecoderResult decoderResult = new DecoderResult(rawBytes, result, null, null); decoderResult.setNumBits(correctedBits.length); return decoderResult; }
Decoder { public DecoderResult decode(AztecDetectorResult detectorResult) throws FormatException { ddata = detectorResult; BitMatrix matrix = detectorResult.getBits(); boolean[] rawbits = extractBits(matrix); boolean[] correctedBits = correctBits(rawbits); byte[] rawBytes = convertBoolArrayToByteArray(correctedBits); String result = getEncodedData(correctedBits); DecoderResult decoderResult = new DecoderResult(rawBytes, result, null, null); decoderResult.setNumBits(correctedBits.length); return decoderResult; } }
Decoder { public DecoderResult decode(AztecDetectorResult detectorResult) throws FormatException { ddata = detectorResult; BitMatrix matrix = detectorResult.getBits(); boolean[] rawbits = extractBits(matrix); boolean[] correctedBits = correctBits(rawbits); byte[] rawBytes = convertBoolArrayToByteArray(correctedBits); String result = getEncodedData(correctedBits); DecoderResult decoderResult = new DecoderResult(rawBytes, result, null, null); decoderResult.setNumBits(correctedBits.length); return decoderResult; }  }
Decoder { public DecoderResult decode(AztecDetectorResult detectorResult) throws FormatException { ddata = detectorResult; BitMatrix matrix = detectorResult.getBits(); boolean[] rawbits = extractBits(matrix); boolean[] correctedBits = correctBits(rawbits); byte[] rawBytes = convertBoolArrayToByteArray(correctedBits); String result = getEncodedData(correctedBits); DecoderResult decoderResult = new DecoderResult(rawBytes, result, null, null); decoderResult.setNumBits(correctedBits.length); return decoderResult; }  DecoderResult decode(AztecDetectorResult detectorResult); static String highLevelDecode(boolean[] correctedBits); }
Decoder { public DecoderResult decode(AztecDetectorResult detectorResult) throws FormatException { ddata = detectorResult; BitMatrix matrix = detectorResult.getBits(); boolean[] rawbits = extractBits(matrix); boolean[] correctedBits = correctBits(rawbits); byte[] rawBytes = convertBoolArrayToByteArray(correctedBits); String result = getEncodedData(correctedBits); DecoderResult decoderResult = new DecoderResult(rawBytes, result, null, null); decoderResult.setNumBits(correctedBits.length); return decoderResult; }  DecoderResult decode(AztecDetectorResult detectorResult); static String highLevelDecode(boolean[] correctedBits);  }