Continuing with the x, y coordinate push, BitMatrix is now standardized. I also conve...
[zxing.git] / core / src / com / google / zxing / datamatrix / decoder / BitMatrixParser.java
index fe48302..8305977 100644 (file)
@@ -118,7 +118,7 @@ final class BitMatrixParser {
       } else {\r
         // Sweep upward diagonally to the right\r
         do {\r
-          if ((row < numRows) && (column >= 0) && !readMappingMatrix.get(row, column)) {\r
+          if ((row < numRows) && (column >= 0) && !readMappingMatrix.get(column, row)) {\r
             result[resultOffset++] = (byte) readUtah(row, column, numRows, numColumns);\r
           }\r
           row -= 2;\r
@@ -129,7 +129,7 @@ final class BitMatrixParser {
         \r
         // Sweep downward diagonally to the left\r
         do {\r
-          if ((row >= 0) && (column < numColumns) && !readMappingMatrix.get(row, column)) {\r
+          if ((row >= 0) && (column < numColumns) && !readMappingMatrix.get(column, row)) {\r
              result[resultOffset++] = (byte) readUtah(row, column, numRows, numColumns);\r
           }\r
           row += 2;\r
@@ -165,8 +165,8 @@ final class BitMatrixParser {
       column += numColumns;\r
       row += 4 - ((numColumns + 4) & 0x07);\r
     }\r
-    readMappingMatrix.set(row, column);\r
-    return mappingBitMatrix.get(row, column);\r
+    readMappingMatrix.set(column, row);\r
+    return mappingBitMatrix.get(column, row);\r
   }\r
   \r
   /**\r
@@ -432,9 +432,9 @@ final class BitMatrixParser {
           int writeRowOffset = dataRegionRowOffset + i;\r
           for (int j = 0; j < dataRegionSizeColumns; ++j) {\r
             int readColumnOffset = dataRegionColumn * (dataRegionSizeColumns + 2) + 1 + j;\r
-            if (bitMatrix.get(readRowOffset, readColumnOffset)) {\r
+            if (bitMatrix.get(readColumnOffset, readRowOffset)) {\r
               int writeColumnOffset = dataRegionColumnOffset + j;\r
-              bitMatrixWithoutAlignment.set(writeRowOffset, writeColumnOffset);\r
+              bitMatrixWithoutAlignment.set(writeColumnOffset, writeRowOffset);\r
             }\r
           }\r
         }\r