"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "xpdf/Stream.h" between
xpdf-4.01.01.tar.gz and xpdf-4.02.tar.gz

About: Xpdf is a PDF viewer for X.

Stream.h  (xpdf-4.01.01):Stream.h  (xpdf-4.02)
skipping to change at line 120 skipping to change at line 120
// Get current position in file. // Get current position in file.
virtual GFileOffset getPos() = 0; virtual GFileOffset getPos() = 0;
// Go to a position in the stream. If <dir> is negative, the // Go to a position in the stream. If <dir> is negative, the
// position is from the end of the file; otherwise the position is // position is from the end of the file; otherwise the position is
// from the start of the file. // from the start of the file.
virtual void setPos(GFileOffset pos, int dir = 0) = 0; virtual void setPos(GFileOffset pos, int dir = 0) = 0;
// Get PostScript command for the filter(s). // Get PostScript command for the filter(s).
virtual GString *getPSFilter(int psLevel, const char *indent); virtual GString *getPSFilter(int psLevel, const char *indent,
GBool okToReadStream);
// Does this stream type potentially contain non-printable chars? // Does this stream type potentially contain non-printable chars?
virtual GBool isBinary(GBool last = gTrue) = 0; virtual GBool isBinary(GBool last = gTrue) = 0;
// Get the BaseStream of this stream. // Get the BaseStream of this stream.
virtual BaseStream *getBaseStream() = 0; virtual BaseStream *getBaseStream() = 0;
// Get the stream after the last decoder (this may be a BaseStream // Get the stream after the last decoder (this may be a BaseStream
// or a DecryptStream). // or a DecryptStream).
virtual Stream *getUndecodedStream() = 0; virtual Stream *getUndecodedStream() = 0;
skipping to change at line 424 skipping to change at line 425
public: public:
ASCIIHexStream(Stream *strA); ASCIIHexStream(Stream *strA);
virtual ~ASCIIHexStream(); virtual ~ASCIIHexStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strASCIIHex; } virtual StreamKind getKind() { return strASCIIHex; }
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ int c = lookChar(); buf = EOF; return c; } { int c = lookChar(); buf = EOF; return c; }
virtual int lookChar(); virtual int lookChar();
virtual GString *getPSFilter(int psLevel, const char *indent); virtual GString *getPSFilter(int psLevel, const char *indent,
GBool okToReadStream);
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
private: private:
int buf; int buf;
GBool eof; GBool eof;
}; };
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// ASCII85Stream // ASCII85Stream
skipping to change at line 448 skipping to change at line 450
public: public:
ASCII85Stream(Stream *strA); ASCII85Stream(Stream *strA);
virtual ~ASCII85Stream(); virtual ~ASCII85Stream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strASCII85; } virtual StreamKind getKind() { return strASCII85; }
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ int ch = lookChar(); ++index; return ch; } { int ch = lookChar(); ++index; return ch; }
virtual int lookChar(); virtual int lookChar();
virtual GString *getPSFilter(int psLevel, const char *indent); virtual GString *getPSFilter(int psLevel, const char *indent,
GBool okToReadStream);
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
private: private:
int c[5]; int c[5];
int b[4]; int b[4];
int index, n; int index, n;
GBool eof; GBool eof;
}; };
skipping to change at line 476 skipping to change at line 479
LZWStream(Stream *strA, int predictor, int columns, int colors, LZWStream(Stream *strA, int predictor, int columns, int colors,
int bits, int earlyA); int bits, int earlyA);
virtual ~LZWStream(); virtual ~LZWStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strLZW; } virtual StreamKind getKind() { return strLZW; }
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
virtual int getRawChar(); virtual int getRawChar();
virtual int getBlock(char *blk, int size); virtual int getBlock(char *blk, int size);
virtual GString *getPSFilter(int psLevel, const char *indent); virtual GString *getPSFilter(int psLevel, const char *indent,
GBool okToReadStream);
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
private: private:
StreamPredictor *pred; // predictor StreamPredictor *pred; // predictor
int early; // early parameter int early; // early parameter
GBool eof; // true if at eof GBool eof; // true if at eof
int inputBuf; // input buffer int inputBuf; // input buffer
int inputBits; // number of bits in input buffer int inputBits; // number of bits in input buffer
struct { // decoding table struct { // decoding table
skipping to change at line 522 skipping to change at line 526
RunLengthStream(Stream *strA); RunLengthStream(Stream *strA);
virtual ~RunLengthStream(); virtual ~RunLengthStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strRunLength; } virtual StreamKind getKind() { return strRunLength; }
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); } { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
virtual int lookChar() virtual int lookChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); } { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
virtual int getBlock(char *blk, int size); virtual int getBlock(char *blk, int size);
virtual GString *getPSFilter(int psLevel, const char *indent); virtual GString *getPSFilter(int psLevel, const char *indent,
GBool okToReadStream);
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
private: private:
char buf[128]; // buffer char buf[128]; // buffer
char *bufPtr; // next char to read char *bufPtr; // next char to read
char *bufEnd; // end of buffer char *bufEnd; // end of buffer
GBool eof; GBool eof;
GBool fillBuf(); GBool fillBuf();
skipping to change at line 554 skipping to change at line 559
CCITTFaxStream(Stream *strA, int encodingA, GBool endOfLineA, CCITTFaxStream(Stream *strA, int encodingA, GBool endOfLineA,
GBool byteAlignA, int columnsA, int rowsA, GBool byteAlignA, int columnsA, int rowsA,
GBool endOfBlockA, GBool blackA); GBool endOfBlockA, GBool blackA);
virtual ~CCITTFaxStream(); virtual ~CCITTFaxStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strCCITTFax; } virtual StreamKind getKind() { return strCCITTFax; }
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
virtual int getBlock(char *blk, int size); virtual int getBlock(char *blk, int size);
virtual GString *getPSFilter(int psLevel, const char *indent); virtual GString *getPSFilter(int psLevel, const char *indent,
GBool okToReadStream);
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
private: private:
int encoding; // 'K' parameter int encoding; // 'K' parameter
GBool endOfLine; // 'EndOfLine' parameter GBool endOfLine; // 'EndOfLine' parameter
GBool byteAlign; // 'EncodedByteAlign' parameter GBool byteAlign; // 'EncodedByteAlign' parameter
int columns; // 'Columns' parameter int columns; // 'Columns' parameter
int rows; // 'Rows' parameter int rows; // 'Rows' parameter
GBool endOfBlock; // 'EndOfBlock' parameter GBool endOfBlock; // 'EndOfBlock' parameter
skipping to change at line 652 skipping to change at line 658
DCTStream(Stream *strA, int colorXformA); DCTStream(Stream *strA, int colorXformA);
virtual ~DCTStream(); virtual ~DCTStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strDCT; } virtual StreamKind getKind() { return strDCT; }
virtual void reset(); virtual void reset();
virtual void close(); virtual void close();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
virtual int getBlock(char *blk, int size); virtual int getBlock(char *blk, int size);
virtual GString *getPSFilter(int psLevel, const char *indent); virtual GString *getPSFilter(int psLevel, const char *indent,
GBool okToReadStream);
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
Stream *getRawStream() { return str; } Stream *getRawStream() { return str; }
private: private:
GBool checkSequentialInterleaved();
#if HAVE_JPEGLIB #if HAVE_JPEGLIB
int colorXform; // color transform: -1 = unspecified int colorXform; // color transform: -1 = unspecified
// 0 = none // 0 = none
// 1 = YUV/YUVK -> RGB/CMYK // 1 = YUV/YUVK -> RGB/CMYK
jpeg_decompress_struct decomp; jpeg_decompress_struct decomp;
DCTErrorMgr errorMgr; DCTErrorMgr errorMgr;
DCTSourceMgr sourceMgr; DCTSourceMgr sourceMgr;
GBool error; GBool error;
char *lineBuf; char *lineBuf;
skipping to change at line 787 skipping to change at line 796
FlateStream(Stream *strA, int predictor, int columns, FlateStream(Stream *strA, int predictor, int columns,
int colors, int bits); int colors, int bits);
virtual ~FlateStream(); virtual ~FlateStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strFlate; } virtual StreamKind getKind() { return strFlate; }
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
virtual int getRawChar(); virtual int getRawChar();
virtual int getBlock(char *blk, int size); virtual int getBlock(char *blk, int size);
virtual GString *getPSFilter(int psLevel, const char *indent); virtual GString *getPSFilter(int psLevel, const char *indent,
GBool okToReadStream);
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
private: private:
StreamPredictor *pred; // predictor StreamPredictor *pred; // predictor
Guchar buf[flateWindow]; // output data buffer Guchar buf[flateWindow]; // output data buffer
int index; // current index into output buffer int index; // current index into output buffer
int remain; // number valid bytes in output buffer int remain; // number valid bytes in output buffer
int codeBuf; // input buffer int codeBuf; // input buffer
int codeSize; // number of bits in input buffer int codeSize; // number of bits in input buffer
skipping to change at line 842 skipping to change at line 852
public: public:
EOFStream(Stream *strA); EOFStream(Stream *strA);
virtual ~EOFStream(); virtual ~EOFStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() { return strWeird; }
virtual void reset() {} virtual void reset() {}
virtual int getChar() { return EOF; } virtual int getChar() { return EOF; }
virtual int lookChar() { return EOF; } virtual int lookChar() { return EOF; }
virtual int getBlock(char *blk, int size) { return 0; } virtual int getBlock(char *blk, int size) { return 0; }
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent,
GBool okToReadStream)
{ return NULL; } { return NULL; }
virtual GBool isBinary(GBool last = gTrue) { return gFalse; } virtual GBool isBinary(GBool last = gTrue) { return gFalse; }
}; };
//------------------------------------------------------------------------ //------------------------------------------------------------------------
// BufStream // BufStream
//------------------------------------------------------------------------ //------------------------------------------------------------------------
class BufStream: public FilterStream { class BufStream: public FilterStream {
public: public:
BufStream(Stream *strA, int bufSizeA); BufStream(Stream *strA, int bufSizeA);
virtual ~BufStream(); virtual ~BufStream();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() { return strWeird; }
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent,
GBool okToReadStream)
{ return NULL; } { return NULL; }
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
int lookChar(int idx); int lookChar(int idx);
private: private:
int *buf; int *buf;
int bufSize; int bufSize;
}; };
skipping to change at line 887 skipping to change at line 899
class FixedLengthEncoder: public FilterStream { class FixedLengthEncoder: public FilterStream {
public: public:
FixedLengthEncoder(Stream *strA, int lengthA); FixedLengthEncoder(Stream *strA, int lengthA);
~FixedLengthEncoder(); ~FixedLengthEncoder();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() { return strWeird; }
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent,
GBool okToReadStream)
{ return NULL; } { return NULL; }
virtual GBool isBinary(GBool last = gTrue); virtual GBool isBinary(GBool last = gTrue);
virtual GBool isEncoder() { return gTrue; } virtual GBool isEncoder() { return gTrue; }
private: private:
int length; int length;
int count; int count;
}; };
skipping to change at line 914 skipping to change at line 927
ASCIIHexEncoder(Stream *strA); ASCIIHexEncoder(Stream *strA);
virtual ~ASCIIHexEncoder(); virtual ~ASCIIHexEncoder();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() { return strWeird; }
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); } { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
virtual int lookChar() virtual int lookChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); } { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent,
GBool okToReadStream)
{ return NULL; } { return NULL; }
virtual GBool isBinary(GBool last = gTrue) { return gFalse; } virtual GBool isBinary(GBool last = gTrue) { return gFalse; }
virtual GBool isEncoder() { return gTrue; } virtual GBool isEncoder() { return gTrue; }
private: private:
char buf[4]; char buf[4];
char *bufPtr; char *bufPtr;
char *bufEnd; char *bufEnd;
int lineLen; int lineLen;
skipping to change at line 946 skipping to change at line 960
ASCII85Encoder(Stream *strA); ASCII85Encoder(Stream *strA);
virtual ~ASCII85Encoder(); virtual ~ASCII85Encoder();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() { return strWeird; }
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); } { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
virtual int lookChar() virtual int lookChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); } { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent,
GBool okToReadStream)
{ return NULL; } { return NULL; }
virtual GBool isBinary(GBool last = gTrue) { return gFalse; } virtual GBool isBinary(GBool last = gTrue) { return gFalse; }
virtual GBool isEncoder() { return gTrue; } virtual GBool isEncoder() { return gTrue; }
private: private:
char buf[8]; char buf[8];
char *bufPtr; char *bufPtr;
char *bufEnd; char *bufEnd;
int lineLen; int lineLen;
skipping to change at line 978 skipping to change at line 993
RunLengthEncoder(Stream *strA); RunLengthEncoder(Stream *strA);
virtual ~RunLengthEncoder(); virtual ~RunLengthEncoder();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() { return strWeird; }
virtual void reset(); virtual void reset();
virtual int getChar() virtual int getChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); } { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr++ & 0xff); }
virtual int lookChar() virtual int lookChar()
{ return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); } { return (bufPtr >= bufEnd && !fillBuf()) ? EOF : (*bufPtr & 0xff); }
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent,
GBool okToReadStream)
{ return NULL; } { return NULL; }
virtual GBool isBinary(GBool last = gTrue) { return gTrue; } virtual GBool isBinary(GBool last = gTrue) { return gTrue; }
virtual GBool isEncoder() { return gTrue; } virtual GBool isEncoder() { return gTrue; }
private: private:
char buf[131]; char buf[131];
char *bufPtr; char *bufPtr;
char *bufEnd; char *bufEnd;
char *nextEnd; char *nextEnd;
skipping to change at line 1014 skipping to change at line 1030
class LZWEncoder: public FilterStream { class LZWEncoder: public FilterStream {
public: public:
LZWEncoder(Stream *strA); LZWEncoder(Stream *strA);
virtual ~LZWEncoder(); virtual ~LZWEncoder();
virtual Stream *copy(); virtual Stream *copy();
virtual StreamKind getKind() { return strWeird; } virtual StreamKind getKind() { return strWeird; }
virtual void reset(); virtual void reset();
virtual int getChar(); virtual int getChar();
virtual int lookChar(); virtual int lookChar();
virtual GString *getPSFilter(int psLevel, const char *indent) virtual GString *getPSFilter(int psLevel, const char *indent,
GBool okToReadStream)
{ return NULL; } { return NULL; }
virtual GBool isBinary(GBool last = gTrue) { return gTrue; } virtual GBool isBinary(GBool last = gTrue) { return gTrue; }
virtual GBool isEncoder() { return gTrue; } virtual GBool isEncoder() { return gTrue; }
private: private:
LZWEncoderNode table[4096]; LZWEncoderNode table[4096];
int nextSeq; int nextSeq;
int codeLen; int codeLen;
Guchar inBuf[8192]; Guchar inBuf[8192];
 End of changes. 16 change blocks. 
15 lines changed or deleted 32 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)