SF_FlateLzwDecode.hh
972 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include <qpdf/QPDFStreamFilter.hh>
#include <memory>
#include <vector>
#ifndef SF_FLATELZWDECODE_HH
# define SF_FLATELZWDECODE_HH
class SF_FlateLzwDecode final: public QPDFStreamFilter
{
public:
SF_FlateLzwDecode(bool lzw) :
lzw(lzw)
{
}
~SF_FlateLzwDecode() final = default;
bool setDecodeParms(QPDFObjectHandle decode_parms) final;
Pipeline* getDecodePipeline(Pipeline* next) final;
static std::shared_ptr<QPDFStreamFilter>
flate_factory()
{
return std::make_shared<SF_FlateLzwDecode>(false);
}
static std::shared_ptr<QPDFStreamFilter>
lzw_factory()
{
return std::make_shared<SF_FlateLzwDecode>(true);
}
private:
bool lzw{};
// Defaults as per the PDF spec
int predictor{1};
int columns{1};
int colors{1};
int bits_per_component{8};
bool early_code_change{true};
std::vector<std::unique_ptr<Pipeline>> pipelines;
};
#endif // SF_FLATELZWDECODE_HH