mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
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:
parent
969088fa82
commit
da4f56b022
|
@ -112,7 +112,7 @@ public abstract class AbstractOneDReader implements OneDReader {
|
||||||
} catch (ReaderException re) {
|
} catch (ReaderException re) {
|
||||||
continue;
|
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
|
// While we have the image data in a BitArray, it's fairly cheap to reverse it in place to
|
||||||
// handle decoding upside down barcodes.
|
// handle decoding upside down barcodes.
|
||||||
|
|
|
@ -92,7 +92,7 @@ final class AlignmentPatternFinder {
|
||||||
for (int iGen = 0; iGen < height; iGen++) {
|
for (int iGen = 0; iGen < height; iGen++) {
|
||||||
// Search from middle outwards
|
// Search from middle outwards
|
||||||
int i = middleI + ((iGen & 0x01) == 0 ? ((iGen + 1) >> 1) : -((iGen + 1) >> 1));
|
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[0] = 0;
|
||||||
stateCount[1] = 0;
|
stateCount[1] = 0;
|
||||||
stateCount[2] = 0;
|
stateCount[2] = 0;
|
||||||
|
|
|
@ -26,7 +26,6 @@ import com.google.zxing.client.result.ParsedResult;
|
||||||
import com.google.zxing.client.result.ResultParser;
|
import com.google.zxing.client.result.ResultParser;
|
||||||
import com.google.zxing.common.BitArray;
|
import com.google.zxing.common.BitArray;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
|
||||||
import java.awt.image.BufferedImage;
|
import java.awt.image.BufferedImage;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileNotFoundException;
|
import java.io.FileNotFoundException;
|
||||||
|
@ -40,6 +39,8 @@ import java.net.URISyntaxException;
|
||||||
import java.nio.charset.Charset;
|
import java.nio.charset.Charset;
|
||||||
import java.util.Hashtable;
|
import java.util.Hashtable;
|
||||||
|
|
||||||
|
import javax.imageio.ImageIO;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>This simple command line utility decodes files, directories of files, or URIs which are passed
|
* <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
|
* 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;
|
continue;
|
||||||
}
|
}
|
||||||
source.getBlackRow(y, row, 0, width);
|
row = source.getBlackRow(y, row, 0, width);
|
||||||
int offset = y * stride + width;
|
int offset = y * stride + width;
|
||||||
for (int x = 0; x < width; x++) {
|
for (int x = 0; x < width; x++) {
|
||||||
if (row.get(x)) {
|
if (row.get(x)) {
|
||||||
|
@ -230,7 +231,7 @@ public final class CommandLineRunner {
|
||||||
try {
|
try {
|
||||||
source.estimateBlackPoint(BlackPointEstimationMethod.TWO_D_SAMPLING, 0);
|
source.estimateBlackPoint(BlackPointEstimationMethod.TWO_D_SAMPLING, 0);
|
||||||
for (int y = 0; y < height; y++) {
|
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;
|
int offset = y * stride + width * 2;
|
||||||
for (int x = 0; x < width; x++) {
|
for (int x = 0; x < width; x++) {
|
||||||
if (row.get(x)) {
|
if (row.get(x)) {
|
||||||
|
|
Loading…
Reference in a new issue