diff options
author | Jay Berkenbilt <ejb@ql.org> | 2020-12-23 12:12:49 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2020-12-28 18:58:19 +0100 |
commit | 39bfa0130713defc9abb478a70717ca07377cdab (patch) | |
tree | 18b6370d5f2f7d10a3f1ef09a8f0dd3b9281bd3c /include/qpdf/QPDF.hh | |
parent | 1fb26f08ad91d08f67ac30e2557ddcadd8b9ccac (diff) | |
download | qpdf-39bfa0130713defc9abb478a70717ca07377cdab.tar.zst |
Implement user-provided stream filters
Refactor QPDF_Stream to use stream filter classes to handle supported
stream filters as well.
Diffstat (limited to 'include/qpdf/QPDF.hh')
-rw-r--r-- | include/qpdf/QPDF.hh | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh index 285ba1e3..b0e9b717 100644 --- a/include/qpdf/QPDF.hh +++ b/include/qpdf/QPDF.hh @@ -31,6 +31,8 @@ #include <list> #include <iostream> #include <vector> +#include <functional> +#include <memory> #include <qpdf/QIntC.hh> #include <qpdf/QPDFExc.hh> @@ -39,6 +41,7 @@ #include <qpdf/QPDFXRefEntry.hh> #include <qpdf/QPDFObjectHandle.hh> #include <qpdf/QPDFTokenizer.hh> +#include <qpdf/QPDFStreamFilter.hh> #include <qpdf/Buffer.hh> #include <qpdf/InputSource.hh> @@ -132,6 +135,20 @@ class QPDF QPDF_DLL void emptyPDF(); + // From 10.1: register a new filter implementation for a specific + // stream filter. You can add your own implementations for new + // filter types or override existing ones provided by the library. + // Registered stream filters are used for decoding only as you can + // override encoding with stream data providers. For example, you + // could use this method to support for one of the other filter + // types by using additional third-party libraries that qpdf does + // not presently use. The standard filters are implemented using + // QPDFStreamFilter classes. + QPDF_DLL + static void registerStreamFilter( + std::string const& filter_name, + std::function<std::shared_ptr<QPDFStreamFilter> ()> factory); + // Parameter settings // By default, warning messages are issued to std::cerr and output |