OLD | NEW |
| (Empty) |
1 // Copyright 2014 PDFium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | |
6 | |
7 #ifndef _BC_DATAMATRIXDETECTOR_H_ | |
8 #define _BC_DATAMATRIXDETECTOR_H_ | |
9 class CBC_CommonBitMatrix; | |
10 class CBC_WhiteRectangleDetector; | |
11 class CBC_ResultPoint; | |
12 class CBC_QRDetectorResult; | |
13 class CBC_DataMatrixDetector; | |
14 class ResultPointsAndTransitions; | |
15 class CBC_ResultPointsAndTransitions : public CFX_Object | |
16 { | |
17 public: | |
18 CBC_ResultPointsAndTransitions(CBC_ResultPoint *from, CBC_ResultPoint *to, F
X_INT32 transitions) | |
19 { | |
20 m_from = from; | |
21 m_to = to; | |
22 m_transitions = transitions; | |
23 } | |
24 ~CBC_ResultPointsAndTransitions() | |
25 { | |
26 } | |
27 CBC_ResultPoint *GetFrom() | |
28 { | |
29 return m_from; | |
30 } | |
31 CBC_ResultPoint *GetTo() | |
32 { | |
33 return m_to; | |
34 } | |
35 FX_INT32 GetTransitions() | |
36 { | |
37 return m_transitions; | |
38 } | |
39 private: | |
40 CBC_ResultPoint *m_from; | |
41 CBC_ResultPoint *m_to; | |
42 FX_INT32 m_transitions; | |
43 }; | |
44 class CBC_DataMatrixDetector | |
45 { | |
46 public: | |
47 CBC_DataMatrixDetector(CBC_CommonBitMatrix *image); | |
48 virtual ~CBC_DataMatrixDetector(); | |
49 CBC_QRDetectorResult *Detect(FX_INT32 &e); | |
50 CBC_ResultPoint *CorrectTopRightRectangular(CBC_ResultPoint *bottomLeft, | |
51 CBC_ResultPoint *bottomRight, | |
52 CBC_ResultPoint *topLeft, | |
53 CBC_ResultPoint *topRight, | |
54 FX_INT32 dimensionTop, FX_INT32 dimensionRight); | |
55 CBC_ResultPoint *CorrectTopRight(CBC_ResultPoint *bottomLeft, | |
56 CBC_ResultPoint *bottomRight, | |
57 CBC_ResultPoint *topLeft, | |
58 CBC_ResultPoint *topRight, | |
59 FX_INT32 dimension); | |
60 CBC_CommonBitMatrix *SampleGrid(CBC_CommonBitMatrix *image, | |
61 CBC_ResultPoint *topLeft, | |
62 CBC_ResultPoint *bottomLeft, | |
63 CBC_ResultPoint *bottomRight, | |
64 CBC_ResultPoint *topRight, | |
65 FX_INT32 dimensionX, FX_INT32 dimensionY, FX
_INT32 &e); | |
66 CBC_ResultPointsAndTransitions *TransitionsBetween(CBC_ResultPoint *from, CB
C_ResultPoint *to); | |
67 FX_BOOL IsValid(CBC_ResultPoint *p); | |
68 FX_INT32 Distance(CBC_ResultPoint *a, CBC_ResultPoint *b); | |
69 void Increment(CFX_MapPtrTemplate<CBC_ResultPoint*, FX_INT32> &table, CBC_Re
sultPoint *key); | |
70 FX_INT32 Round(FX_FLOAT d); | |
71 void OrderBestPatterns(CFX_PtrArray *patterns); | |
72 virtual void Init(FX_INT32 &e); | |
73 private: | |
74 CBC_CommonBitMatrix *m_image; | |
75 CBC_WhiteRectangleDetector *m_rectangleDetector; | |
76 const static FX_INT32 INTEGERS[5]; | |
77 }; | |
78 #endif | |
OLD | NEW |