Merge XFA to PDFium master at 4dc95e7 on 10/28/2014
[pdfium.git] / xfa / src / fxbarcode / src / include / BC_PDF417Detector.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_DETECTOR_H_\r
8 #define _BC_DETECTOR_H_\r
9 class CBC_PDF417DetectorResult;\r
10 class CBC_BinaryBitmap;\r
11 class CBC_CommonBitMatrix;\r
12 class CBC_CommonBitArray;\r
13 class CBC_Detector;\r
14 class CBC_Detector : public CFX_Object\r
15 {\r
16 public:\r
17     CBC_Detector();\r
18     virtual ~CBC_Detector();\r
19     static CBC_PDF417DetectorResult* detect(CBC_BinaryBitmap* image, FX_INT32 hints, FX_BOOL multiple, FX_INT32 &e);\r
20     static void rotate180(CBC_CommonBitMatrix* bitMatrix);\r
21     static CBC_CommonBitArray* mirror(CBC_CommonBitArray* input, CBC_CommonBitArray* result);\r
22 private:\r
23     static FX_INT32 INDEXES_START_PATTERN[];\r
24     static FX_INT32 INDEXES_STOP_PATTERN[];\r
25     static FX_INT32 INTEGER_MATH_SHIFT;\r
26     static FX_INT32 PATTERN_MATCH_RESULT_SCALE_FACTOR;\r
27     static FX_INT32 MAX_AVG_VARIANCE;\r
28     static FX_INT32 MAX_INDIVIDUAL_VARIANCE;\r
29     static FX_INT32 START_PATTERN[];\r
30     static FX_INT32 STOP_PATTERN[];\r
31     static FX_INT32 MAX_PIXEL_DRIFT;\r
32     static FX_INT32 MAX_PATTERN_DRIFT;\r
33     static FX_INT32 SKIPPED_ROW_COUNT_MAX;\r
34     static FX_INT32 ROW_STEP;\r
35     static FX_INT32 BARCODE_MIN_HEIGHT;\r
36     static CFX_PtrArray* detect(FX_BOOL multiple, CBC_CommonBitMatrix* bitMatrix);\r
37     static CFX_PtrArray* findVertices(CBC_CommonBitMatrix* matrix, FX_INT32 startRow, FX_INT32 startColumn);\r
38     static void copyToResult(CFX_PtrArray* result, CFX_PtrArray* tmpResult, FX_INT32* destinationIndexes, FX_INT32 destinationLength);\r
39     static CFX_PtrArray* findRowsWithPattern(CBC_CommonBitMatrix* matrix, FX_INT32 height, FX_INT32 width, FX_INT32 startRow, FX_INT32 startColumn, FX_INT32* pattern, FX_INT32 patternLength);\r
40     static CFX_Int32Array* findGuardPattern(CBC_CommonBitMatrix* matrix, FX_INT32 column, FX_INT32 row, FX_INT32 width, FX_BOOL whiteFirst, FX_INT32* pattern, FX_INT32 patternLength, CFX_Int32Array &counters);\r
41     static FX_INT32 patternMatchVariance(CFX_Int32Array &counters, FX_INT32* pattern, FX_INT32 maxIndividualVariance);\r
42 };\r
43 #endif\r