OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #ifndef _BC_QRDETECTOR_H_ | 7 #ifndef _BC_QRDETECTOR_H_ |
8 #define _BC_QRDETECTOR_H_ | 8 #define _BC_QRDETECTOR_H_ |
9 class CBC_ResultPoint; | 9 class CBC_ResultPoint; |
10 class CBC_CommonBitMatrix; | 10 class CBC_CommonBitMatrix; |
11 class CBC_QRDetectorResult; | 11 class CBC_QRDetectorResult; |
12 class CBC_QRFinderPatternInfo; | 12 class CBC_QRFinderPatternInfo; |
13 class CBC_QRAlignmentPattern; | 13 class CBC_QRAlignmentPattern; |
14 class CBC_QRFinderPatternFinder; | 14 class CBC_QRFinderPatternFinder; |
15 class CBC_QRCoderVersion; | 15 class CBC_QRCoderVersion; |
16 class CBC_QRGridSampler; | 16 class CBC_QRGridSampler; |
17 class CBC_QRAlignmentPatternFinder; | 17 class CBC_QRAlignmentPatternFinder; |
18 class CBC_QRAlignmentPattern; | 18 class CBC_QRAlignmentPattern; |
19 class CBC_QRDetector; | 19 class CBC_QRDetector; |
20 class CBC_QRDetector | 20 class CBC_QRDetector |
21 { | 21 { |
22 private: | 22 private: |
23 CBC_CommonBitMatrix *m_image; | 23 CBC_CommonBitMatrix *m_image; |
24 public: | 24 public: |
25 CBC_QRDetector(CBC_CommonBitMatrix *image); | 25 CBC_QRDetector(CBC_CommonBitMatrix *image); |
26 virtual ~CBC_QRDetector(); | 26 virtual ~CBC_QRDetector(); |
27 | 27 |
28 CBC_CommonBitMatrix* GetImage(); | 28 CBC_CommonBitMatrix* GetImage(); |
29 CBC_QRDetectorResult* Detect(FX_INT32 hints, FX_INT32 &e); | 29 CBC_QRDetectorResult* Detect(int32_t hints, int32_t &e); |
30 CBC_QRDetectorResult* ProcessFinderPatternInfo(CBC_QRFinderPatternInfo *info
, FX_INT32 &e); | 30 CBC_QRDetectorResult* ProcessFinderPatternInfo(CBC_QRFinderPatternInfo *info
, int32_t &e); |
31 FX_FLOAT CalculateModuleSize(CBC_ResultPoint *topLeft, CBC_ResultPoint *topR
ight, CBC_ResultPoint *bottomLeft); | 31 FX_FLOAT CalculateModuleSize(CBC_ResultPoint *topLeft, CBC_ResultPoint *topR
ight, CBC_ResultPoint *bottomLeft); |
32 FX_FLOAT CalculateModuleSizeOneWay(CBC_ResultPoint *pattern, CBC_ResultPoint
*otherPattern); | 32 FX_FLOAT CalculateModuleSizeOneWay(CBC_ResultPoint *pattern, CBC_ResultPoint
*otherPattern); |
33 FX_FLOAT SizeOfBlackWhiteBlackRunBothWays(FX_INT32 fromX, FX_INT32 fromY, FX
_INT32 toX, FX_INT32 toY); | 33 FX_FLOAT SizeOfBlackWhiteBlackRunBothWays(int32_t fromX, int32_t fromY, int3
2_t toX, int32_t toY); |
34 FX_FLOAT SizeOfBlackWhiteBlackRun(FX_INT32 fromX, FX_INT32 fromY, FX_INT32 t
oX, FX_INT32 toY); | 34 FX_FLOAT SizeOfBlackWhiteBlackRun(int32_t fromX, int32_t fromY, int32_t toX,
int32_t toY); |
35 CBC_QRAlignmentPattern* FindAlignmentInRegion(FX_FLOAT overallEstModuleSize,
FX_INT32 estAlignmentX, FX_INT32 estAlignmentY, FX_FLOAT allowanceFactor, FX_IN
T32 &e); | 35 CBC_QRAlignmentPattern* FindAlignmentInRegion(FX_FLOAT overallEstModuleSize,
int32_t estAlignmentX, int32_t estAlignmentY, FX_FLOAT allowanceFactor, int32_t
&e); |
36 static FX_INT32 Round(FX_FLOAT d); | 36 static int32_t Round(FX_FLOAT d); |
37 static FX_INT32 ComputeDimension(CBC_ResultPoint *topLeft, CBC_ResultPoint *
topRight, CBC_ResultPoint *bottomLeft, FX_FLOAT moduleSize, FX_INT32 &e); | 37 static int32_t ComputeDimension(CBC_ResultPoint *topLeft, CBC_ResultPoint *t
opRight, CBC_ResultPoint *bottomLeft, FX_FLOAT moduleSize, int32_t &e); |
38 static CBC_CommonBitMatrix* SampleGrid(CBC_CommonBitMatrix *image, CBC_Resul
tPoint *topLeft, CBC_ResultPoint *topRight, | 38 static CBC_CommonBitMatrix* SampleGrid(CBC_CommonBitMatrix *image, CBC_Resul
tPoint *topLeft, CBC_ResultPoint *topRight, |
39 CBC_ResultPoint *bottomLeft, CBC_Resu
ltPoint* alignmentPattern, FX_INT32 dimension, FX_INT32 &e); | 39 CBC_ResultPoint *bottomLeft, CBC_Resu
ltPoint* alignmentPattern, int32_t dimension, int32_t &e); |
40 }; | 40 }; |
41 #endif | 41 #endif |
OLD | NEW |