blob: a2573498eb3d91eb6136ab7b4da65e4561ac6cc8 [file] [log] [blame]
K. Moon832a6942022-10-31 20:11:31 +00001// Copyright 2016 The PDFium Authors
dsinclaird55e11e2016-04-12 11:21:22 -07002// 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 Zhangffa67dd2019-06-17 20:27:52 +00007#ifndef CORE_FXCODEC_BASIC_BASICMODULE_H_
8#define CORE_FXCODEC_BASIC_BASICMODULE_H_
dsinclaird55e11e2016-04-12 11:21:22 -07009
Tom Sepez78e069b2021-07-27 00:13:22 +000010#include <stdint.h>
11
tsepez974b4a62016-12-13 12:48:13 -080012#include <memory>
13
Lei Zhang219be712022-09-07 00:24:43 +000014#include "core/fxcrt/data_vector.h"
Tom Sepez991f5b72018-08-27 23:27:29 +000015#include "third_party/base/span.h"
dsinclaird55e11e2016-04-12 11:21:22 -070016
Lei Zhangd6a38d92019-06-12 04:11:17 +000017namespace fxcodec {
18
Lei Zhang125074f2019-06-12 04:13:17 +000019class ScanlineDecoder;
20
Lei Zhangd6a38d92019-06-12 04:11:17 +000021class BasicModule {
dsinclaird55e11e2016-04-12 11:21:22 -070022 public:
Lei Zhang125074f2019-06-12 04:13:17 +000023 static std::unique_ptr<ScanlineDecoder> CreateRunLengthDecoder(
Tom Sepez991f5b72018-08-27 23:27:29 +000024 pdfium::span<const uint8_t> src_buf,
tsepez974b4a62016-12-13 12:48:13 -080025 int width,
26 int height,
27 int nComps,
28 int bpc);
Tom Sepez3b83e832018-08-30 22:23:37 +000029
Lei Zhang219be712022-09-07 00:24:43 +000030 static DataVector<uint8_t> RunLengthEncode(
31 pdfium::span<const uint8_t> src_span);
Tom Sepez3b83e832018-08-30 22:23:37 +000032
Lei Zhangb39d4802022-09-07 01:44:22 +000033 static DataVector<uint8_t> A85Encode(pdfium::span<const uint8_t> src_span);
Lei Zhang56db4e42019-05-29 20:40:41 +000034
Lei Zhangd6a38d92019-06-12 04:11:17 +000035 BasicModule() = delete;
36 BasicModule(const BasicModule&) = delete;
37 BasicModule& operator=(const BasicModule&) = delete;
dsinclaird55e11e2016-04-12 11:21:22 -070038};
39
Lei Zhangd6a38d92019-06-12 04:11:17 +000040} // namespace fxcodec
41
42using BasicModule = fxcodec::BasicModule;
43
Lei Zhangffa67dd2019-06-17 20:27:52 +000044#endif // CORE_FXCODEC_BASIC_BASICMODULE_H_