kumarashishg | 826308d | 2023-06-23 13:21:22 +0000 | [diff] [blame] | 1 | // Copyright 2016 The PDFium Authors |
Haibo Huang | 49cc930 | 2020-04-27 16:14:24 -0700 | [diff] [blame] | 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 | |
kumarashishg | 826308d | 2023-06-23 13:21:22 +0000 | [diff] [blame] | 10 | #include <stdint.h> |
| 11 | |
Haibo Huang | 49cc930 | 2020-04-27 16:14:24 -0700 | [diff] [blame] | 12 | #include <memory> |
| 13 | |
kumarashishg | 826308d | 2023-06-23 13:21:22 +0000 | [diff] [blame] | 14 | #include "core/fxcrt/data_vector.h" |
Haibo Huang | 49cc930 | 2020-04-27 16:14:24 -0700 | [diff] [blame] | 15 | #include "third_party/base/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 | |
kumarashishg | 826308d | 2023-06-23 13:21:22 +0000 | [diff] [blame] | 30 | static DataVector<uint8_t> RunLengthEncode( |
| 31 | pdfium::span<const uint8_t> src_span); |
Haibo Huang | 49cc930 | 2020-04-27 16:14:24 -0700 | [diff] [blame] | 32 | |
kumarashishg | 826308d | 2023-06-23 13:21:22 +0000 | [diff] [blame] | 33 | static DataVector<uint8_t> A85Encode(pdfium::span<const uint8_t> src_span); |
Haibo Huang | 49cc930 | 2020-04-27 16:14:24 -0700 | [diff] [blame] | 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_ |