formatInfoBits1 = copyBit(i, 8, formatInfoBits1); formatInfoBits1 = copyBit(7, 8, formatInfoBits1); formatInfoBits1 = copyBit(8, 8, formatInfoBits1); formatInfoBits1 = copyBit(8, 7, formatInfoBits1); formatInfoBits1 = copyBit(8, j, formatInfoBits1); int jMin = dimension - 7; for (int j = dimension - 1; j >= jMin; j--) { formatInfoBits2 = copyBit(8, j, formatInfoBits2); formatInfoBits2 = copyBit(i, 8, formatInfoBits2);
BitMatrixParser parser = new BitMatrixParser(bits); FormatException fe = null; ChecksumException ce = null; parser.remask(); parser.setMirror(true); parser.readVersion(); parser.readFormatInformation(); parser.mirror();
BitMatrixParser parser = new BitMatrixParser(bits); Version version = parser.readVersion(); ErrorCorrectionLevel ecLevel = parser.readFormatInformation().getErrorCorrectionLevel(); byte[] codewords = parser.readCodewords();
FormatInformation formatInfo = readFormatInformation(); Version version = readVersion();
private DecoderResult decode(BitMatrixParser parser, Map<DecodeHintType,?> hints) throws FormatException, ChecksumException { Version version = parser.readVersion(); ErrorCorrectionLevel ecLevel = parser.readFormatInformation().getErrorCorrectionLevel(); // Read codewords byte[] codewords = parser.readCodewords(); // Separate into data blocks DataBlock[] dataBlocks = DataBlock.getDataBlocks(codewords, version, ecLevel); // Count total number of data bytes int totalBytes = 0; for (DataBlock dataBlock : dataBlocks) { totalBytes += dataBlock.getNumDataCodewords(); } byte[] resultBytes = new byte[totalBytes]; int resultOffset = 0; // Error-correct and copy data blocks together into a stream of bytes for (DataBlock dataBlock : dataBlocks) { byte[] codewordBytes = dataBlock.getCodewords(); int numDataCodewords = dataBlock.getNumDataCodewords(); correctErrors(codewordBytes, numDataCodewords); for (int i = 0; i < numDataCodewords; i++) { resultBytes[resultOffset++] = codewordBytes[i]; } } // Decode the contents of that stream of bytes return DecodedBitStreamParser.decode(resultBytes, version, ecLevel, hints); }
FormatInformation formatInfo = readFormatInformation(); Version version = readVersion();
private DecoderResult decode(BitMatrixParser parser, Map<DecodeHintType,?> hints) throws FormatException, ChecksumException { Version version = parser.readVersion(); ErrorCorrectionLevel ecLevel = parser.readFormatInformation().getErrorCorrectionLevel(); // Read codewords byte[] codewords = parser.readCodewords(); // Separate into data blocks DataBlock[] dataBlocks = DataBlock.getDataBlocks(codewords, version, ecLevel); // Count total number of data bytes int totalBytes = 0; for (DataBlock dataBlock : dataBlocks) { totalBytes += dataBlock.getNumDataCodewords(); } byte[] resultBytes = new byte[totalBytes]; int resultOffset = 0; // Error-correct and copy data blocks together into a stream of bytes for (DataBlock dataBlock : dataBlocks) { byte[] codewordBytes = dataBlock.getCodewords(); int numDataCodewords = dataBlock.getNumDataCodewords(); correctErrors(codewordBytes, numDataCodewords); for (int i = 0; i < numDataCodewords; i++) { resultBytes[resultOffset++] = codewordBytes[i]; } } // Decode the contents of that stream of bytes return DecodedBitStreamParser.decode(resultBytes, version, ecLevel, hints); }
BitMatrixParser parser = new BitMatrixParser(bits); FormatException fe = null; ChecksumException ce = null; parser.remask(); parser.setMirror(true); parser.readVersion(); parser.readFormatInformation(); parser.mirror();
FormatInformation formatInfo = readFormatInformation(); Version version = readVersion();
formatInfoBits1 = copyBit(i, 8, formatInfoBits1); formatInfoBits1 = copyBit(7, 8, formatInfoBits1); formatInfoBits1 = copyBit(8, 8, formatInfoBits1); formatInfoBits1 = copyBit(8, 7, formatInfoBits1); formatInfoBits1 = copyBit(8, j, formatInfoBits1); int jMin = dimension - 7; for (int j = dimension - 1; j >= jMin; j--) { formatInfoBits2 = copyBit(8, j, formatInfoBits2); formatInfoBits2 = copyBit(i, 8, formatInfoBits2);
FormatInformation formatInfo = readFormatInformation(); Version version = readVersion();
formatInfoBits1 = copyBit(i, 8, formatInfoBits1); formatInfoBits1 = copyBit(7, 8, formatInfoBits1); formatInfoBits1 = copyBit(8, 8, formatInfoBits1); formatInfoBits1 = copyBit(8, 7, formatInfoBits1); formatInfoBits1 = copyBit(8, j, formatInfoBits1); int iMin = dimension - 8; for (int i = dimension - 1; i >= iMin; i--) { formatInfoBits2 = copyBit(i, 8, formatInfoBits2); formatInfoBits2 = copyBit(8, j, formatInfoBits2);
formatInfoBits1 = copyBit(i, 8, formatInfoBits1); formatInfoBits1 = copyBit(7, 8, formatInfoBits1); formatInfoBits1 = copyBit(8, 8, formatInfoBits1); formatInfoBits1 = copyBit(8, 7, formatInfoBits1); formatInfoBits1 = copyBit(8, j, formatInfoBits1); int iMin = dimension - 8; for (int i = dimension - 1; i >= iMin; i--) { formatInfoBits2 = copyBit(i, 8, formatInfoBits2); formatInfoBits2 = copyBit(8, j, formatInfoBits2);