Fixed some long lines over 100 columns.

git-svn-id: https://zxing.googlecode.com/svn/trunk@1027 59b500cc-1b3d-0410-9834-0bbf25fbcc57
This commit is contained in:
dswitkin 2009-07-23 22:10:43 +00:00
parent 4331605913
commit d8b1011324
2 changed files with 11 additions and 7 deletions

View file

@ -97,9 +97,9 @@ public abstract class AbstractUPCEANReader extends AbstractOneDReader implements
startRange = findGuardPattern(row, nextStart, false, START_END_PATTERN); startRange = findGuardPattern(row, nextStart, false, START_END_PATTERN);
int start = startRange[0]; int start = startRange[0];
nextStart = startRange[1]; nextStart = startRange[1];
// Make sure there is a quiet zone at least as big as the start pattern before the barcode. If // Make sure there is a quiet zone at least as big as the start pattern before the barcode.
// this check would run off the left edge of the image, do not accept this barcode, as it is // If this check would run off the left edge of the image, do not accept this barcode,
// very likely to be a false positive. // as it is very likely to be a false positive.
int quietStart = start - (nextStart - start); int quietStart = start - (nextStart - start);
if (quietStart >= 0) { if (quietStart >= 0) {
foundStart = row.isRange(quietStart, start, false); foundStart = row.isRange(quietStart, start, false);
@ -108,11 +108,13 @@ public abstract class AbstractUPCEANReader extends AbstractOneDReader implements
return startRange; return startRange;
} }
public final Result decodeRow(int rowNumber, BitArray row, Hashtable hints) throws ReaderException { public final Result decodeRow(int rowNumber, BitArray row, Hashtable hints)
throws ReaderException {
return decodeRow(rowNumber, row, findStartGuardPattern(row)); return decodeRow(rowNumber, row, findStartGuardPattern(row));
} }
public final Result decodeRow(int rowNumber, BitArray row, int[] startGuardRange) throws ReaderException { public final Result decodeRow(int rowNumber, BitArray row, int[] startGuardRange)
throws ReaderException {
StringBuffer result = decodeRowStringBuffer; StringBuffer result = decodeRowStringBuffer;
result.setLength(0); result.setLength(0);
int endStart = decodeMiddle(row, startGuardRange, result); int endStart = decodeMiddle(row, startGuardRange, result);
@ -184,7 +186,8 @@ public abstract class AbstractUPCEANReader extends AbstractOneDReader implements
} }
/** /**
* Subclasses override this to decode the portion of a barcode between the start and end guard patterns. * Subclasses override this to decode the portion of a barcode between the start
* and end guard patterns.
* *
* @param row row of black/white values to search * @param row row of black/white values to search
* @param startRange start/end offset of start guard pattern * @param startRange start/end offset of start guard pattern

View file

@ -33,7 +33,8 @@ public final class EAN8Reader extends AbstractUPCEANReader {
decodeMiddleCounters = new int[4]; decodeMiddleCounters = new int[4];
} }
protected int decodeMiddle(BitArray row, int[] startRange, StringBuffer result) throws ReaderException { protected int decodeMiddle(BitArray row, int[] startRange, StringBuffer result)
throws ReaderException {
int[] counters = decodeMiddleCounters; int[] counters = decodeMiddleCounters;
counters[0] = 0; counters[0] = 0;
counters[1] = 0; counters[1] = 0;