Fixed some code which was ignoring the result of MonochromeBitmapSource calls, which may work in some cases but isn't legal and failed and in some experiments.

git-svn-id: https://zxing.googlecode.com/svn/trunk@986 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
dswitkin 2009-06-25 19:46:49 +00:00
parent 969088fa82
commit da4f56b022
3 changed files with 6 additions and 5 deletions

View 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.

View file

@ -92,7 +92,7 @@ final class AlignmentPatternFinder {
for (int iGen = 0; iGen < height; iGen++) {
// Search from middle outwards
int i = middleI + ((iGen & 0x01) == 0 ? ((iGen + 1) >> 1) : -((iGen + 1) >> 1));
image.getBlackRow(i, luminanceRow, startX, width);
luminanceRow = image.getBlackRow(i, luminanceRow, startX, width);
stateCount[0] = 0;
stateCount[1] = 0;
stateCount[2] = 0;

View 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)) {