use of com.google.zxing.qrcode.detector.FinderPatternInfo in project android-zxing by PearceXu.
the class MultiDetector method detectMulti.
public DetectorResult[] detectMulti(Map<DecodeHintType, ?> hints) throws NotFoundException {
BitMatrix image = getImage();
ResultPointCallback resultPointCallback = hints == null ? null : (ResultPointCallback) hints.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK);
MultiFinderPatternFinder finder = new MultiFinderPatternFinder(image, resultPointCallback);
FinderPatternInfo[] infos = finder.findMulti(hints);
if (infos.length == 0) {
throw NotFoundException.getNotFoundInstance();
}
List<DetectorResult> result = new ArrayList<>();
for (FinderPatternInfo info : infos) {
try {
result.add(processFinderPatternInfo(info));
} catch (ReaderException e) {
// ignore
}
}
if (result.isEmpty()) {
return EMPTY_DETECTOR_RESULTS;
} else {
return result.toArray(new DetectorResult[result.size()]);
}
}
use of com.google.zxing.qrcode.detector.FinderPatternInfo in project incubator-weex by apache.
the class MultiDetector method detectMulti.
public DetectorResult[] detectMulti(Map<DecodeHintType, ?> hints) throws NotFoundException {
BitMatrix image = getImage();
ResultPointCallback resultPointCallback = hints == null ? null : (ResultPointCallback) hints.get(DecodeHintType.NEED_RESULT_POINT_CALLBACK);
MultiFinderPatternFinder finder = new MultiFinderPatternFinder(image, resultPointCallback);
FinderPatternInfo[] infos = finder.findMulti(hints);
if (infos.length == 0) {
throw NotFoundException.getNotFoundInstance();
}
List<DetectorResult> result = new ArrayList<>();
for (FinderPatternInfo info : infos) {
try {
result.add(processFinderPatternInfo(info));
} catch (ReaderException e) {
// ignore
}
}
if (result.isEmpty()) {
return EMPTY_DETECTOR_RESULTS;
} else {
return result.toArray(new DetectorResult[result.size()]);
}
}
Aggregations