using namespace rfb;
+Decoder::Decoder(CMsgReader* reader_) : reader(reader_)
+{
+}
+
Decoder::~Decoder()
{
}
class Decoder {
public:
+ Decoder(CMsgReader* reader);
virtual ~Decoder();
virtual void readRect(const Rect& r, CMsgHandler* handler)=0;
static bool supported(int encoding);
static Decoder* createDecoder(int encoding, CMsgReader* reader);
+ protected:
+ CMsgReader* reader;
};
}
#include <rfb/HextileEncoder.h>
#include <rfb/ZRLEEncoder.h>
#include <rfb/TightEncoder.h>
+#include <rfb/SMsgWriter.h>
using namespace rfb;
+Encoder::Encoder(SMsgWriter* writer_) : writer(writer_)
+{
+}
+
Encoder::~Encoder()
{
}
class Encoder {
public:
+ Encoder(SMsgWriter* writer);
virtual ~Encoder();
virtual void setCompressLevel(int level) {};
static bool supported(int encoding);
static Encoder* createEncoder(int encoding, SMsgWriter* writer);
+
+ protected:
+ SMsgWriter* writer;
};
}
#include <rfb/hextileDecode.h>
#undef BPP
-HextileDecoder::HextileDecoder(CMsgReader* reader_) : reader(reader_)
+HextileDecoder::HextileDecoder(CMsgReader* reader) : Decoder(reader)
{
}
HextileDecoder(CMsgReader* reader);
virtual ~HextileDecoder();
virtual void readRect(const Rect& r, CMsgHandler* handler);
- private:
- CMsgReader* reader;
};
}
#endif
#include <rfb/hextileEncodeBetter.h>
#undef BPP
-HextileEncoder::HextileEncoder(SMsgWriter* writer_) : writer(writer_)
+HextileEncoder::HextileEncoder(SMsgWriter* writer_) : Encoder(writer_)
{
}
HextileEncoder(SMsgWriter* writer);
virtual ~HextileEncoder();
virtual void writeRect(const Rect& r, TransImageGetter* ig);
- private:
- SMsgWriter* writer;
};
}
#endif
#include <rfb/rreDecode.h>
#undef BPP
-RREDecoder::RREDecoder(CMsgReader* reader_) : reader(reader_)
+RREDecoder::RREDecoder(CMsgReader* reader) : Decoder(reader)
{
}
RREDecoder(CMsgReader* reader);
virtual ~RREDecoder();
virtual void readRect(const Rect& r, CMsgHandler* handler);
- private:
- CMsgReader* reader;
};
}
#endif
#include <rfb/rreEncode.h>
#undef BPP
-RREEncoder::RREEncoder(SMsgWriter* writer_) : writer(writer_)
+RREEncoder::RREEncoder(SMsgWriter* writer) : Encoder(writer)
{
}
virtual ~RREEncoder();
virtual void writeRect(const Rect& r, TransImageGetter* ig);
private:
- SMsgWriter* writer;
rdr::MemOutStream mos;
};
}
using namespace rfb;
-RawDecoder::RawDecoder(CMsgReader* reader_) : reader(reader_)
+RawDecoder::RawDecoder(CMsgReader* reader) : Decoder(reader)
{
}
RawDecoder(CMsgReader* reader);
virtual ~RawDecoder();
virtual void readRect(const Rect& r, CMsgHandler* handler);
- private:
- CMsgReader* reader;
};
}
#endif
using namespace rfb;
-RawEncoder::RawEncoder(SMsgWriter* writer_) : writer(writer_)
+RawEncoder::RawEncoder(SMsgWriter* writer) : Encoder(writer)
{
}
RawEncoder(SMsgWriter* writer);
virtual ~RawEncoder();
virtual void writeRect(const Rect& r, TransImageGetter* ig);
- private:
- SMsgWriter* writer;
};
}
#endif
#include <rfb/tightDecode.h>
#undef BPP
-TightDecoder::TightDecoder(CMsgReader* reader_) : reader(reader_)
+TightDecoder::TightDecoder(CMsgReader* reader) : Decoder(reader)
{
}
void directFillRect16(const Rect& r, Pixel pix);
void directFillRect32(const Rect& r, Pixel pix);
- CMsgReader* reader;
CMsgHandler* handler;
rdr::InStream* is;
rdr::ZlibInStream zis[4];
#include <rfb/tightEncode.h>
#undef BPP
-TightEncoder::TightEncoder(SMsgWriter* writer_) : writer(writer_)
+TightEncoder::TightEncoder(SMsgWriter* writer) : Encoder(writer)
{
setCompressLevel(defaultCompressLevel);
setQualityLevel(-1);
void encodeJpegRect32(rdr::U32 *buf, int stride, const Rect& r,
rdr::OutStream *os);
- SMsgWriter* writer;
rdr::MemOutStream mos;
rdr::ZlibOutStream zos[4];
JpegCompressor jc;
#undef CPIXEL
#undef BPP
-ZRLEDecoder::ZRLEDecoder(CMsgReader* reader_) : reader(reader_)
+ZRLEDecoder::ZRLEDecoder(CMsgReader* reader) : Decoder(reader)
{
}
virtual ~ZRLEDecoder();
virtual void readRect(const Rect& r, CMsgHandler* handler);
private:
- CMsgReader* reader;
rdr::ZlibInStream zis;
};
}
#undef CPIXEL
#undef BPP
-ZRLEEncoder::ZRLEEncoder(SMsgWriter* writer_)
- : writer(writer_), zos(0,0,zlibLevel), mos(129*1024)
+ZRLEEncoder::ZRLEEncoder(SMsgWriter* writer)
+ : Encoder(writer), zos(0,0,zlibLevel), mos(129*1024)
{
}
virtual ~ZRLEEncoder();
virtual void writeRect(const Rect& r, TransImageGetter* ig);
private:
- SMsgWriter* writer;
rdr::ZlibOutStream zos;
rdr::MemOutStream mos;
};