Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / src / fxbarcode / src / include / BC_QRDetector.h
1 // Copyright 2014 PDFium Authors. All rights reserved.\r
2 // Use of this source code is governed by a BSD-style license that can be\r
3 // found in the LICENSE file.\r
4 \r
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com\r
6 \r
7 #ifndef _BC_QRDETECTOR_H_\r
8 #define _BC_QRDETECTOR_H_\r
9 class CBC_ResultPoint;\r
10 class CBC_CommonBitMatrix;\r
11 class CBC_QRDetectorResult;\r
12 class CBC_QRFinderPatternInfo;\r
13 class CBC_QRAlignmentPattern;\r
14 class CBC_QRFinderPatternFinder;\r
15 class CBC_QRCoderVersion;\r
16 class CBC_QRGridSampler;\r
17 class CBC_QRAlignmentPatternFinder;\r
18 class CBC_QRAlignmentPattern;\r
19 class CBC_QRDetector;\r
20 class CBC_QRDetector\r
21 {\r
22 private:\r
23     CBC_CommonBitMatrix *m_image;\r
24 public:\r
25     CBC_QRDetector(CBC_CommonBitMatrix *image);\r
26     virtual ~CBC_QRDetector();\r
27 \r
28     CBC_CommonBitMatrix* GetImage();\r
29     CBC_QRDetectorResult* Detect(FX_INT32 hints, FX_INT32 &e);\r
30     CBC_QRDetectorResult* ProcessFinderPatternInfo(CBC_QRFinderPatternInfo *info, FX_INT32 &e);\r
31     FX_FLOAT CalculateModuleSize(CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, CBC_ResultPoint *bottomLeft);\r
32     FX_FLOAT CalculateModuleSizeOneWay(CBC_ResultPoint *pattern, CBC_ResultPoint *otherPattern);\r
33     FX_FLOAT SizeOfBlackWhiteBlackRunBothWays(FX_INT32 fromX, FX_INT32 fromY, FX_INT32 toX, FX_INT32 toY);\r
34     FX_FLOAT SizeOfBlackWhiteBlackRun(FX_INT32 fromX, FX_INT32 fromY, FX_INT32 toX, FX_INT32 toY);\r
35     CBC_QRAlignmentPattern* FindAlignmentInRegion(FX_FLOAT overallEstModuleSize, FX_INT32 estAlignmentX, FX_INT32 estAlignmentY, FX_FLOAT allowanceFactor, FX_INT32 &e);\r
36     static FX_INT32 Round(FX_FLOAT d);\r
37     static FX_INT32 ComputeDimension(CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight, CBC_ResultPoint *bottomLeft, FX_FLOAT moduleSize, FX_INT32 &e);\r
38     static CBC_CommonBitMatrix* SampleGrid(CBC_CommonBitMatrix *image, CBC_ResultPoint *topLeft, CBC_ResultPoint *topRight,\r
39                                            CBC_ResultPoint *bottomLeft, CBC_ResultPoint* alignmentPattern, FX_INT32 dimension, FX_INT32 &e);\r
40 };\r
41 #endif\r