blob: a2573498eb3d91eb6136ab7b4da65e4561ac6cc8 [file] [log] [blame]
kumarashishg826308d2023-06-23 13:21:22 +00001// Copyright 2016 The PDFium Authors
Haibo Huang49cc9302020-04-27 16:14:24 -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
7#ifndef CORE_FXCODEC_BASIC_BASICMODULE_H_
8#define CORE_FXCODEC_BASIC_BASICMODULE_H_
9
kumarashishg826308d2023-06-23 13:21:22 +000010#include <stdint.h>
11
Haibo Huang49cc9302020-04-27 16:14:24 -070012#include <memory>
13
kumarashishg826308d2023-06-23 13:21:22 +000014#include "core/fxcrt/data_vector.h"
Haibo Huang49cc9302020-04-27 16:14:24 -070015#include "third_party/base/span.h"
16
17namespace fxcodec {
18
19class ScanlineDecoder;
20
21class 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
kumarashishg826308d2023-06-23 13:21:22 +000030 static DataVector<uint8_t> RunLengthEncode(
31 pdfium::span<const uint8_t> src_span);
Haibo Huang49cc9302020-04-27 16:14:24 -070032
kumarashishg826308d2023-06-23 13:21:22 +000033 static DataVector<uint8_t> A85Encode(pdfium::span<const uint8_t> src_span);
Haibo Huang49cc9302020-04-27 16:14:24 -070034
35 BasicModule() = delete;
36 BasicModule(const BasicModule&) = delete;
37 BasicModule& operator=(const BasicModule&) = delete;
38};
39
40} // namespace fxcodec
41
42using BasicModule = fxcodec::BasicModule;
43
44#endif // CORE_FXCODEC_BASIC_BASICMODULE_H_