Use PixelBuffer objects as the interface for encoders and decoders
This avoid a lot of unnecessary middle men. This also pushes the
responsibility for pixel format conversion into the encoders and
decoders. The new bufferFromBuffer() is used for direct conversion,
rather than PixelTransformer/TransImageGetter.
diff --git a/common/rfb/Encoder.h b/common/rfb/Encoder.h
index 2897f9f..aeeb5c3 100644
--- a/common/rfb/Encoder.h
+++ b/common/rfb/Encoder.h
@@ -21,11 +21,10 @@
#define __RFB_ENCODER_H__
#include <rfb/Rect.h>
-#include <rfb/TransImageGetter.h>
namespace rfb {
class SConnection;
- class TransImageGetter;
+ class PixelBuffer;
class Encoder {
public:
@@ -38,9 +37,11 @@
virtual int getNumRects(const Rect &r) { return 1; }
// writeRect() is the main interface that encodes the given rectangle
- // with data from the ImageGetter onto the SMsgWriter given at
- // encoder creation.
- virtual void writeRect(const Rect& r, TransImageGetter* ig)=0;
+ // with data from the PixelBuffer onto the SConnection given at
+ // encoder creation. The PixelFormat of the PixelBuffer might not
+ // match the ConnParams and it is up ot the encoder to do
+ // any necessary conversion.
+ virtual void writeRect(const Rect& r, PixelBuffer* pb)=0;
static bool supported(int encoding);
static Encoder* createEncoder(int encoding, SConnection* conn);