1//========================================================================
2//
3// JPEG2000Stream.h
4//
5// A JPX stream decoder using OpenJPEG
6//
7// Copyright 2008, 2010, 2019, 2021 Albert Astals Cid <aacid@kde.org>
8// Copyright 2011 Daniel Glöckner <daniel-gl@gmx.net>
9// Copyright 2013, 2014 Adrian Johnson <ajohnson@redneon.com>
10// Copyright 2015 Adam Reichold <adam.reichold@t-online.de>
11//
12// Licensed under GPLv2 or later
13//
14//========================================================================
15
16#ifndef JPEG2000STREAM_H
17#define JPEG2000STREAM_H
18
19#include "config.h"
20#include "Object.h"
21#include "Stream.h"
22
23struct JPXStreamPrivate;
24
25class JPXStream : public FilterStream
26{
27public:
28 explicit JPXStream(Stream *strA);
29 ~JPXStream() override;
30
31 JPXStream(const JPXStream &other) = delete;
32 JPXStream &operator=(const JPXStream &other) = delete;
33
34 StreamKind getKind() const override { return strJPX; }
35 void reset() override;
36 void close() override;
37 Goffset getPos() override;
38 int getChar() override;
39 int lookChar() override;
40 GooString *getPSFilter(int psLevel, const char *indent) override;
41 bool isBinary(bool last = true) const override;
42 void getImageParams(int *bitsPerComponent, StreamColorSpaceMode *csMode) override;
43
44 int readStream(int nChars, unsigned char *buffer) { return str->doGetChars(nChars, buffer); }
45
46private:
47 JPXStreamPrivate *priv;
48
49 void init();
50 bool hasGetChars() override { return true; }
51 int getChars(int nChars, unsigned char *buffer) override;
52};
53
54#endif
55

source code of poppler/poppler/JPEG2000Stream.h