| 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_FAX_FAXMODULE_H_ |
| 8 |
#define CORE_FXCODEC_FAX_FAXMODULE_H_ |
| 9 |
|
| 10 |
#include <stdint.h> |
| 11 |
|
| 12 |
#include <memory> |
| 13 |
|
| 14 |
#include <pdfium/third_party/base/span.h> |
| 15 |
|
| 16 |
namespace chromium { |
| 17 |
|
| 18 |
class ScanlineDecoder; |
| 19 |
|
| 20 |
class FaxModule { |
| 21 |
public: |
| 22 |
static std::unique_ptr<ScanlineDecoder> CreateDecoder( |
| 23 |
pdfium::span<const uint8_t> src_span, |
| 24 |
int width, |
| 25 |
int height, |
| 26 |
int K, |
| 27 |
bool EndOfLine, |
| 28 |
bool EncodedByteAlign, |
| 29 |
bool BlackIs1, |
| 30 |
int Columns, |
| 31 |
int Rows); |
| 32 |
|
| 33 |
// Return the ending bit position. |
| 34 |
static int FaxG4Decode(const uint8_t* src_buf, |
| 35 |
uint32_t src_size, |
| 36 |
int starting_bitpos, |
| 37 |
int width, |
| 38 |
int height, |
| 39 |
int pitch, |
| 40 |
uint8_t* dest_buf); |
| 41 |
|
| 42 |
FaxModule() = delete; |
| 43 |
FaxModule(const FaxModule&) = delete; |
| 44 |
FaxModule& operator=(const FaxModule&) = delete; |
| 45 |
}; |
| 46 |
|
| 47 |
} // namespace chromium |
| 48 |
|
| 49 |
using FaxModule = chromium::FaxModule; |
| 50 |
|
| 51 |
#endif // CORE_FXCODEC_FAX_FAXMODULE_H_ |