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