• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 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 CORE_FXCODEC_CODEC_CCODEC_FLATEMODULE_H_
8 #define CORE_FXCODEC_CODEC_CCODEC_FLATEMODULE_H_
9 
10 #include <memory>
11 
12 #include "core/fxcrt/fx_system.h"
13 
14 class CCodec_ScanlineDecoder;
15 
16 class CCodec_FlateModule {
17  public:
18   std::unique_ptr<CCodec_ScanlineDecoder> CreateDecoder(const uint8_t* src_buf,
19                                                         uint32_t src_size,
20                                                         int width,
21                                                         int height,
22                                                         int nComps,
23                                                         int bpc,
24                                                         int predictor,
25                                                         int Colors,
26                                                         int BitsPerComponent,
27                                                         int Columns);
28   uint32_t FlateOrLZWDecode(bool bLZW,
29                             const uint8_t* src_buf,
30                             uint32_t src_size,
31                             bool bEarlyChange,
32                             int predictor,
33                             int Colors,
34                             int BitsPerComponent,
35                             int Columns,
36                             uint32_t estimated_size,
37                             uint8_t** dest_buf,
38                             uint32_t* dest_size);
39 
40   bool Encode(const uint8_t* src_buf,
41               uint32_t src_size,
42               uint8_t** dest_buf,
43               uint32_t* dest_size);
44 
45   bool PngEncode(const uint8_t* src_buf,
46                  uint32_t src_size,
47                  uint8_t** dest_buf,
48                  uint32_t* dest_size);
49 };
50 
51 #endif  // CORE_FXCODEC_CODEC_CCODEC_FLATEMODULE_H_
52