gnu.rfb
Class RRE

java.lang.Object
  extended by gnu.rfb.Rect
      extended by gnu.rfb.RRE
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
CoRRE

public class RRE
extends Rect

Provides encoding and decoding of images using the RRE encoding. RRE - Rise-and-Run-length Encoding.

We have an RRE header structure giving the number of subrectangles following. Finally the data follows in the form [...] where each is [].


Nested Class Summary
static class RRE.SubRect
           
 
Field Summary
 int bgpixel
           
 PixelFormat pixelFormat
           
 RRE.SubRect[] subrects
           
 
Fields inherited from class gnu.rfb.Rect
count, h, w, x, y
 
Constructor Summary
RRE(int[] pixels, PixelFormat pixelFormat, int offsetX, int offsetY, int scanline, int x, int y, int w, int h)
           
RRE(int x, int y, int w, int h, PixelFormat pixelFormat, java.io.DataInputStream input)
          Constructor for decoding RRE.
RRE(int x, int y, int w, int h, PixelFormat pixelFormat, int bgpixel, RRE.SubRect[] subrects)
           
 
Method Summary
 java.lang.Object clone()
           
 int[] decode()
          Decodes RRE into an image using the input and params given in the constructor.
 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

bgpixel

public int bgpixel

subrects

public RRE.SubRect[] subrects
Constructor Detail

RRE

public RRE(int[] pixels,
           PixelFormat pixelFormat,
           int offsetX,
           int offsetY,
           int scanline,
           int x,
           int y,
           int w,
           int h)
Parameters:
pixels -
pixelFormat -
offsetX -
offsetY -
scanline -
x -
y -
w -
h -

RRE

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

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

RRE

public RRE(int x,
           int y,
           int w,
           int h,
           PixelFormat pixelFormat,
           int bgpixel,
           RRE.SubRect[] subrects)
Parameters:
x -
y -
w -
h -
pixelFormat -
bgpixel -
subrects -
Method Detail

decode

public int[] decode()
             throws java.io.IOException
Decodes RRE into an image using the input and params given in the constructor.

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

writeData

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

clone

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