diff options
Diffstat (limited to 'libqpdf/qpdf/SF_RunLengthDecode.hh')
-rw-r--r-- | libqpdf/qpdf/SF_RunLengthDecode.hh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libqpdf/qpdf/SF_RunLengthDecode.hh b/libqpdf/qpdf/SF_RunLengthDecode.hh new file mode 100644 index 00000000..1bdfb4c0 --- /dev/null +++ b/libqpdf/qpdf/SF_RunLengthDecode.hh @@ -0,0 +1,35 @@ +#include <qpdf/QPDFStreamFilter.hh> +#include <qpdf/Pl_RunLength.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 |