K. Moon | 832a694 | 2022-10-31 20:11:31 +0000 | [diff] [blame] | 1 | // Copyright 2016 The PDFium Authors |
dsinclair | d55e11e | 2016-04-12 11:21:22 -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 | |
Lei Zhang | ffa67dd | 2019-06-17 20:27:52 +0000 | [diff] [blame] | 7 | #ifndef CORE_FXCODEC_BASIC_BASICMODULE_H_ |
| 8 | #define CORE_FXCODEC_BASIC_BASICMODULE_H_ |
dsinclair | d55e11e | 2016-04-12 11:21:22 -0700 | [diff] [blame] | 9 | |
Tom Sepez | 78e069b | 2021-07-27 00:13:22 +0000 | [diff] [blame] | 10 | #include <stdint.h> |
| 11 | |
tsepez | 974b4a6 | 2016-12-13 12:48:13 -0800 | [diff] [blame] | 12 | #include <memory> |
| 13 | |
Lei Zhang | 219be71 | 2022-09-07 00:24:43 +0000 | [diff] [blame] | 14 | #include "core/fxcrt/data_vector.h" |
Tom Sepez | 991f5b7 | 2018-08-27 23:27:29 +0000 | [diff] [blame] | 15 | #include "third_party/base/span.h" |
dsinclair | d55e11e | 2016-04-12 11:21:22 -0700 | [diff] [blame] | 16 | |
Lei Zhang | d6a38d9 | 2019-06-12 04:11:17 +0000 | [diff] [blame] | 17 | namespace fxcodec { |
| 18 | |
Lei Zhang | 125074f | 2019-06-12 04:13:17 +0000 | [diff] [blame] | 19 | class ScanlineDecoder; |
| 20 | |
Lei Zhang | d6a38d9 | 2019-06-12 04:11:17 +0000 | [diff] [blame] | 21 | class BasicModule { |
dsinclair | d55e11e | 2016-04-12 11:21:22 -0700 | [diff] [blame] | 22 | public: |
Lei Zhang | 125074f | 2019-06-12 04:13:17 +0000 | [diff] [blame] | 23 | static std::unique_ptr<ScanlineDecoder> CreateRunLengthDecoder( |
Tom Sepez | 991f5b7 | 2018-08-27 23:27:29 +0000 | [diff] [blame] | 24 | pdfium::span<const uint8_t> src_buf, |
tsepez | 974b4a6 | 2016-12-13 12:48:13 -0800 | [diff] [blame] | 25 | int width, |
| 26 | int height, |
| 27 | int nComps, |
| 28 | int bpc); |
Tom Sepez | 3b83e83 | 2018-08-30 22:23:37 +0000 | [diff] [blame] | 29 | |
Lei Zhang | 219be71 | 2022-09-07 00:24:43 +0000 | [diff] [blame] | 30 | static DataVector<uint8_t> RunLengthEncode( |
| 31 | pdfium::span<const uint8_t> src_span); |
Tom Sepez | 3b83e83 | 2018-08-30 22:23:37 +0000 | [diff] [blame] | 32 | |
Lei Zhang | b39d480 | 2022-09-07 01:44:22 +0000 | [diff] [blame] | 33 | static DataVector<uint8_t> A85Encode(pdfium::span<const uint8_t> src_span); |
Lei Zhang | 56db4e4 | 2019-05-29 20:40:41 +0000 | [diff] [blame] | 34 | |
Lei Zhang | d6a38d9 | 2019-06-12 04:11:17 +0000 | [diff] [blame] | 35 | BasicModule() = delete; |
| 36 | BasicModule(const BasicModule&) = delete; |
| 37 | BasicModule& operator=(const BasicModule&) = delete; |
dsinclair | d55e11e | 2016-04-12 11:21:22 -0700 | [diff] [blame] | 38 | }; |
| 39 | |
Lei Zhang | d6a38d9 | 2019-06-12 04:11:17 +0000 | [diff] [blame] | 40 | } // namespace fxcodec |
| 41 | |
| 42 | using BasicModule = fxcodec::BasicModule; |
| 43 | |
Lei Zhang | ffa67dd | 2019-06-17 20:27:52 +0000 | [diff] [blame] | 44 | #endif // CORE_FXCODEC_BASIC_BASICMODULE_H_ |