gnu.rfb
Class PixelFormat

java.lang.Object
  extended by gnu.rfb.PixelFormat

public class PixelFormat
extends java.lang.Object

Represents the pixel format of pixels being sent between client and server.


Field Summary
static PixelFormat BGR233
           
 boolean bigEndian
           
 int bitsPerPixel
           
 int blueMax
           
 int blueShift
           
 int depth
           
 int greenMax
           
 int greenShift
           
 int redMax
           
 int redShift
           
static PixelFormat RGB888
           
 boolean trueColour
           
 
Constructor Summary
PixelFormat()
          Empty constructor for custom pixel formats.
PixelFormat(java.io.DataInput input)
          Reads in a PixelFormat data from input and creates an instance.
PixelFormat(int bitsPerPixel, int depth, boolean bigEndian, boolean trueColour, int redMax, int greenMax, int blueMax, int redShift, int greenShift, int blueShift)
          Default Constructor for a PixelFormat.
PixelFormat(PixelFormat pixelFormat)
          Creates a PixelFormat based on an existing one.
 
Method Summary
 int deTranslatePixel(int pixel)
          UNTESTED An attempt to de-translate a pixel based on format.
 java.awt.image.DirectColorModel getDirectColorModel()
           
 void print(java.io.PrintStream stream)
          Prints the PixelFormat data to a PrintStream.
 void setDirectColorModel(java.awt.image.DirectColorModel directColorModel)
           
 java.awt.image.DirectColorModel toDirectColorModel()
           
 int translatePixel(int pixel)
          Translates a pixel based on the format.
 void writeData(java.io.DataOutput output)
          Writes the PixelFormat data to the output.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BGR233

public static final PixelFormat BGR233

RGB888

public static final PixelFormat RGB888

bitsPerPixel

public int bitsPerPixel

depth

public int depth

bigEndian

public boolean bigEndian

trueColour

public boolean trueColour

redMax

public int redMax

greenMax

public int greenMax

blueMax

public int blueMax

redShift

public int redShift

greenShift

public int greenShift

blueShift

public int blueShift
Constructor Detail

PixelFormat

public PixelFormat()
Empty constructor for custom pixel formats.


PixelFormat

public PixelFormat(int bitsPerPixel,
                   int depth,
                   boolean bigEndian,
                   boolean trueColour,
                   int redMax,
                   int greenMax,
                   int blueMax,
                   int redShift,
                   int greenShift,
                   int blueShift)
Default Constructor for a PixelFormat.

Parameters:
bitsPerPixel -
depth -
bigEndian -
trueColour -
redMax -
greenMax -
blueMax -
redShift -
greenShift -
blueShift -

PixelFormat

public PixelFormat(java.io.DataInput input)
            throws java.io.IOException
Reads in a PixelFormat data from input and creates an instance.

Parameters:
input - The input to read from.
Throws:
java.io.IOException - If unable to read from the input.

PixelFormat

public PixelFormat(PixelFormat pixelFormat)
Creates a PixelFormat based on an existing one.

Parameters:
pixelFormat - The PixelFormat to copy from.
Method Detail

writeData

public void writeData(java.io.DataOutput output)
               throws java.io.IOException
Writes the PixelFormat data to the output.

Parameters:
output - The output to write to.
Throws:
java.io.IOException - If unable to write to the output.

print

public void print(java.io.PrintStream stream)
Prints the PixelFormat data to a PrintStream.

Parameters:
stream - The stream to print to.

translatePixel

public int translatePixel(int pixel)
Translates a pixel based on the format.

Parameters:
pixel - The pixel to translate.
Returns:
The translated version of the pixel.

deTranslatePixel

public int deTranslatePixel(int pixel)
UNTESTED An attempt to de-translate a pixel based on format.

Parameters:
pixel - The pixel to de-translate.
Returns:
The original pixel value.

toDirectColorModel

public java.awt.image.DirectColorModel toDirectColorModel()
Returns:
The DirectColorModel for this format.

getDirectColorModel

public java.awt.image.DirectColorModel getDirectColorModel()
Returns:
The DirectColorModel for this format.

setDirectColorModel

public void setDirectColorModel(java.awt.image.DirectColorModel directColorModel)
Parameters:
directColorModel -