|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.deegree_impl.model.resources.Colors
Utilities methods for handling of colors informations.
Field Summary | |
private static double |
EPS
Small number for rounding errors. |
Constructor Summary | |
private |
Colors()
Do not allow instantiation of this class. |
Method Summary | |
static void |
expand(java.awt.Color[] colors,
int[] ARGB,
int lower,
int upper)
Copy colors into array ARGB from index lower
inclusive to index upper exclusive. |
static int |
getBitCount(int mapSize)
Returns a suggered bit count for an IndexColorModel of
mapSize colors. |
static java.awt.image.IndexColorModel |
getIndexColorModel(int[] ARGB)
Returns an index color model for specified ARGB codes. |
private static int |
getTransferType(int mapSize)
Returns a suggered type for an IndexColorModel
of mapSize colors. |
private static int |
round(double value)
Round a float value and clamp the result between 0 and 255 inclusive. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final double EPS
Constructor Detail |
private Colors()
Method Detail |
public static void expand(java.awt.Color[] colors, int[] ARGB, int lower, int upper)
colors
into array ARGB
from index lower
inclusive to index upper
exclusive. If upper-lower
is not
equals to the length of colors
array, then colors will be interpolated.
colors
- Colors to copy into the ARGB
array.ARGB
- Array of integer to write ARGB values to.lower
- Index (inclusive) of the first element of ARGB
to change.upper
- Index (exclusive) of the last element of ARGB
to change.private static int round(double value)
public static java.awt.image.IndexColorModel getIndexColorModel(int[] ARGB)
ARGB
- An array of ARGB values.
public static int getBitCount(int mapSize)
IndexColorModel
of
mapSize
colors. This method returns 1, 2, 4, 8 or
16 according the value of mapSize
. It is guaranteed
that the following relation is hold:
(1 << getBitCount(mapSize)) >= mapSize
private static int getTransferType(int mapSize)
IndexColorModel
of mapSize
colors. This method returns
DataBuffer.TYPE_BYTE
or DataBuffer.TYPE_USHORT
.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |