org.eclipse.swt.graphics
Class PaletteData

java.lang.Object
  |
  +--org.eclipse.swt.graphics.PaletteData

public final class PaletteData
extends Object

Unsafe:


Field Summary
 int blueMask
          Suppressed: the blue mask for a direct palette
 int blueShift
          Suppressed: the blue shift for a direct palette
 RGB[] colors
          Suppressed: the RGB values for an indexed palette, where the indices of the array correspond to pixel values
 int greenMask
          Suppressed: the green mask for a direct palette
 int greenShift
          Suppressed: the green shift for a direct palette
 boolean isDirect
          Suppressed: true if the receiver is a direct palette, and false otherwise
 int redMask
          Suppressed: the red mask for a direct palette
 int redShift
          Suppressed: the red shift for a direct palette
 
Constructor Summary
PaletteData(int redMask, int greenMask, int blueMask)
          Suppressed: Constructs a new direct palette given the red, green and blue masks.
PaletteData(RGB[] colors)
          Suppressed: Constructs a new indexed palette given an array of RGB values.
 
Method Summary
 int getPixel(RGB rgb)
          Suppressed: Returns the pixel value corresponding to the given RBG.
 RGB getRGB(int pixel)
          Suppressed: Returns an RGB corresponding to the given pixel value.
 RGB[] getRGBs()
          Suppressed: Returns all the RGB values in the receiver if it is an indexed palette, or null if it is a direct palette.
(package private)  int shiftForMask(int mask)
          Computes the shift value for a given mask.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

isDirect

public boolean isDirect
Suppressed: true if the receiver is a direct palette, and false otherwise


colors

public RGB[] colors
Suppressed: the RGB values for an indexed palette, where the indices of the array correspond to pixel values


redMask

public int redMask
Suppressed: the red mask for a direct palette


greenMask

public int greenMask
Suppressed: the green mask for a direct palette


blueMask

public int blueMask
Suppressed: the blue mask for a direct palette


redShift

public int redShift
Suppressed: the red shift for a direct palette


greenShift

public int greenShift
Suppressed: the green shift for a direct palette


blueShift

public int blueShift
Suppressed: the blue shift for a direct palette

Constructor Detail

PaletteData

public PaletteData(RGB[] colors)
Suppressed: Constructs a new indexed palette given an array of RGB values.

Parameters:
colors - the array of RGBs for the palette

PaletteData

public PaletteData(int redMask,
                   int greenMask,
                   int blueMask)
Suppressed: Constructs a new direct palette given the red, green and blue masks.

Parameters:
redMask - the red mask
greenMask - the green mask
blueMask - the blue mask
Method Detail

getPixel

public int getPixel(RGB rgb)
Suppressed: Returns the pixel value corresponding to the given RBG.

Returns:
the pixel value for the given RGB

getRGB

public RGB getRGB(int pixel)
Suppressed: Returns an RGB corresponding to the given pixel value.

Returns:
the RGB value for the given pixel

getRGBs

public RGB[] getRGBs()
Suppressed: Returns all the RGB values in the receiver if it is an indexed palette, or null if it is a direct palette.

Returns:
the RGBs for the receiver or null

shiftForMask

int shiftForMask(int mask)
Computes the shift value for a given mask.

Parameters:
mask - the mask to compute the shift for
Returns:
the shift amount
See Also:
PaletteData


comments?