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_DATAMATRIXDETECTOR_H_ | 7 #ifndef _BC_DATAMATRIXDETECTOR_H_ |
8 #define _BC_DATAMATRIXDETECTOR_H_ | 8 #define _BC_DATAMATRIXDETECTOR_H_ |
9 class CBC_CommonBitMatrix; | 9 class CBC_CommonBitMatrix; |
10 class CBC_WhiteRectangleDetector; | 10 class CBC_WhiteRectangleDetector; |
11 class CBC_ResultPoint; | 11 class CBC_ResultPoint; |
12 class CBC_QRDetectorResult; | 12 class CBC_QRDetectorResult; |
13 class CBC_DataMatrixDetector; | 13 class CBC_DataMatrixDetector; |
14 class ResultPointsAndTransitions; | 14 class ResultPointsAndTransitions; |
15 class CBC_ResultPointsAndTransitions | 15 class CBC_ResultPointsAndTransitions |
16 { | 16 { |
17 public: | 17 public: |
18 CBC_ResultPointsAndTransitions(CBC_ResultPoint *from, CBC_ResultPoint *to, F
X_INT32 transitions) | 18 CBC_ResultPointsAndTransitions(CBC_ResultPoint *from, CBC_ResultPoint *to, i
nt32_t transitions) |
19 { | 19 { |
20 m_from = from; | 20 m_from = from; |
21 m_to = to; | 21 m_to = to; |
22 m_transitions = transitions; | 22 m_transitions = transitions; |
23 } | 23 } |
24 ~CBC_ResultPointsAndTransitions() | 24 ~CBC_ResultPointsAndTransitions() |
25 { | 25 { |
26 } | 26 } |
27 CBC_ResultPoint *GetFrom() | 27 CBC_ResultPoint *GetFrom() |
28 { | 28 { |
29 return m_from; | 29 return m_from; |
30 } | 30 } |
31 CBC_ResultPoint *GetTo() | 31 CBC_ResultPoint *GetTo() |
32 { | 32 { |
33 return m_to; | 33 return m_to; |
34 } | 34 } |
35 FX_INT32 GetTransitions() | 35 int32_t GetTransitions() |
36 { | 36 { |
37 return m_transitions; | 37 return m_transitions; |
38 } | 38 } |
39 private: | 39 private: |
40 CBC_ResultPoint *m_from; | 40 CBC_ResultPoint *m_from; |
41 CBC_ResultPoint *m_to; | 41 CBC_ResultPoint *m_to; |
42 FX_INT32 m_transitions; | 42 int32_t m_transitions; |
43 }; | 43 }; |
44 class CBC_DataMatrixDetector | 44 class CBC_DataMatrixDetector |
45 { | 45 { |
46 public: | 46 public: |
47 CBC_DataMatrixDetector(CBC_CommonBitMatrix *image); | 47 CBC_DataMatrixDetector(CBC_CommonBitMatrix *image); |
48 virtual ~CBC_DataMatrixDetector(); | 48 virtual ~CBC_DataMatrixDetector(); |
49 CBC_QRDetectorResult *Detect(FX_INT32 &e); | 49 CBC_QRDetectorResult *Detect(int32_t &e); |
50 CBC_ResultPoint *CorrectTopRightRectangular(CBC_ResultPoint *bottomLeft, | 50 CBC_ResultPoint *CorrectTopRightRectangular(CBC_ResultPoint *bottomLeft, |
51 CBC_ResultPoint *bottomRight, | 51 CBC_ResultPoint *bottomRight, |
52 CBC_ResultPoint *topLeft, | 52 CBC_ResultPoint *topLeft, |
53 CBC_ResultPoint *topRight, | 53 CBC_ResultPoint *topRight, |
54 FX_INT32 dimensionTop, FX_INT32 dimensionRight); | 54 int32_t dimensionTop, int32_t dimensionRight); |
55 CBC_ResultPoint *CorrectTopRight(CBC_ResultPoint *bottomLeft, | 55 CBC_ResultPoint *CorrectTopRight(CBC_ResultPoint *bottomLeft, |
56 CBC_ResultPoint *bottomRight, | 56 CBC_ResultPoint *bottomRight, |
57 CBC_ResultPoint *topLeft, | 57 CBC_ResultPoint *topLeft, |
58 CBC_ResultPoint *topRight, | 58 CBC_ResultPoint *topRight, |
59 FX_INT32 dimension); | 59 int32_t dimension); |
60 CBC_CommonBitMatrix *SampleGrid(CBC_CommonBitMatrix *image, | 60 CBC_CommonBitMatrix *SampleGrid(CBC_CommonBitMatrix *image, |
61 CBC_ResultPoint *topLeft, | 61 CBC_ResultPoint *topLeft, |
62 CBC_ResultPoint *bottomLeft, | 62 CBC_ResultPoint *bottomLeft, |
63 CBC_ResultPoint *bottomRight, | 63 CBC_ResultPoint *bottomRight, |
64 CBC_ResultPoint *topRight, | 64 CBC_ResultPoint *topRight, |
65 FX_INT32 dimensionX, FX_INT32 dimensionY, FX
_INT32 &e); | 65 int32_t dimensionX, int32_t dimensionY, int3
2_t &e); |
66 CBC_ResultPointsAndTransitions *TransitionsBetween(CBC_ResultPoint *from, CB
C_ResultPoint *to); | 66 CBC_ResultPointsAndTransitions *TransitionsBetween(CBC_ResultPoint *from, CB
C_ResultPoint *to); |
67 FX_BOOL IsValid(CBC_ResultPoint *p); | 67 FX_BOOL IsValid(CBC_ResultPoint *p); |
68 FX_INT32 Distance(CBC_ResultPoint *a, CBC_ResultPoint *b); | 68 int32_t Distance(CBC_ResultPoint *a, CBC_ResultPoint *b); |
69 void Increment(CFX_MapPtrTemplate<CBC_ResultPoint*, FX_INT32> &table, CBC_Re
sultPoint *key); | 69 void Increment(CFX_MapPtrTemplate<CBC_ResultPoint*, int32_t> &table, CBC_Res
ultPoint *key); |
70 FX_INT32 Round(FX_FLOAT d); | 70 int32_t Round(FX_FLOAT d); |
71 void OrderBestPatterns(CFX_PtrArray *patterns); | 71 void OrderBestPatterns(CFX_PtrArray *patterns); |
72 virtual void Init(FX_INT32 &e); | 72 virtual void Init(int32_t &e); |
73 private: | 73 private: |
74 CBC_CommonBitMatrix *m_image; | 74 CBC_CommonBitMatrix *m_image; |
75 CBC_WhiteRectangleDetector *m_rectangleDetector; | 75 CBC_WhiteRectangleDetector *m_rectangleDetector; |
76 const static FX_INT32 INTEGERS[5]; | 76 const static int32_t INTEGERS[5]; |
77 }; | 77 }; |
78 #endif | 78 #endif |
OLD | NEW |