Constructs a new indexed palette given an array of RGB values.
Constructs a new direct palette given the red, green and blue masks.
Returns the pixel value corresponding to the given <code>RGB</code>.
Returns an <code>RGB</code> corresponding to the given pixel value.
Returns all the RGB values in the receiver if it is an indexed palette, or null if it is a direct palette.
Computes the shift value for a given mask.
the blue mask for a direct palette
the blue shift for a direct palette
the RGB values for an indexed palette, where the indices of the array correspond to pixel values
the green mask for a direct palette
the green shift for a direct palette
true if the receiver is a direct palette, and false otherwise
the red mask for a direct palette
the red shift for a direct palette
Instances of this class describe the color data used by an image. <p> Depending on the depth of the image, the PaletteData can take one of two forms, indicated by the isDirect field: </p> <dl> <dt> <em>isDirect is false</em> </dt> <dd> If isDirect is <code>false</code>, this palette is an indexed palette which maps pixel values to RGBs. The actual RGB values may be retrieved by using the getRGBs() method. </dd> <dt> <em>isDirect is true</em> </dt> <dd> If isDirect is <code>true</code>, this palette is a direct color palette. Instead of containing RGB values, it contains red, green and blue mask and shift information which indicates how the color components may be extracted from a given pixel. This means that the RGB value is actually encoded in the pixel value. <p> 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. </p> </dd> </dl>
@see Image @see RGB @see <a href="http://www.eclipse.org/swt/">Sample code and further information</a>