diff options
Diffstat (limited to 'java/com/tigervnc/rfb/PixelBuffer.java')
-rw-r--r-- | java/com/tigervnc/rfb/PixelBuffer.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/java/com/tigervnc/rfb/PixelBuffer.java b/java/com/tigervnc/rfb/PixelBuffer.java index 29d607ec..a46667d3 100644 --- a/java/com/tigervnc/rfb/PixelBuffer.java +++ b/java/com/tigervnc/rfb/PixelBuffer.java @@ -1,15 +1,15 @@ /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. - * + * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. - * + * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License * along with this software; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, @@ -36,11 +36,11 @@ 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: + case 3: // Fall-through to depth 8 - case 6: + case 6: // Fall-through to depth 8 - case 8: + case 8: if (!pf.trueColour) { if (cm == null) cm = new IndexColorModel(8, 256, new byte[256], new byte[256], new byte[256]); @@ -51,14 +51,14 @@ public class PixelBuffer { int bmask = pf.blueMax << pf.blueShift; cm = new DirectColorModel(8, rmask, gmask, bmask); break; - case 16: + case 16: cm = new DirectColorModel(32, 0xF800, 0x07C0, 0x003E); break; - case 24: + case 24: cm = new DirectColorModel(32, (0xff << 16), (0xff << 8), 0xff); break; - case 32: - cm = new DirectColorModel(32, (0xff << pf.redShift), + case 32: + cm = new DirectColorModel(32, (0xff << pf.redShift), (0xff << pf.greenShift), (0xff << pf.blueShift)); break; default: @@ -103,10 +103,10 @@ public class PixelBuffer { public void maskRect(int x, int y, int w, int h, int[] pix, byte[] mask) { int maskBytesPerRow = (w + 7) / 8; - + for (int j = 0; j < h; j++) { int cy = y + j; - + if (cy < 0 || cy >= height_) continue; @@ -121,7 +121,7 @@ public class PixelBuffer { if ((mask[byte_] & (1 << bit)) != 0) data[cy * width_ + cx] = pix[j * w + i]; - } + } } } |