本文整理汇总了Java中com.google.zxing.oned.rss.AbstractRSSReader类的典型用法代码示例。如果您正苦于以下问题:Java AbstractRSSReader类的具体用法?Java AbstractRSSReader怎么用?Java AbstractRSSReader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractRSSReader类属于com.google.zxing.oned.rss包,在下文中一共展示了AbstractRSSReader类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseFoundFinderPattern
import com.google.zxing.oned.rss.AbstractRSSReader; //导入依赖的package包/类
private FinderPattern parseFoundFinderPattern(BitArray row, int rowNumber, boolean oddPattern) {
int firstCounter;
int start;
int end;
if (oddPattern) {
int firstElementStart = this.startEnd[0] - 1;
while (firstElementStart >= 0 && !row.get(firstElementStart)) {
firstElementStart--;
}
firstElementStart++;
firstCounter = this.startEnd[0] - firstElementStart;
start = firstElementStart;
end = this.startEnd[1];
} else {
start = this.startEnd[0];
end = row.getNextUnset(this.startEnd[1] + 1);
firstCounter = end - this.startEnd[1];
}
int[] counters = getDecodeFinderCounters();
System.arraycopy(counters, 0, counters, 1, counters.length - 1);
counters[0] = firstCounter;
try {
return new FinderPattern(AbstractRSSReader.parseFinderValue(counters,
FINDER_PATTERNS), new int[]{start, end}, start, end, rowNumber);
} catch (NotFoundException e) {
return null;
}
}
示例2: findNextPair
import com.google.zxing.oned.rss.AbstractRSSReader; //导入依赖的package包/类
private void findNextPair(BitArray row, List<ExpandedPair> previousPairs, int forcedOffset)
throws NotFoundException {
int rowOffset;
int[] counters = getDecodeFinderCounters();
counters[0] = 0;
counters[1] = 0;
counters[2] = 0;
counters[3] = 0;
int width = row.getSize();
if (forcedOffset >= 0) {
rowOffset = forcedOffset;
} else if (previousPairs.isEmpty()) {
rowOffset = 0;
} else {
rowOffset = ((ExpandedPair) previousPairs.get(previousPairs.size() - 1))
.getFinderPattern().getStartEnd()[1];
}
boolean searchingEvenPair = previousPairs.size() % 2 != 0;
if (this.startFromEven) {
searchingEvenPair = !searchingEvenPair;
}
boolean isWhite = false;
while (rowOffset < width) {
isWhite = !row.get(rowOffset);
if (!isWhite) {
break;
}
rowOffset++;
}
int counterPosition = 0;
int patternStart = rowOffset;
for (int x = rowOffset; x < width; x++) {
if ((row.get(x) ^ isWhite) != 0) {
counters[counterPosition] = counters[counterPosition] + 1;
} else {
if (counterPosition == 3) {
if (searchingEvenPair) {
reverseCounters(counters);
}
if (AbstractRSSReader.isFinderPattern(counters)) {
this.startEnd[0] = patternStart;
this.startEnd[1] = x;
return;
}
if (searchingEvenPair) {
reverseCounters(counters);
}
patternStart += counters[0] + counters[1];
counters[0] = counters[2];
counters[1] = counters[3];
counters[2] = 0;
counters[3] = 0;
counterPosition--;
} else {
counterPosition++;
}
counters[counterPosition] = 1;
isWhite = !isWhite;
}
}
throw NotFoundException.getNotFoundInstance();
}