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_FXBARCODE_ONED_BC_ONEDREADER_H_ | 7 #ifndef XFA_FXBARCODE_ONED_BC_ONEDREADER_H_ |
8 #define XFA_FXBARCODE_ONED_BC_ONEDREADER_H_ | 8 #define XFA_FXBARCODE_ONED_BC_ONEDREADER_H_ |
9 | 9 |
10 #include "xfa/fxbarcode/BC_Reader.h" | 10 #include "xfa/fxbarcode/BC_Reader.h" |
11 | 11 |
12 class CBC_BinaryBitmap; | 12 class CBC_BinaryBitmap; |
13 class CBC_CommonBitArray; | 13 class CBC_CommonBitArray; |
14 | 14 |
15 class CBC_OneDReader : public CBC_Reader { | 15 class CBC_OneDReader : public CBC_Reader { |
16 public: | 16 public: |
17 CBC_OneDReader(); | 17 CBC_OneDReader(); |
18 virtual ~CBC_OneDReader(); | 18 ~CBC_OneDReader() override; |
19 virtual CFX_ByteString Decode(CBC_BinaryBitmap* image, int32_t& e); | 19 |
20 virtual CFX_ByteString Decode(CBC_BinaryBitmap* image, | 20 // CBC_Reader |
21 int32_t hints, | 21 CFX_ByteString Decode(CBC_BinaryBitmap* image, int32_t& e) override; |
22 int32_t& e); | 22 CFX_ByteString Decode(CBC_BinaryBitmap* image, |
| 23 int32_t hints, |
| 24 int32_t& e) override; |
| 25 |
23 virtual CFX_ByteString DecodeRow(int32_t rowNumber, | 26 virtual CFX_ByteString DecodeRow(int32_t rowNumber, |
24 CBC_CommonBitArray* row, | 27 CBC_CommonBitArray* row, |
25 int32_t hints, | 28 int32_t hints, |
26 int32_t& e) { | 29 int32_t& e); |
27 return ""; | |
28 } | |
29 | 30 |
30 private: | 31 private: |
31 CFX_ByteString DeDecode(CBC_BinaryBitmap* image, int32_t hints, int32_t& e); | 32 CFX_ByteString DeDecode(CBC_BinaryBitmap* image, int32_t hints, int32_t& e); |
32 | 33 |
33 protected: | 34 protected: |
34 static const int32_t INTEGER_MATH_SHIFT = 8; | 35 static const int32_t INTEGER_MATH_SHIFT = 8; |
35 static const int32_t PATTERN_MATCH_RESULT_SCALE_FACTOR = 1 << 8; | 36 static const int32_t PATTERN_MATCH_RESULT_SCALE_FACTOR = 1 << 8; |
36 | 37 |
37 void RecordPattern(CBC_CommonBitArray* row, | 38 void RecordPattern(CBC_CommonBitArray* row, |
38 int32_t start, | 39 int32_t start, |
39 CFX_Int32Array* counters, | 40 CFX_Int32Array* counters, |
40 int32_t& e); | 41 int32_t& e); |
41 void RecordPatternInReverse(CBC_CommonBitArray* row, | 42 void RecordPatternInReverse(CBC_CommonBitArray* row, |
42 int32_t start, | 43 int32_t start, |
43 CFX_Int32Array* counters, | 44 CFX_Int32Array* counters, |
44 int32_t& e); | 45 int32_t& e); |
45 int32_t PatternMatchVariance(CFX_Int32Array* counters, | 46 int32_t PatternMatchVariance(CFX_Int32Array* counters, |
46 const int32_t* pattern, | 47 const int32_t* pattern, |
47 int32_t maxIndividualVariance); | 48 int32_t maxIndividualVariance); |
48 }; | 49 }; |
49 | 50 |
50 #endif // XFA_FXBARCODE_ONED_BC_ONEDREADER_H_ | 51 #endif // XFA_FXBARCODE_ONED_BC_ONEDREADER_H_ |
OLD | NEW |