/** * @return number of rows we could safely skip during scanning, based on the first two finder * patterns that have been located. In some cases their position will allow us to infer that * the third pattern must lie below a certain point farther down in the image. */ private int findRowSkip() { int max = possibleCenters.size(); if (max <= 1) { return 0; } FinderPattern firstConfirmedCenter = null; for (FinderPattern center : possibleCenters) { if (center.getCount() >= CENTER_QUORUM) { if (firstConfirmedCenter == null) { firstConfirmedCenter = center; } else { // We have two confirmed centers // How far down can we skip before resuming looking for the next // pattern? In the worst case, only the difference between the // difference in the x / y coordinates of the two centers. // This is the case where you find top left last. hasSkipped = true; return (int) (Math.abs(firstConfirmedCenter.getX() - center.getX()) - Math.abs(firstConfirmedCenter.getY() - center.getY())) / 2; } } } return 0; }
private int findRowSkip() { if (this.possibleCenters.size() <= 1) {} Object localObject; FinderPattern localFinderPattern; for (;;) { return 0; localObject = null; Iterator localIterator = this.possibleCenters.iterator(); while (localIterator.hasNext()) { localFinderPattern = (FinderPattern)localIterator.next(); if (localFinderPattern.getCount() >= 2) { if (localObject != null) { break label63; } localObject = localFinderPattern; } } } label63: this.hasSkipped = true; return (int)(Math.abs(localObject.getX() - localFinderPattern.getX()) - Math.abs(localObject.getY() - localFinderPattern.getY())) / 2; }