| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||
java.lang.Object
|
+--java.awt.image.ColorModel
|
+--ncsa.horizon.awt.color.HorizonColorModel
|
+--ncsa.horizon.awt.color.FunctionalColorModel
This class supports the
HorizonColorModel via a color table calculated by a set of 4
functions defining the red, green, blue, and alpha components.
Developers subclass it by implementing three methods: getRedValue(),
getGreenValue(), getBlueValue(), getAlphaValue(). Normally, subclasses
do not override the getColor() methods (getRed(), getGreen(),
etc.) as the default implementations employ the getColorValue()
methods as well as support scaling of the function as well as the special
indicies supported by the HorizonColorModel.
Although it extends the ColorModel class, this class (like its superclass)
is not meant to be used directly as such; instead, one should convert this
ColorModel to an IndexColorModel via the superclass's
createIndexColorModel() method for higher performance during
image rendering.
| Field Summary | |
| boolean | doscale
if true, scale the function. |
| int | oflo
the color associated the last index (overflow values). |
| int | uflo
the color associated with index 1 (underflow values). |
| int | undef
the color associated with index 0 (undefined values). |
| Fields inherited from class ncsa.horizon.awt.color.HorizonColorModel | |
| mapsz, transi | |
| Fields inherited from class java.awt.image.ColorModel | |
| pixel_bits, transferType | |
| Constructor Summary | |
| FunctionalColorModel(int bits,
int size)
instantiate a HorizonColorModel. |
|
| FunctionalColorModel(int bits,
int size,
boolean scale)
instantiate a HorizonColorModel. |
|
| Method Summary | |
| byte[] | getAlpha()
return the alpha components of the color table as an array |
| int | getAlpha(int index)
Returns the alpha compoment for the specified pixel in the range 0-255. |
| byte | getAlphaValue(double in)
return the alpha component value associated with an unscaled input value. |
| byte[] | getBlue()
return the blue components of the color table as an array |
| int | getBlue(int index)
Returns the blue color compoment for the specified pixel in the range 0-255. |
| byte | getBlueValue(double in)
return the blue component value associated with an unscaled input value. |
| byte[] | getGreen()
return the green components of the color table as an array |
| int | getGreen(int index)
Returns the green color compoment for the specified pixel in the range 0-255. |
| byte | getGreenValue(double in)
return the green component value associated with an unscaled input value. |
| byte[] | getRed()
return the red components of the color table as an array |
| int | getRed(int index)
Returns the red color compoment for the specified pixel in the range 0-255. |
| byte | getRedValue(double in)
return the red component value associated with an unscaled input value. |
| boolean | isEditable()
return true if the arrays returned by the getColors() methods return a reference to
the internal color component array. |
| void | setOverflowColor(int red,
int green,
int blue,
int alpha)
set the color to be given to undefined datum values. |
| void | setUndefinedColor(int red,
int green,
int blue,
int alpha)
set the color to be given to undefined datum values. |
| void | setUnderflowColor(int red,
int green,
int blue,
int alpha)
set the color to be given to undefined datum values. |
| Methods inherited from class ncsa.horizon.awt.color.HorizonColorModel | |
| addHorizonColorModelListener, clearChanged, clone, createIndexColorModel, delayNotify, delayNotify, getAlpha, getAlphas, getBlue, getBlues, getGreen, getGreens, getMapSize, getOverflowColor, getRed, getReds, getTransparentIndex, getUndefinedColor, getUnderflowColor, hasChanged, notifyListeners, removeAllListeners, removeListener, saveColorModel, saveColorModel, saveColorModel, setChanged, setChanged, setOverflowColor, setTransparentIndex, setUndefinedColor, setUnderflowColor | |
| Methods inherited from class java.awt.image.ColorModel | |
| coerceData, createCompatibleSampleModel, createCompatibleWritableRaster, equals, finalize, getAlpha, getAlpha, getAlphaRaster, getBlue, getBlue, getColorSpace, getComponents, getComponents, getComponentSize, getComponentSize, getDataElement, getDataElements, getGreen, getGreen, getNormalizedComponents, getNumColorComponents, getNumComponents, getPixelSize, getRed, getRed, getRGB, getRGB, getRGBdefault, getTransparency, getUnnormalizedComponents, hasAlpha, isAlphaPremultiplied, isCompatibleRaster, isCompatibleSampleModel, setDataElements, toString | |
| Methods inherited from class java.lang.Object | |
| clone, equals, finalize, getClass, hashCode, notifyAll, notify, toString, wait, wait, wait | |
| Field Detail |
protected boolean doscale
protected int undef
protected int uflo
protected int oflo
| Constructor Detail |
public FunctionalColorModel(int bits,
int size)
bits
- the number of bits each pixel
size
- the number of colors in the color table
public FunctionalColorModel(int bits,
int size,
boolean scale)
bits
- the number of bits each pixel
size
- the number of colors in the color table
scale
- if true, scale the regular part of the table to
fit within the functions' input values [0, 100).| Method Detail |
public boolean isEditable()
getColors() methods return a reference to
the internal color component array. In this case, changes made
to elements of the arrays effectively update this ColorModel.
A value of false is returned if those methods return copies of
the internal color component arrays.protected byte[] getRed()
protected byte[] getGreen()
protected byte[] getBlue()
protected byte[] getAlpha()
protected abstract byte getRedValue(double in)
protected abstract byte getGreenValue(double in)
protected abstract byte getBlueValue(double in)
protected abstract byte getAlphaValue(double in)
public int getRed(int index)
public int getGreen(int index)
public int getBlue(int index)
public int getAlpha(int index)
public void setUndefinedColor(int red,
int green,
int blue,
int alpha)
public void setUnderflowColor(int red,
int green,
int blue,
int alpha)
public void setOverflowColor(int red,
int green,
int blue,
int alpha)
| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||