gnu.rfb
Class CoRRE
java.lang.Object
gnu.rfb.Rect
gnu.rfb.RRE
gnu.rfb.CoRRE
- All Implemented Interfaces:
- java.lang.Cloneable
public class CoRRE
- extends RRE
CoRRE - Compact RRE Encoding.
We have an RRE header structure giving the number of subrectangles following.
Finally the data follows in the form [...]
where each is []. This means that the
whole rectangle must be at most 255x255 pixels.
Nested classes/interfaces inherited from class gnu.rfb.RRE |
RRE.SubRect |
Constructor Summary |
CoRRE(int[] pixels,
PixelFormat pixelFormat,
int offsetX,
int offsetY,
int scanline,
int x,
int y,
int w,
int h)
Constructor for encoding an array of pixels into CoRRE. |
CoRRE(int x,
int y,
int w,
int h,
PixelFormat pixelFormat,
java.io.DataInputStream input)
Constructor for decoding CoRRE. |
CoRRE(int x,
int y,
int w,
int h,
PixelFormat pixelFormat,
int bgpixel,
RRE.SubRect[] subrects)
Constructor for encoding subrects into CoRRE. |
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 java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
CoRRE
public CoRRE(int[] pixels,
PixelFormat pixelFormat,
int offsetX,
int offsetY,
int scanline,
int x,
int y,
int w,
int h)
- Constructor for encoding an array of pixels into CoRRE.
- Parameters:
pixels
- The array of pixels to encode.pixelFormat
- The current PixelFormat.offsetX
- The offset in the X direction.offsetY
- The offset in the Y direction.scanline
- The width of a single scanline.x
- The x-coordinate.y
- The y-coordinate.w
- The width.h
- The height.
CoRRE
public CoRRE(int x,
int y,
int w,
int h,
PixelFormat pixelFormat,
int bgpixel,
RRE.SubRect[] subrects)
- Constructor for encoding subrects into CoRRE.
- Parameters:
x
- The x-coordinate.y
- The y-coordinate.w
- The width.h
- The height.pixelFormat
- The current PixelFormat.bgpixel
- The background pixel color.subrects
- An array of Sub-Rectangles.
CoRRE
public CoRRE(int x,
int y,
int w,
int h,
PixelFormat pixelFormat,
java.io.DataInputStream input)
throws java.io.IOException
- Constructor for decoding CoRRE.
- Parameters:
x
- The x-coordinate.y
- The y-coordinate.w
- The width.h
- The height.pixelFormat
- The current PixelFormat.input
- The input to read from.
- Throws:
java.io.IOException
- If unable to read from the given input.
writeData
public void writeData(java.io.DataOutput output)
throws java.io.IOException
- Overrides:
writeData
in class RRE
- Throws:
java.io.IOException
clone
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
- Overrides:
clone
in class RRE
- Throws:
java.lang.CloneNotSupportedException
decode
public int[] decode()
throws java.io.IOException
- Description copied from class:
RRE
- Decodes RRE into an image using the input and params given in the
constructor.
- Overrides:
decode
in class RRE
- Returns:
- The image as an array of pixels (Integers)
- Throws:
java.io.IOException
- If unable to read from the input.