Fixed some code which was ignoring the result of MonochromeBitmapSource calls, which...
authordswitkin <dswitkin@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Thu, 25 Jun 2009 19:46:49 +0000 (19:46 +0000)
committerdswitkin <dswitkin@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Thu, 25 Jun 2009 19:46:49 +0000 (19:46 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@986 59b500cc-1b3d-0410-9834-0bbf25fbcc57

core/src/com/google/zxing/oned/AbstractOneDReader.java
core/src/com/google/zxing/qrcode/detector/AlignmentPatternFinder.java
javase/src/com/google/zxing/client/j2se/CommandLineRunner.java

index 8eb26e0..508e05c 100644 (file)
@@ -112,7 +112,7 @@ public abstract class AbstractOneDReader implements OneDReader {
       } catch (ReaderException re) {
         continue;
       }
-      image.getBlackRow(rowNumber, row, 0, width);
+      row = image.getBlackRow(rowNumber, row, 0, width);
 
       // While we have the image data in a BitArray, it's fairly cheap to reverse it in place to
       // handle decoding upside down barcodes.
index 25e312b..01066e3 100644 (file)
@@ -92,7 +92,7 @@ final class AlignmentPatternFinder {
     for (int iGen = 0; iGen < height; iGen++) {\r
       // Search from middle outwards\r
       int i = middleI + ((iGen & 0x01) == 0 ? ((iGen + 1) >> 1) : -((iGen + 1) >> 1));\r
-      image.getBlackRow(i, luminanceRow, startX, width);\r
+      luminanceRow = image.getBlackRow(i, luminanceRow, startX, width);\r
       stateCount[0] = 0;\r
       stateCount[1] = 0;\r
       stateCount[2] = 0;\r
index ea09f34..fba1e9b 100644 (file)
@@ -26,7 +26,6 @@ import com.google.zxing.client.result.ParsedResult;
 import com.google.zxing.client.result.ResultParser;
 import com.google.zxing.common.BitArray;
 
-import javax.imageio.ImageIO;
 import java.awt.image.BufferedImage;
 import java.io.File;
 import java.io.FileNotFoundException;
@@ -40,6 +39,8 @@ import java.net.URISyntaxException;
 import java.nio.charset.Charset;
 import java.util.Hashtable;
 
+import javax.imageio.ImageIO;
+
 /**
  * <p>This simple command line utility decodes files, directories of files, or URIs which are passed
  * as arguments. By default it uses the normal decoding algorithms, but you can pass --try_harder to
@@ -215,7 +216,7 @@ public final class CommandLineRunner {
         }
         continue;
       }
-      source.getBlackRow(y, row, 0, width);
+      row = source.getBlackRow(y, row, 0, width);
       int offset = y * stride + width;
       for (int x = 0; x < width; x++) {
         if (row.get(x)) {
@@ -230,7 +231,7 @@ public final class CommandLineRunner {
     try {
       source.estimateBlackPoint(BlackPointEstimationMethod.TWO_D_SAMPLING, 0);
       for (int y = 0; y < height; y++) {
-        source.getBlackRow(y, row, 0, width);
+        row = source.getBlackRow(y, row, 0, width);
         int offset = y * stride + width * 2;
         for (int x = 0; x < width; x++) {
           if (row.get(x)) {