static class IconExe.PaletteData
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
int |
blueMask
the blue mask for a direct palette
|
int |
blueShift
the blue shift for a direct palette
|
IconExe.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 and Description |
|---|
PaletteData(IconExe.RGB[] colors)
Constructs a new indexed palette given an array of RGB values.
|
PaletteData(int redMask,
int greenMask,
int blueMask)
Constructs a new direct palette given the red, green and blue masks.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getPixel(IconExe.RGB rgb)
Returns the pixel value corresponding to the given
RBG. |
IconExe.RGB |
getRGB(int pixel)
Returns an
RGB corresponding to the given pixel value. |
IconExe.RGB[] |
getRGBs()
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.
|
public boolean isDirect
public IconExe.RGB[] colors
public int redMask
public int greenMask
public int blueMask
public int redShift
public int greenShift
public int blueShift
public PaletteData(IconExe.RGB[] colors)
colors - the array of RGBs for the palettejava.lang.IllegalArgumentException - public PaletteData(int redMask,
int greenMask,
int blueMask)
redMask - the red maskgreenMask - the green maskblueMask - the blue maskpublic int getPixel(IconExe.RGB rgb)
RBG.rgb - the RGB to get the pixel value forjava.lang.IllegalArgumentException - public IconExe.RGB getRGB(int pixel)
RGB corresponding to the given pixel value.pixel - the pixel to get the RGB value forjava.lang.IllegalArgumentException - public IconExe.RGB[] getRGBs()
RGBs for the receiver or nullint shiftForMask(int mask)
mask - the mask to compute the shift forIconExe.PaletteData