xref: /aosp_15_r20/external/pdfium/core/fxcodec/basic/basicmodule.h (revision 3ac0a46f773bac49fa9476ec2b1cf3f8da5ec3a4)
1 // Copyright 2016 The PDFium Authors
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 <stdint.h>
11 
12 #include <memory>
13 
14 #include "core/fxcrt/data_vector.h"
15 #include "third_party/base/containers/span.h"
16 
17 namespace fxcodec {
18 
19 class ScanlineDecoder;
20 
21 class BasicModule {
22  public:
23   static std::unique_ptr<ScanlineDecoder> CreateRunLengthDecoder(
24       pdfium::span<const uint8_t> src_buf,
25       int width,
26       int height,
27       int nComps,
28       int bpc);
29 
30   static DataVector<uint8_t> RunLengthEncode(
31       pdfium::span<const uint8_t> src_span);
32 
33   static DataVector<uint8_t> A85Encode(pdfium::span<const uint8_t> src_span);
34 
35   BasicModule() = delete;
36   BasicModule(const BasicModule&) = delete;
37   BasicModule& operator=(const BasicModule&) = delete;
38 };
39 
40 }  // namespace fxcodec
41 
42 using BasicModule = fxcodec::BasicModule;
43 
44 #endif  // CORE_FXCODEC_BASIC_BASICMODULE_H_
45