|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.swt.graphics.PaletteData
Instances of this class describe the color data used by an image.
Depending on the depth of the image, the PaletteData can take one of two forms, indicated by the isDirect field:
In this case, the shift data is the number of bits required to shift the RGB value to the left in order to align the high bit of the corresponding mask with the high bit of the first byte. This number may be negative, so care must be taken when shifting. For example, with a red mask of 0xFF0000, the red shift would be -16. With a red mask of 0x1F, the red shift would be 3.
Field Summary | |
int | blueMask
the blue mask for a direct palette |
int | blueShift
the blue shift for a direct palette |
RGB[] | colors
the RGB values for an indexed palette, where the indices of the array correspond to pixel values |
int | greenMask
the green mask for a direct palette |
int | greenShift
the green shift for a direct palette |
boolean | isDirect
true if the receiver is a direct palette, and false otherwise |
int | redMask
the red mask for a direct palette |
int | redShift
the red shift for a direct palette |
Constructor Summary | |
PaletteData(int redMask,
int greenMask,
int blueMask)
Constructs a new direct palette given the red, green and blue masks. | |
PaletteData(RGB[] colors)
Constructs a new indexed palette given an array of RGB values. |
Method Summary | |
int | getPixel(RGB rgb)
Returns the pixel value corresponding to the given RBG. |
RGB | getRGB(int pixel)
Returns an RGB corresponding to the given pixel value. |
RGB[] | getRGBs()
Returns all the RGB values in the receiver if it is an indexed palette, or null if it is a direct palette. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public boolean isDirect
public RGB[] colors
public int redMask
public int greenMask
public int blueMask
public int redShift
public int greenShift
public int blueShift
Constructor Detail |
public PaletteData(RGB[] colors)
public PaletteData(int redMask, int greenMask, int blueMask)
Method Detail |
public int getPixel(RGB rgb)
public RGB getRGB(int pixel)
public RGB[] getRGBs()
|
Eclipse Platform Release 3.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2000, 2004. All rights reserved.