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/hextileEncode.h b/common/rfb/hextileEncode.h
index 7e5b2db..2efd74e 100644
--- a/common/rfb/hextileEncode.h
+++ b/common/rfb/hextileEncode.h
@@ -44,7 +44,8 @@
int HEXTILE_ENCODE_TILE (PIXEL_T* data, int w, int h, int tileType,
rdr::U8* encoded, PIXEL_T bg);
-void HEXTILE_ENCODE(const Rect& r, rdr::OutStream* os, TransImageGetter *ig)
+void HEXTILE_ENCODE(const Rect& r, rdr::OutStream* os,
+ const PixelFormat& pf, PixelBuffer* pb)
{
Rect t;
PIXEL_T buf[256];
@@ -61,7 +62,7 @@
t.br.x = __rfbmin(r.br.x, t.tl.x + 16);
- ig->getImage(buf, t);
+ pb->getImage(pf, buf, t);
PIXEL_T bg = 0, fg = 0;
int tileType = TEST_TILE_TYPE(buf, t.width(), t.height(), &bg, &fg);
@@ -90,7 +91,7 @@
encoded, bg);
if (encodedLen < 0) {
- ig->getImage(buf, t);
+ pb->getImage(pf, buf, t);
os->writeU8(hextileRaw);
os->writeBytes(buf, t.width() * t.height() * (BPP/8));
oldBgValid = oldFgValid = false;