| 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 XFA_SRC_FXBARCODE_QRCODE_BC_QRDETECTOR_H_ | |
| 8 #define XFA_SRC_FXBARCODE_QRCODE_BC_QRDETECTOR_H_ | |
| 9 | |
| 10 #include "core/include/fxcrt/fx_basic.h" | |
| 11 | |
| 12 class CBC_ResultPoint; | |
| 13 class CBC_CommonBitMatrix; | |
| 14 class CBC_QRDetectorResult; | |
| 15 class CBC_QRFinderPatternInfo; | |
| 16 class CBC_QRAlignmentPattern; | |
| 17 | |
| 18 class CBC_QRDetector { | |
| 19 private: | |
| 20 CBC_CommonBitMatrix* m_image; | |
| 21 | |
| 22 public: | |
| 23 CBC_QRDetector(CBC_CommonBitMatrix* image); | |
| 24 virtual ~CBC_QRDetector(); | |
| 25 | |
| 26 CBC_CommonBitMatrix* GetImage(); | |
| 27 CBC_QRDetectorResult* Detect(int32_t hints, int32_t& e); | |
| 28 CBC_QRDetectorResult* ProcessFinderPatternInfo(CBC_QRFinderPatternInfo* info, | |
| 29 int32_t& e); | |
| 30 FX_FLOAT CalculateModuleSize(CBC_ResultPoint* topLeft, | |
| 31 CBC_ResultPoint* topRight, | |
| 32 CBC_ResultPoint* bottomLeft); | |
| 33 FX_FLOAT CalculateModuleSizeOneWay(CBC_ResultPoint* pattern, | |
| 34 CBC_ResultPoint* otherPattern); | |
| 35 FX_FLOAT SizeOfBlackWhiteBlackRunBothWays(int32_t fromX, | |
| 36 int32_t fromY, | |
| 37 int32_t toX, | |
| 38 int32_t toY); | |
| 39 FX_FLOAT SizeOfBlackWhiteBlackRun(int32_t fromX, | |
| 40 int32_t fromY, | |
| 41 int32_t toX, | |
| 42 int32_t toY); | |
| 43 CBC_QRAlignmentPattern* FindAlignmentInRegion(FX_FLOAT overallEstModuleSize, | |
| 44 int32_t estAlignmentX, | |
| 45 int32_t estAlignmentY, | |
| 46 FX_FLOAT allowanceFactor, | |
| 47 int32_t& e); | |
| 48 static int32_t Round(FX_FLOAT d); | |
| 49 static int32_t ComputeDimension(CBC_ResultPoint* topLeft, | |
| 50 CBC_ResultPoint* topRight, | |
| 51 CBC_ResultPoint* bottomLeft, | |
| 52 FX_FLOAT moduleSize, | |
| 53 int32_t& e); | |
| 54 static CBC_CommonBitMatrix* SampleGrid(CBC_CommonBitMatrix* image, | |
| 55 CBC_ResultPoint* topLeft, | |
| 56 CBC_ResultPoint* topRight, | |
| 57 CBC_ResultPoint* bottomLeft, | |
| 58 CBC_ResultPoint* alignmentPattern, | |
| 59 int32_t dimension, | |
| 60 int32_t& e); | |
| 61 }; | |
| 62 | |
| 63 #endif // XFA_SRC_FXBARCODE_QRCODE_BC_QRDETECTOR_H_ | |
| OLD | NEW |