| 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_WHITERECTANLEDETECTOR_H_ | 7 #ifndef _BC_WHITERECTANLEDETECTOR_H_ |
| 8 #define _BC_WHITERECTANLEDETECTOR_H_ | 8 #define _BC_WHITERECTANLEDETECTOR_H_ |
| 9 class CBC_CommonBitMatrix; | 9 class CBC_CommonBitMatrix; |
| 10 class CBC_ResultPoint; | 10 class CBC_ResultPoint; |
| 11 class CBC_WhiteRectangleDetector; | 11 class CBC_WhiteRectangleDetector |
| 12 class CBC_WhiteRectangleDetector : public CFX_Object | |
| 13 { | 12 { |
| 14 public: | 13 public: |
| 15 CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image); | 14 CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image); |
| 16 CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image, FX_INT32 initSize, FX
_INT32 x, FX_INT32 y); | 15 CBC_WhiteRectangleDetector(CBC_CommonBitMatrix *image, FX_INT32 initSize, FX
_INT32 x, FX_INT32 y); |
| 17 virtual ~CBC_WhiteRectangleDetector(); | 16 virtual ~CBC_WhiteRectangleDetector(); |
| 18 CFX_PtrArray *Detect(FX_INT32 &e); | 17 CFX_PtrArray *Detect(FX_INT32 &e); |
| 19 virtual void Init(FX_INT32 &e); | 18 virtual void Init(FX_INT32 &e); |
| 20 private: | 19 private: |
| 21 FX_INT32 Round(float d); | 20 FX_INT32 Round(float d); |
| 22 CBC_ResultPoint *GetBlackPointOnSegment(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT b
X, FX_FLOAT bY); | 21 CBC_ResultPoint *GetBlackPointOnSegment(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT b
X, FX_FLOAT bY); |
| 23 FX_INT32 DistanceL2(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY); | 22 FX_INT32 DistanceL2(FX_FLOAT aX, FX_FLOAT aY, FX_FLOAT bX, FX_FLOAT bY); |
| 24 CFX_PtrArray *CenterEdges(CBC_ResultPoint *y, CBC_ResultPoint *z, | 23 CFX_PtrArray *CenterEdges(CBC_ResultPoint *y, CBC_ResultPoint *z, |
| 25 CBC_ResultPoint *x, CBC_ResultPoint *t); | 24 CBC_ResultPoint *x, CBC_ResultPoint *t); |
| 26 FX_BOOL ContainsBlackPoint(FX_INT32 a, FX_INT32 b, FX_INT32 fixed, FX_BOOL h
orizontal); | 25 FX_BOOL ContainsBlackPoint(FX_INT32 a, FX_INT32 b, FX_INT32 fixed, FX_BOOL h
orizontal); |
| 27 const static FX_INT32 INIT_SIZE; | 26 const static FX_INT32 INIT_SIZE; |
| 28 const static FX_INT32 CORR; | 27 const static FX_INT32 CORR; |
| 29 | 28 |
| 30 CBC_CommonBitMatrix *m_image; | 29 CBC_CommonBitMatrix *m_image; |
| 31 FX_INT32 m_height; | 30 FX_INT32 m_height; |
| 32 FX_INT32 m_width; | 31 FX_INT32 m_width; |
| 33 FX_INT32 m_leftInit; | 32 FX_INT32 m_leftInit; |
| 34 FX_INT32 m_rightInit; | 33 FX_INT32 m_rightInit; |
| 35 FX_INT32 m_downInit; | 34 FX_INT32 m_downInit; |
| 36 FX_INT32 m_upInit; | 35 FX_INT32 m_upInit; |
| 37 }; | 36 }; |
| 38 #endif | 37 #endif |
| OLD | NEW |