diff options
author | Brian Hinz <bphinz@users.sourceforge.net> | 2012-02-12 20:44:29 +0000 |
---|---|---|
committer | Brian Hinz <bphinz@users.sourceforge.net> | 2012-02-12 20:44:29 +0000 |
commit | af15db239a665030087fe146b20d4b3213708f3d (patch) | |
tree | 2efad69694d73cdb8fc90af86af26ef44e10b084 /java/com/tigervnc/rfb/PixelBuffer.java | |
parent | 8d37f2054b6da02957b12d02aaf96dd5eecc89c7 (diff) | |
download | tigervnc-af15db239a665030087fe146b20d4b3213708f3d.tar.gz tigervnc-af15db239a665030087fe146b20d4b3213708f3d.zip |
Adds support for fence & continuous updates extensions to java viewer. Adds low level hooks for TurboVNC fine grained quality controls.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4847 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'java/com/tigervnc/rfb/PixelBuffer.java')
-rw-r--r-- | java/com/tigervnc/rfb/PixelBuffer.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/java/com/tigervnc/rfb/PixelBuffer.java b/java/com/tigervnc/rfb/PixelBuffer.java index 2712ba94..43713550 100644 --- a/java/com/tigervnc/rfb/PixelBuffer.java +++ b/java/com/tigervnc/rfb/PixelBuffer.java @@ -36,9 +36,17 @@ public class PixelBuffer { throw new Exception("Internal error: bpp must be 8, 16, or 32 in PixelBuffer ("+pf.bpp+")"); format = pf; switch (pf.depth) { + case 3: + // Fall-through to depth 8 + case 6: + // Fall-through to depth 8 case 8: - //cm = new IndexColorModel(8, 256, new byte[256], new byte[256], new byte[256]); - cm = new DirectColorModel(8, 7, (7 << 3), (3 << 6)); + int rmask = pf.redMax << pf.redShift; + int gmask = pf.greenMax << pf.greenShift; + int bmask = pf.blueMax << pf.blueShift; + cm = new DirectColorModel(8, rmask, gmask, bmask); + if (pf.depth == 8 && !pf.trueColour) + cm = new IndexColorModel(8, 256, new byte[256], new byte[256], new byte[256]); break; case 16: cm = new DirectColorModel(32, 0xF800, 0x07C0, 0x003E, (0xff << 24)); |