aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/qpdf/SF_RunLengthDecode.hh
blob: a1c8c80ad8eac6f458ed6325416b96560026e0a3 (plain) (blame)
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
#include <qpdf/Pl_RunLength.hh>
#include <qpdf/QPDFStreamFilter.hh>
#include <memory>

#ifndef SF_RUNLENGTHDECODE_HH
# define SF_RUNLENGTHDECODE_HH

class SF_RunLengthDecode: public QPDFStreamFilter
{
  public:
    SF_RunLengthDecode() = default;
    virtual ~SF_RunLengthDecode() = default;

    virtual Pipeline*
    getDecodePipeline(Pipeline* next) override
    {
        this->pipeline = std::make_shared<Pl_RunLength>(
            "runlength decode", next, Pl_RunLength::a_decode);
        return this->pipeline.get();
    }

    static std::shared_ptr<QPDFStreamFilter>
    factory()
    {
        return std::make_shared<SF_RunLengthDecode>();
    }

    virtual bool
    isSpecializedCompression() override
    {
        return true;
    }

  private:
    std::shared_ptr<Pipeline> pipeline;
};

#endif // SF_RUNLENGTHDECODE_HH