diff --git a/src/multi/qrcode/detector/MultiDetector.java b/src/multi/qrcode/detector/MultiDetector.java deleted file mode 100644 index 7d16c62..0000000 --- a/src/multi/qrcode/detector/MultiDetector.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright 2009 ZXing authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.google.zxing.multi.qrcode.detector; - -import com.google.zxing.DecodeHintType; -import com.google.zxing.NotFoundException; -import com.google.zxing.ReaderException; -import com.google.zxing.RXingResultPointCallback; -import com.google.zxing.common.BitMatrix; -import com.google.zxing.common.DetectorRXingResult; -import com.google.zxing.qrcode.detector.Detector; -import com.google.zxing.qrcode.detector.FinderPatternInfo; - -import java.util.ArrayList; -import java.util.List; -import java.util.Map; - -/** - *
Encapsulates logic that can detect one or more QR Codes in an image, even if the QR Code - * is rotated or skewed, or partially obscured.
- * - * @author Sean Owen - * @author Hannes Erven - */ -public final class MultiDetector extends Detector { - - private static final DetectorRXingResult[] EMPTY_DETECTOR_RESULTS = new DetectorRXingResult[0]; - - public MultiDetector(BitMatrix image) { - super(image); - } - - public DetectorRXingResult[] detectMulti(MapEncapsulates logic that can detect one or more QR Codes in an image, even if the QR Code + * is rotated or skewed, or partially obscured.
+ * + * @author Sean Owen + * @author Hannes Erven + */ +pub struct MultiDetector(Detector); +impl MultiDetector { + pub fn new(image: BitMatrix) -> Self { + Self(Detector::new(image)) + } + + // private static final DetectorRXingResult[] EMPTY_DETECTOR_RESULTS = new DetectorRXingResult[0]; + + pub fn detectMulti(&self, hints:&DecodingHintDictionary) -> ResultThis class attempts to find finder patterns in a QR Code. Finder patterns are the square
@@ -46,48 +50,32 @@ import java.util.Map;
* @author Sean Owen
* @author Hannes Erven
*/
-public final class MultiFinderPatternFinder extends FinderPatternFinder {
+pub struct MultiFinderPatternFinder(FinderPatternFinder);
- private static final FinderPatternInfo[] EMPTY_RESULT_ARRAY = new FinderPatternInfo[0];
- private static final FinderPattern[] EMPTY_FP_ARRAY = new FinderPattern[0];
- private static final FinderPattern[][] EMPTY_FP_2D_ARRAY = new FinderPattern[0][];
+impl MultiFinderPatternFinder {
+
+ // private static final FinderPatternInfo[] EMPTY_RESULT_ARRAY = new FinderPatternInfo[0];
+ // private static final FinderPattern[] EMPTY_FP_ARRAY = new FinderPattern[0];
+ // private static final FinderPattern[][] EMPTY_FP_2D_ARRAY = new FinderPattern[0][];
// TODO MIN_MODULE_COUNT and MAX_MODULE_COUNT would be great hints to ask the user for
// since it limits the number of regions to decode
- // max. legal count of modules per QR code edge (177)
- private static final float MAX_MODULE_COUNT_PER_EDGE = 180;
- // min. legal count per modules per QR code edge (11)
- private static final float MIN_MODULE_COUNT_PER_EDGE = 9;
-
- /**
- * More or less arbitrary cutoff point for determining if two finder patterns might belong
- * to the same code if they differ less than DIFF_MODSIZE_CUTOFF_PERCENT percent in their
- * estimated modules sizes.
- */
- private static final float DIFF_MODSIZE_CUTOFF_PERCENT = 0.05f;
-
- /**
- * More or less arbitrary cutoff point for determining if two finder patterns might belong
- * to the same code if they differ less than DIFF_MODSIZE_CUTOFF pixels/module in their
- * estimated modules sizes.
- */
- private static final float DIFF_MODSIZE_CUTOFF = 0.5f;
- /**
- * A comparator that orders FinderPatterns by their estimated module size.
- */
- private static final class ModuleSizeComparator implements Comparator