/** * <p>Implementations of this method reverse the data masking process applied to a QR Code and * make its bits ready to read.</p> * * @param bits representation of QR Code bits * @param dimension dimension of QR Code, represented by bits, being unmasked */ final void unmaskBitMatrix(BitMatrix bits, int dimension) { for (int i = 0; i < dimension; i++) { for (int j = 0; j < dimension; j++) { if (isMasked(i, j)) { bits.flip(j, i); } } } }
/** * Revert the mask removal done while reading the code words. The bit matrix should revert to its original state. */ void remask() { if (parsedFormatInfo == null) { return; // We have no format information, and have no data mask } DataMask dataMask = DataMask.values()[parsedFormatInfo.getDataMask()]; int dimension = bitMatrix.getHeight(); dataMask.unmaskBitMatrix(bitMatrix, dimension); }
DataMask dataMask = DataMask.forReference((int) formatInfo.getDataMask()); int dimension = bitMatrix.getHeight(); dataMask.unmaskBitMatrix(bitMatrix, dimension);
DataMask dataMask = DataMask.forReference((int) formatInfo.getDataMask()); int dimension = bitMatrix.getHeight(); dataMask.unmaskBitMatrix(bitMatrix, dimension);
/** * Revert the mask removal done while reading the code words. The bit matrix should revert to its original state. */ void remask() { if (parsedFormatInfo == null) { return; // We have no format information, and have no data mask } DataMask dataMask = DataMask.values()[parsedFormatInfo.getDataMask()]; int dimension = bitMatrix.getHeight(); dataMask.unmaskBitMatrix(bitMatrix, dimension); }
/** * <p>Implementations of this method reverse the data masking process applied to a QR Code and * make its bits ready to read.</p> * * @param bits representation of QR Code bits * @param dimension dimension of QR Code, represented by bits, being unmasked */ final void unmaskBitMatrix(BitMatrix bits, int dimension) { for (int i = 0; i < dimension; i++) { for (int j = 0; j < dimension; j++) { if (isMasked(i, j)) { bits.flip(j, i); } } } }
DataMask dataMask = DataMask.values()[formatInfo.getDataMask()]; int dimension = bitMatrix.getHeight(); dataMask.unmaskBitMatrix(bitMatrix, dimension);
/** * <p>Implementations of this method reverse the data masking process applied to a QR Code and * make its bits ready to read.</p> * * @param bits representation of QR Code bits * @param dimension dimension of QR Code, represented by bits, being unmasked */ final void unmaskBitMatrix(BitMatrix bits, int dimension) { for (int i = 0; i < dimension; i++) { for (int j = 0; j < dimension; j++) { if (isMasked(i, j)) { bits.flip(j, i); } } } }
DataMask dataMask = DataMask.values()[formatInfo.getDataMask()]; int dimension = bitMatrix.getHeight(); dataMask.unmaskBitMatrix(bitMatrix, dimension);
/** * <p>Implementations of this method reverse the data masking process applied to a QR Code and * make its bits ready to read.</p> * * @param bits representation of QR Code bits * @param dimension dimension of QR Code, represented by bits, being unmasked */ final void unmaskBitMatrix(BitMatrix bits, int dimension) { for (int i = 0; i < dimension; i++) { for (int j = 0; j < dimension; j++) { if (isMasked(i, j)) { bits.flip(j, i); } } } }