1 //========================================================================
5 // A JPX stream decoder using OpenJPEG
7 // Copyright 2008, 2010 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>
12 // Licensed under GPLv2 or later
14 //========================================================================
17 #ifndef JPEG2000STREAM_H
18 #define JPEG2000STREAM_H
21 #include "goo/gtypes.h"
25 struct JPXStreamPrivate
;
27 class JPXStream
: public FilterStream
{
30 JPXStream(Stream
*strA
);
32 virtual StreamKind
getKind() { return strJPX
; }
35 virtual Goffset
getPos();
36 virtual int getChar();
37 virtual int lookChar();
38 virtual GooString
*getPSFilter(int psLevel
, const char *indent
);
39 virtual GBool
isBinary(GBool last
= gTrue
);
40 virtual void getImageParams(int *bitsPerComponent
, StreamColorSpaceMode
*csMode
);
42 int readStream(int nChars
, Guchar
*buffer
) {
43 return str
->doGetChars(nChars
, buffer
);
46 JPXStream(const JPXStream
&other
);
47 JPXStream
& operator=(const JPXStream
&other
);
48 JPXStreamPrivate
*priv
;
51 virtual GBool
hasGetChars() { return true; }
52 virtual int getChars(int nChars
, Guchar
*buffer
);