gnu.rfb
Class Raw

java.lang.Object
  extended by gnu.rfb.Rect
      extended by gnu.rfb.Raw
All Implemented Interfaces:
java.lang.Cloneable

public class Raw
extends Rect

Provides encoding and decoding of images using the Raw encoding.


Field Summary
 byte[] bytes
           
 PixelFormat pixelFormat
           
 int[] pixels
           
 
Fields inherited from class gnu.rfb.Rect
count, h, w, x, y
 
Constructor Summary
Raw(int[] pixels, PixelFormat pixelFormat, int offsetX, int offsetY, int scanline, int x, int y, int w, int h)
          Constructor for encoding an image into Raw.
Raw(int x, int y, int w, int h, PixelFormat pixelFormat, byte[] bytes)
          Constructor for encoding an image into Raw.
Raw(int x, int y, int w, int h, PixelFormat pixelFormat, java.io.DataInputStream input)
          Constructor for decoding Raw.
 
Method Summary
 java.lang.Object clone()
           
 int[] decode()
          Decodes from the input into an array of pixels as Integers.
 void readData()
          Reads in the data pre-emptively to decoding in.
 void writeData(java.io.DataOutput output)
           
 
Methods inherited from class gnu.rfb.Rect
bestEncoding, encode, encode, encode, toString, transform
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pixelFormat

public PixelFormat pixelFormat

bytes

public byte[] bytes

pixels

public int[] pixels
Constructor Detail

Raw

public Raw(int[] pixels,
           PixelFormat pixelFormat,
           int offsetX,
           int offsetY,
           int scanline,
           int x,
           int y,
           int w,
           int h)
Constructor for encoding an image into Raw.

Parameters:
pixels -
pixelFormat -
offsetX -
offsetY -
scanline -
x -
y -
w -
h -

Raw

public Raw(int x,
           int y,
           int w,
           int h,
           PixelFormat pixelFormat,
           byte[] bytes)
Constructor for encoding an image into Raw.

Parameters:
x -
y -
w -
h -
pixelFormat -
bytes -

Raw

public Raw(int x,
           int y,
           int w,
           int h,
           PixelFormat pixelFormat,
           java.io.DataInputStream input)
    throws java.io.IOException
Constructor for decoding Raw.

Parameters:
x -
y -
w -
h -
pixelFormat -
input -
Throws:
java.io.IOException
Method Detail

writeData

public void writeData(java.io.DataOutput output)
               throws java.io.IOException
Overrides:
writeData in class Rect
Throws:
java.io.IOException

readData

public void readData()
              throws java.io.IOException
Reads in the data pre-emptively to decoding in. This is a performance enhancement to reduce the number of task switches.

Throws:
java.io.IOException - If unable to read from the input given in the constructor.

decode

public int[] decode()
             throws java.io.IOException
Decodes from the input into an array of pixels as Integers.

Returns:
The image as an array of pixels as Integers.
Throws:
java.io.IOException - If unable to read from the input given in the constructor.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class Rect
Throws:
java.lang.CloneNotSupportedException