summaryrefslogtreecommitdiffstats
path: root/libqpdf/qpdf/QPDF_Stream.hh
blob: 86a585c9120907e8b64e109a5fb9a4b6bd134299 (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
39
40
41
42
#ifndef __QPDF_STREAM_HH__
#define __QPDF_STREAM_HH__

#include <qpdf/QPDFObject.hh>

#include <qpdf/QPDFObjectHandle.hh>

class Pipeline;
class QPDF;

class QPDF_Stream: public QPDFObject
{
  public:
    QPDF_Stream(QPDF*, int objid, int generation,
		QPDFObjectHandle stream_dict,
		off_t offset, int length);
    virtual ~QPDF_Stream();
    virtual std::string unparse();
    QPDFObjectHandle getDict() const;

    // See comments in QPDFObjectHandle.hh for these methods.
    bool pipeStreamData(Pipeline*, bool filter,
			bool normalize, bool compress);
    PointerHolder<Buffer> getStreamData();
    void replaceStreamData(PointerHolder<Buffer> data,
			   QPDFObjectHandle filter,
			   QPDFObjectHandle decode_parms);

  private:
    bool filterable(std::vector<std::string>& filters,
		    int& predictor, int& columns, bool& early_code_change);

    QPDF* qpdf;
    int objid;
    int generation;
    QPDFObjectHandle stream_dict;
    off_t offset;
    int length;
    PointerHolder<Buffer> stream_data;
};

#endif // __QPDF_STREAM_HH__