]> source.dussan.org Git - tigervnc.git/commitdiff
[Developement] Added constructor, base set methods (setRfbInputStream, setGraphics...
authorenikey <enikey@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Fri, 19 Dec 2008 04:45:15 +0000 (04:45 +0000)
committerenikey <enikey@3789f03b-4d11-0410-bbf8-ca57d06f2519>
Fri, 19 Dec 2008 04:45:15 +0000 (04:45 +0000)
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@3411 3789f03b-4d11-0410-bbf8-ca57d06f2519

java/src/com/tightvnc/decoder/RawDecoder.java

index ed2f216cfa6c4d754f5a3f6e43a26a76fe471e3c..46d22f7f89cdeddda03bb66e7d2bddc86c03e4d7 100644 (file)
@@ -1,5 +1,64 @@
 package com.tightvnc.decoder;
 
+import com.tightvnc.vncviewer.RecordInterface;
+import com.tightvnc.vncviewer.RfbInputStream;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.image.ColorModel;
+import java.awt.image.DirectColorModel;
+import java.awt.image.MemoryImageSource;
+import java.awt.Color;
+
 public class RawDecoder {
 
+  public RawDecoder(Graphics g, RfbInputStream is) {
+    setGraphics(g);
+    setRfbInputStream(is);
+    cm24 = new DirectColorModel(24, 0xFF0000, 0x00FF00, 0x0000FF);
+  }
+
+  public RawDecoder(Graphics g, RfbInputStream is, int frameBufferW,
+                    int frameBufferH) {
+    setGraphics(g);
+    setRfbInputStream(is);
+    setFrameBufferSize(frameBufferW, frameBufferH);
+    cm24 = new DirectColorModel(24, 0xFF0000, 0x00FF00, 0x0000FF);
+  }
+
+  public void setRfbInputStream(RfbInputStream is) {
+    rfbis = is;
+  }
+
+  public void setGraphics(Graphics g) {
+    graphics = g;
+  }
+
+  public void setBPP(int bpp) {
+    bytesPerPixel = bpp;
+  }
+
+  public int getBPP() {
+    return bytesPerPixel;
+  }
+
+  public void setFrameBufferSize(int w, int h) {
+    framebufferWidth = w;
+    framebufferHeight = h;
+  }
+
+  protected int bytesPerPixel = 4;
+  protected int framebufferWidth = 0;
+  protected int framebufferHeight = 0;
+  protected RfbInputStream rfbis = null;
+  protected Graphics graphics = null;
+  protected RecordInterface rec = null;
+
+  protected static byte []pixels8 = null;
+  protected static int []pixels24 = null;
+  protected static MemoryImageSource pixelsSource = null;
+  protected static Image rawPixelsImage = null;
+
+  private static ColorModel cm8 = null;
+  private static ColorModel cm24 = null;
+  private static Color []color256 = null;
 }