1 #ifndef __DETECTOR_H__
\r
2 #define __DETECTOR_H__
\r
8 * Created by Christian Brunschen on 14/05/2008.
\r
9 * Copyright 2008 ZXing authors All rights reserved.
\r
11 * Licensed under the Apache License, Version 2.0 (the "License");
\r
12 * you may not use this file except in compliance with the License.
\r
13 * You may obtain a copy of the License at
\r
15 * http://www.apache.org/licenses/LICENSE-2.0
\r
17 * Unless required by applicable law or agreed to in writing, software
\r
18 * distributed under the License is distributed on an "AS IS" BASIS,
\r
19 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
20 * See the License for the specific language governing permissions and
\r
21 * limitations under the License.
\r
24 #include <zxing/common/Counted.h>
\r
25 #include <zxing/common/DetectorResult.h>
\r
26 #include <zxing/common/BitMatrix.h>
\r
27 #include <zxing/qrcode/detector/AlignmentPattern.h>
\r
28 #include <zxing/common/PerspectiveTransform.h>
\r
33 class Detector : public Counted {
\r
35 Ref<BitMatrix> image_;
\r
38 Ref<BitMatrix> getImage();
\r
40 static Ref<BitMatrix> sampleGrid(Ref<BitMatrix> image, int dimension, Ref<PerspectiveTransform>);
\r
41 static int computeDimension(Ref<ResultPoint> topLeft, Ref<ResultPoint> topRight, Ref<ResultPoint> bottomLeft,
\r
43 float calculateModuleSize(Ref<ResultPoint> topLeft, Ref<ResultPoint> topRight, Ref<ResultPoint> bottomLeft);
\r
44 float calculateModuleSizeOneWay(Ref<ResultPoint> pattern, Ref<ResultPoint> otherPattern);
\r
45 float sizeOfBlackWhiteBlackRunBothWays(int fromX, int fromY, int toX, int toY);
\r
46 float sizeOfBlackWhiteBlackRun(int fromX, int fromY, int toX, int toY);
\r
47 Ref<AlignmentPattern> findAlignmentInRegion(float overallEstModuleSize, int estAlignmentX, int estAlignmentY,
\r
48 float allowanceFactor);
\r
51 virtual Ref<PerspectiveTransform> createTransform(Ref<ResultPoint> topLeft, Ref<ResultPoint> topRight, Ref <
\r
52 ResultPoint > bottomLeft, Ref<ResultPoint> alignmentPattern, int dimension);
\r
54 Detector(Ref<BitMatrix> image);
\r
55 Ref<DetectorResult> detect();
\r
60 #endif // __DETECTOR_H__
\r