X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=core%2Fsrc%2Fcom%2Fgoogle%2Fzxing%2Fcommon%2FBitMatrix.java;h=5440787480e955464984a77f877770132b3d8376;hb=80ba9706bb9a495fe043e95b0179323060e4786a;hp=74e452d57f9ea6b147e40cd98dd9da75dbe00113;hpb=ef3b5dc1c7cfaadeed6adc10d345c3d6ba3f8e0c;p=zxing.git diff --git a/core/src/com/google/zxing/common/BitMatrix.java b/core/src/com/google/zxing/common/BitMatrix.java index 74e452d5..54407874 100755 --- a/core/src/com/google/zxing/common/BitMatrix.java +++ b/core/src/com/google/zxing/common/BitMatrix.java @@ -71,6 +71,17 @@ public final class BitMatrix { bits[offset >> 5] |= 1 << (offset & 0x1F); } + /** + *

Flips the given bit.

+ * + * @param i row offset + * @param j column offset + */ + public void flip(int i, int j) { + int offset = i + dimension * j; + bits[offset >> 5] ^= 1 << (offset & 0x1F); + } + /** *

Sets a square region of the bit matrix to true.

* @@ -108,13 +119,6 @@ public final class BitMatrix { return dimension; } - /** - * @return array of ints holding internal representation of this matrix's bits - */ - public int[] getBits() { - return bits; - } - public String toString() { StringBuffer result = new StringBuffer(dimension * (dimension + 1)); for (int i = 0; i < dimension; i++) {