diff options
author | Pierre Ossman <ossman@cendio.se> | 2014-03-14 15:59:46 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2014-07-14 16:03:42 +0200 |
commit | c0397269fcab67e9acd4fdcbc29f24d79ed0ef39 (patch) | |
tree | 41ac251e5a595a37b832a61626723a89258bb018 /common/rfb/hextileEncodeBetter.h | |
parent | a088f1ab3923482998174b9db8949cf06d0761af (diff) | |
download | tigervnc-c0397269fcab67e9acd4fdcbc29f24d79ed0ef39.tar.gz tigervnc-c0397269fcab67e9acd4fdcbc29f24d79ed0ef39.zip |
Move image encoding logic into a central EncodeManager class
This allows us to apply a lot more server logic
independently of which encoder is in use.
Most of this class are things moved over from the
Tight encoder.
Diffstat (limited to 'common/rfb/hextileEncodeBetter.h')
-rw-r--r-- | common/rfb/hextileEncodeBetter.h | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/common/rfb/hextileEncodeBetter.h b/common/rfb/hextileEncodeBetter.h index efb2d9ca..bc9dcaca 100644 --- a/common/rfb/hextileEncodeBetter.h +++ b/common/rfb/hextileEncodeBetter.h @@ -275,8 +275,7 @@ void HEXTILE_TILE::encode(rdr::U8 *dst) const // Main encoding function. // -void HEXTILE_ENCODE(const Rect& r, rdr::OutStream* os, - const PixelFormat& pf, PixelBuffer* pb) +void HEXTILE_ENCODE(rdr::OutStream* os, const PixelBuffer* pb) { Rect t; PIXEL_T buf[256]; @@ -287,15 +286,15 @@ void HEXTILE_ENCODE(const Rect& r, rdr::OutStream* os, HEXTILE_TILE tile; - for (t.tl.y = r.tl.y; t.tl.y < r.br.y; t.tl.y += 16) { + for (t.tl.y = 0; t.tl.y < pb->height(); t.tl.y += 16) { - t.br.y = __rfbmin(r.br.y, t.tl.y + 16); + t.br.y = __rfbmin(pb->height(), t.tl.y + 16); - for (t.tl.x = r.tl.x; t.tl.x < r.br.x; t.tl.x += 16) { + for (t.tl.x = 0; t.tl.x < pb->width(); t.tl.x += 16) { - t.br.x = __rfbmin(r.br.x, t.tl.x + 16); + t.br.x = __rfbmin(pb->width(), t.tl.x + 16); - pb->getImage(pf, buf, t); + pb->getImage(buf, t); tile.newTile(buf, t.width(), t.height()); int tileType = tile.getFlags(); |