if (readModule(numRows - 1, 0, numRows, numColumns)) { currentByte |= 1; if (readModule(numRows - 1, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 3, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 2, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(1, numColumns - 3, numRows, numColumns)) { currentByte |= 1; if (readModule(1, numColumns - 2, numRows, numColumns)) { currentByte |= 1; if (readModule(1, numColumns - 1, numRows, numColumns)) { currentByte |= 1;
result[resultOffset++] = (byte) readCorner1(numRows, numColumns); row -= 2; column +=2; corner1Read = true; } else if ((row == numRows-2) && (column == 0) && ((numColumns & 0x03) != 0) && !corner2Read) { result[resultOffset++] = (byte) readCorner2(numRows, numColumns); row -= 2; column +=2; corner2Read = true; } else if ((row == numRows+4) && (column == 2) && ((numColumns & 0x07) == 0) && !corner3Read) { result[resultOffset++] = (byte) readCorner3(numRows, numColumns); row -= 2; column +=2; corner3Read = true; } else if ((row == numRows-2) && (column == 0) && ((numColumns & 0x07) == 4) && !corner4Read) { result[resultOffset++] = (byte) readCorner4(numRows, numColumns); row -= 2; column +=2; result[resultOffset++] = (byte) readUtah(row, column, numRows, numColumns); result[resultOffset++] = (byte) readUtah(row, column, numRows, numColumns);
/** * @param bitMatrix {@link BitMatrix} to parse * @throws FormatException if dimension is < 10 or > 144 or not 0 mod 2 */ BitMatrixParser(BitMatrix bitMatrix) throws FormatException { int dimension = bitMatrix.getHeight(); if (dimension < 10 || dimension > 144 || (dimension & 0x01) != 0) { throw FormatException.getFormatInstance(); } version = readVersion(bitMatrix); this.mappingBitMatrix = extractDataRegion(bitMatrix); // TODO(bbrown): Make this work for rectangular symbols this.readMappingMatrix = new BitMatrix(this.mappingBitMatrix.getHeight()); }
BitMatrixParser parser = new BitMatrixParser(bits); Version version = parser.readVersion(bits); byte[] codewords = parser.readCodewords();
result[resultOffset++] = (byte) readCorner1(numRows, numColumns); row -= 2; column +=2; corner1Read = true; } else if ((row == numRows-2) && (column == 0) && ((numColumns & 0x03) != 0) && !corner2Read) { result[resultOffset++] = (byte) readCorner2(numRows, numColumns); row -= 2; column +=2; corner2Read = true; } else if ((row == numRows+4) && (column == 2) && ((numColumns & 0x07) == 0) && !corner3Read) { result[resultOffset++] = (byte) readCorner3(numRows, numColumns); row -= 2; column +=2; corner3Read = true; } else if ((row == numRows-2) && (column == 0) && ((numColumns & 0x07) == 4) && !corner4Read) { result[resultOffset++] = (byte) readCorner4(numRows, numColumns); row -= 2; column +=2; result[resultOffset++] = (byte) readUtah(row, column, numRows, numColumns); result[resultOffset++] = (byte) readUtah(row, column, numRows, numColumns);
/** * @param bitMatrix {@link BitMatrix} to parse * @throws FormatException if dimension is < 10 or > 144 or not 0 mod 2 */ BitMatrixParser(BitMatrix bitMatrix) throws FormatException { int dimension = bitMatrix.getHeight(); if (dimension < 10 || dimension > 144 || (dimension & 0x01) != 0) { throw FormatException.getFormatInstance(); } version = readVersion(bitMatrix); this.mappingBitMatrix = extractDataRegion(bitMatrix); // TODO(bbrown): Make this work for rectangular symbols this.readMappingMatrix = new BitMatrix(this.mappingBitMatrix.getHeight()); }
if (readModule(numRows - 1, 0, numRows, numColumns)) { currentByte |= 1; if (readModule(numRows - 1, 1, numRows, numColumns)) { currentByte |= 1; if (readModule(numRows - 1, 2, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 2, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(1, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(2, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(3, numColumns - 1, numRows, numColumns)) { currentByte |= 1;
if (readModule(numRows - 3, 0, numRows, numColumns)) { currentByte |= 1; if (readModule(numRows - 2, 0, numRows, numColumns)) { currentByte |= 1; if (readModule(numRows - 1, 0, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 2, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(1, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(2, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(3, numColumns - 1, numRows, numColumns)) { currentByte |= 1;
if (readModule(numRows - 3, 0, numRows, numColumns)) { currentByte |= 1; if (readModule(numRows - 2, 0, numRows, numColumns)) { currentByte |= 1; if (readModule(numRows - 1, 0, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 4, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 3, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 2, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(1, numColumns - 1, numRows, numColumns)) { currentByte |= 1;
if (readModule(numRows - 3, 0, numRows, numColumns)) { currentByte |= 1; if (readModule(numRows - 2, 0, numRows, numColumns)) { currentByte |= 1; if (readModule(numRows - 1, 0, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 2, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(1, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(2, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(3, numColumns - 1, numRows, numColumns)) { currentByte |= 1;
if (readModule(numRows - 1, 0, numRows, numColumns)) { currentByte |= 1; if (readModule(numRows - 1, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 3, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 2, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(1, numColumns - 3, numRows, numColumns)) { currentByte |= 1; if (readModule(1, numColumns - 2, numRows, numColumns)) { currentByte |= 1; if (readModule(1, numColumns - 1, numRows, numColumns)) { currentByte |= 1;
if (readModule(row - 2, column - 2, numRows, numColumns)) { currentByte |= 1; if (readModule(row - 2, column - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(row - 1, column - 2, numRows, numColumns)) { currentByte |= 1; if (readModule(row - 1, column - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(row - 1, column, numRows, numColumns)) { currentByte |= 1; if (readModule(row, column - 2, numRows, numColumns)) { currentByte |= 1; if (readModule(row, column - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(row, column, numRows, numColumns)) { currentByte |= 1;
if (readModule(numRows - 1, 0, numRows, numColumns)) { currentByte |= 1; if (readModule(numRows - 1, 1, numRows, numColumns)) { currentByte |= 1; if (readModule(numRows - 1, 2, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 2, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(1, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(2, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(3, numColumns - 1, numRows, numColumns)) { currentByte |= 1;
if (readModule(numRows - 3, 0, numRows, numColumns)) { currentByte |= 1; if (readModule(numRows - 2, 0, numRows, numColumns)) { currentByte |= 1; if (readModule(numRows - 1, 0, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 4, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 3, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 2, numRows, numColumns)) { currentByte |= 1; if (readModule(0, numColumns - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(1, numColumns - 1, numRows, numColumns)) { currentByte |= 1;
if (readModule(row - 2, column - 2, numRows, numColumns)) { currentByte |= 1; if (readModule(row - 2, column - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(row - 1, column - 2, numRows, numColumns)) { currentByte |= 1; if (readModule(row - 1, column - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(row - 1, column, numRows, numColumns)) { currentByte |= 1; if (readModule(row, column - 2, numRows, numColumns)) { currentByte |= 1; if (readModule(row, column - 1, numRows, numColumns)) { currentByte |= 1; if (readModule(row, column, numRows, numColumns)) { currentByte |= 1;