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 XFA_SRC_FXBARCODE_ONED_BC_ONEDIMREADER_H_ | 7 #ifndef XFA_SRC_FXBARCODE_ONED_BC_ONEDIMREADER_H_ |
8 #define XFA_SRC_FXBARCODE_ONED_BC_ONEDIMREADER_H_ | 8 #define XFA_SRC_FXBARCODE_ONED_BC_ONEDIMREADER_H_ |
9 | 9 |
10 #include "core/include/fxcrt/fx_basic.h" | 10 #include "core/include/fxcrt/fx_basic.h" |
11 #include "xfa/src/fxbarcode/oned/BC_OneDReader.h" | 11 #include "xfa/src/fxbarcode/oned/BC_OneDReader.h" |
12 | 12 |
13 class CBC_CommonBitArray; | 13 class CBC_CommonBitArray; |
14 | 14 |
15 class CBC_OneDimReader : public CBC_OneDReader { | 15 class CBC_OneDimReader : public CBC_OneDReader { |
16 private: | 16 private: |
17 const static int32_t MAX_AVG_VARIANCE; | 17 static const int32_t MAX_AVG_VARIANCE = (int32_t)(256 * 0.48f); |
18 const static int32_t MAX_INDIVIDUAL_VARIANCE; | 18 static const int32_t MAX_INDIVIDUAL_VARIANCE = (int32_t)(256 * 0.7f); |
19 | 19 |
20 FX_BOOL CheckStandardUPCEANChecksum(CFX_ByteString& s, int32_t& e); | 20 FX_BOOL CheckStandardUPCEANChecksum(CFX_ByteString& s, int32_t& e); |
21 | 21 |
22 public: | 22 public: |
23 const static int32_t START_END_PATTERN[3]; | 23 static const int32_t START_END_PATTERN[3]; |
24 const static int32_t MIDDLE_PATTERN[5]; | 24 static const int32_t MIDDLE_PATTERN[5]; |
25 const static int32_t L_PATTERNS[10][4]; | 25 static const int32_t L_PATTERNS[10][4]; |
26 const static int32_t L_AND_G_PATTERNS[20][4]; | 26 static const int32_t L_AND_G_PATTERNS[20][4]; |
| 27 |
27 CBC_OneDimReader(); | 28 CBC_OneDimReader(); |
28 virtual ~CBC_OneDimReader(); | 29 virtual ~CBC_OneDimReader(); |
| 30 |
29 CFX_ByteString DecodeRow(int32_t rowNumber, | 31 CFX_ByteString DecodeRow(int32_t rowNumber, |
30 CBC_CommonBitArray* row, | 32 CBC_CommonBitArray* row, |
31 int32_t hints, | 33 int32_t hints, |
32 int32_t& e); | 34 int32_t& e); |
33 CFX_ByteString DecodeRow(int32_t rowNumber, | 35 CFX_ByteString DecodeRow(int32_t rowNumber, |
34 CBC_CommonBitArray* row, | 36 CBC_CommonBitArray* row, |
35 CFX_Int32Array* startGuardRange, | 37 CFX_Int32Array* startGuardRange, |
36 int32_t hints, | 38 int32_t hints, |
37 int32_t& e); | 39 int32_t& e); |
38 | 40 |
(...skipping 16 matching lines...) Expand all Loading... |
55 CFX_ByteString& resultResult, | 57 CFX_ByteString& resultResult, |
56 int32_t& e) { | 58 int32_t& e) { |
57 return 0; | 59 return 0; |
58 } | 60 } |
59 virtual CFX_Int32Array* DecodeEnd(CBC_CommonBitArray* row, | 61 virtual CFX_Int32Array* DecodeEnd(CBC_CommonBitArray* row, |
60 int32_t endStart, | 62 int32_t endStart, |
61 int32_t& e); | 63 int32_t& e); |
62 }; | 64 }; |
63 | 65 |
64 #endif // XFA_SRC_FXBARCODE_ONED_BC_ONEDIMREADER_H_ | 66 #endif // XFA_SRC_FXBARCODE_ONED_BC_ONEDIMREADER_H_ |
OLD | NEW |