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_DETECTOR_H_ | 7 #ifndef _BC_DETECTOR_H_ |
8 #define _BC_DETECTOR_H_ | 8 #define _BC_DETECTOR_H_ |
9 class CBC_PDF417DetectorResult; | 9 class CBC_PDF417DetectorResult; |
10 class CBC_BinaryBitmap; | 10 class CBC_BinaryBitmap; |
11 class CBC_CommonBitMatrix; | 11 class CBC_CommonBitMatrix; |
12 class CBC_CommonBitArray; | 12 class CBC_CommonBitArray; |
13 class CBC_Detector | 13 class CBC_Detector |
14 { | 14 { |
15 public: | 15 public: |
16 CBC_Detector(); | 16 CBC_Detector(); |
17 virtual ~CBC_Detector(); | 17 virtual ~CBC_Detector(); |
18 static CBC_PDF417DetectorResult* detect(CBC_BinaryBitmap* image, FX_INT32 hi
nts, FX_BOOL multiple, FX_INT32 &e); | 18 static CBC_PDF417DetectorResult* detect(CBC_BinaryBitmap* image, int32_t hin
ts, FX_BOOL multiple, int32_t &e); |
19 static void rotate180(CBC_CommonBitMatrix* bitMatrix); | 19 static void rotate180(CBC_CommonBitMatrix* bitMatrix); |
20 static CBC_CommonBitArray* mirror(CBC_CommonBitArray* input, CBC_CommonBitAr
ray* result); | 20 static CBC_CommonBitArray* mirror(CBC_CommonBitArray* input, CBC_CommonBitAr
ray* result); |
21 private: | 21 private: |
22 static FX_INT32 INDEXES_START_PATTERN[]; | 22 static int32_t INDEXES_START_PATTERN[]; |
23 static FX_INT32 INDEXES_STOP_PATTERN[]; | 23 static int32_t INDEXES_STOP_PATTERN[]; |
24 static FX_INT32 INTEGER_MATH_SHIFT; | 24 static int32_t INTEGER_MATH_SHIFT; |
25 static FX_INT32 PATTERN_MATCH_RESULT_SCALE_FACTOR; | 25 static int32_t PATTERN_MATCH_RESULT_SCALE_FACTOR; |
26 static FX_INT32 MAX_AVG_VARIANCE; | 26 static int32_t MAX_AVG_VARIANCE; |
27 static FX_INT32 MAX_INDIVIDUAL_VARIANCE; | 27 static int32_t MAX_INDIVIDUAL_VARIANCE; |
28 static FX_INT32 START_PATTERN[]; | 28 static int32_t START_PATTERN[]; |
29 static FX_INT32 STOP_PATTERN[]; | 29 static int32_t STOP_PATTERN[]; |
30 static FX_INT32 MAX_PIXEL_DRIFT; | 30 static int32_t MAX_PIXEL_DRIFT; |
31 static FX_INT32 MAX_PATTERN_DRIFT; | 31 static int32_t MAX_PATTERN_DRIFT; |
32 static FX_INT32 SKIPPED_ROW_COUNT_MAX; | 32 static int32_t SKIPPED_ROW_COUNT_MAX; |
33 static FX_INT32 ROW_STEP; | 33 static int32_t ROW_STEP; |
34 static FX_INT32 BARCODE_MIN_HEIGHT; | 34 static int32_t BARCODE_MIN_HEIGHT; |
35 static CFX_PtrArray* detect(FX_BOOL multiple, CBC_CommonBitMatrix* bitMatrix
); | 35 static CFX_PtrArray* detect(FX_BOOL multiple, CBC_CommonBitMatrix* bitMatrix
); |
36 static CFX_PtrArray* findVertices(CBC_CommonBitMatrix* matrix, FX_INT32 star
tRow, FX_INT32 startColumn); | 36 static CFX_PtrArray* findVertices(CBC_CommonBitMatrix* matrix, int32_t start
Row, int32_t startColumn); |
37 static void copyToResult(CFX_PtrArray* result, CFX_PtrArray* tmpResult, FX_I
NT32* destinationIndexes, FX_INT32 destinationLength); | 37 static void copyToResult(CFX_PtrArray* result, CFX_PtrArray* tmpResult, int3
2_t* destinationIndexes, int32_t destinationLength); |
38 static CFX_PtrArray* findRowsWithPattern(CBC_CommonBitMatrix* matrix, FX_INT
32 height, FX_INT32 width, FX_INT32 startRow, FX_INT32 startColumn, FX_INT32* pa
ttern, FX_INT32 patternLength); | 38 static CFX_PtrArray* findRowsWithPattern(CBC_CommonBitMatrix* matrix, int32_
t height, int32_t width, int32_t startRow, int32_t startColumn, int32_t* pattern
, int32_t patternLength); |
39 static CFX_Int32Array* findGuardPattern(CBC_CommonBitMatrix* matrix, FX_INT3
2 column, FX_INT32 row, FX_INT32 width, FX_BOOL whiteFirst, FX_INT32* pattern, F
X_INT32 patternLength, CFX_Int32Array &counters); | 39 static CFX_Int32Array* findGuardPattern(CBC_CommonBitMatrix* matrix, int32_t
column, int32_t row, int32_t width, FX_BOOL whiteFirst, int32_t* pattern, int32
_t patternLength, CFX_Int32Array &counters); |
40 static FX_INT32 patternMatchVariance(CFX_Int32Array &counters, FX_INT32* pat
tern, FX_INT32 maxIndividualVariance); | 40 static int32_t patternMatchVariance(CFX_Int32Array &counters, int32_t* patte
rn, int32_t maxIndividualVariance); |
41 }; | 41 }; |
42 #endif | 42 #endif |
OLD | NEW |