summaryrefslogtreecommitdiffstats
path: root/common/rfb/ZRLEDecoder.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2014-03-17 14:35:51 +0100
committerPierre Ossman <ossman@cendio.se>2014-07-07 14:42:08 +0200
commit7b5c069d2e7eaa1748507a03697c14900258e507 (patch)
tree245936793e9607ce98dd89e98c1fdd0ac6b2d3ce /common/rfb/ZRLEDecoder.cxx
parent65ad3224e920deecb91a3c28e15341c8584a372c (diff)
downloadtigervnc-7b5c069d2e7eaa1748507a03697c14900258e507.tar.gz
tigervnc-7b5c069d2e7eaa1748507a03697c14900258e507.zip
Push encoding specific formats into the encoders and decoders
Keep the generic stream classes clean and general.
Diffstat (limited to 'common/rfb/ZRLEDecoder.cxx')
-rw-r--r--common/rfb/ZRLEDecoder.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/common/rfb/ZRLEDecoder.cxx b/common/rfb/ZRLEDecoder.cxx
index 20fe853c..ffc24e3c 100644
--- a/common/rfb/ZRLEDecoder.cxx
+++ b/common/rfb/ZRLEDecoder.cxx
@@ -21,6 +21,26 @@
using namespace rfb;
+static inline rdr::U32 readOpaque24A(rdr::InStream* is)
+{
+ is->check(3);
+ rdr::U32 r=0;
+ ((rdr::U8*)&r)[0] = is->readU8();
+ ((rdr::U8*)&r)[1] = is->readU8();
+ ((rdr::U8*)&r)[2] = is->readU8();
+ return r;
+
+}
+static inline rdr::U32 readOpaque24B(rdr::InStream* is)
+{
+ is->check(3);
+ rdr::U32 r=0;
+ ((rdr::U8*)&r)[1] = is->readU8();
+ ((rdr::U8*)&r)[2] = is->readU8();
+ ((rdr::U8*)&r)[3] = is->readU8();
+ return r;
+}
+
#define EXTRA_ARGS CMsgHandler* handler
#define FILL_RECT(r, p) handler->fillRect(r, p)
#define IMAGE_RECT(r, p) handler->imageRect(r, p)