• 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_BASIC_BASICMODULE_H_
8 #define CORE_FXCODEC_BASIC_BASICMODULE_H_
9 
10 #include <memory>
11 
12 #include "core/fxcrt/fx_memory_wrappers.h"
13 #include "core/fxcrt/fx_system.h"
14 #include "third_party/base/span.h"
15 
16 namespace fxcodec {
17 
18 class ScanlineDecoder;
19 
20 class BasicModule {
21  public:
22   static std::unique_ptr<ScanlineDecoder> CreateRunLengthDecoder(
23       pdfium::span<const uint8_t> src_buf,
24       int width,
25       int height,
26       int nComps,
27       int bpc);
28 
29   static bool RunLengthEncode(pdfium::span<const uint8_t> src_span,
30                               std::unique_ptr<uint8_t, FxFreeDeleter>* dest_buf,
31                               uint32_t* dest_size);
32 
33   static bool A85Encode(pdfium::span<const uint8_t> src_span,
34                         std::unique_ptr<uint8_t, FxFreeDeleter>* dest_buf,
35                         uint32_t* dest_size);
36 
37   BasicModule() = delete;
38   BasicModule(const BasicModule&) = delete;
39   BasicModule& operator=(const BasicModule&) = delete;
40 };
41 
42 }  // namespace fxcodec
43 
44 using BasicModule = fxcodec::BasicModule;
45 
46 #endif  // CORE_FXCODEC_BASIC_BASICMODULE_H_
47