diff options
Diffstat (limited to 'rfb/TightDecoder.cxx')
-rw-r--r-- | rfb/TightDecoder.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/rfb/TightDecoder.cxx b/rfb/TightDecoder.cxx index d634acb1..e51558fe 100644 --- a/rfb/TightDecoder.cxx +++ b/rfb/TightDecoder.cxx @@ -26,7 +26,12 @@ extern "C" { using namespace rfb; -#define RGB24_TO_PIXEL(bpp,r,g,b) \ +#define RGB_TO_PIXEL(r,g,b) \ + (((PIXEL_T)(r) & myFormat.redMax) << myFormat.redShift | \ + ((PIXEL_T)(g) & myFormat.greenMax) << myFormat.greenShift | \ + ((PIXEL_T)(b) & myFormat.blueMax) << myFormat.blueShift) + +#define RGB24_TO_PIXEL(r,g,b) \ ((((PIXEL_T)(r) & 0xFF) * myFormat.redMax + 127) / 255 \ << myFormat.redShift | \ (((PIXEL_T)(g) & 0xFF) * myFormat.greenMax + 127) / 255 \ |