| 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
This class allows one to define and/or edit the lookup table that
can be applied to data for display as an image. Although it extends
the ColorModel class, it is not meant to be used directly as such;
instead, one should convert this ColorModel to an IndexColorModel
via the createIndexColorModel() method for higher
performance during image rendering.
One of the goals of this ColorModel is to support the color index
convention employed by the
TransferFunction
and its implementations. That is, the first index points to the color
to be given to undefined datum values; the second, to datum values less
than a minimum value; the last index, to values greater than a maximum
value. These are set with the setUndefinedColor(),
setUnderflowColor(), and setUnderflowColor()
methods, respectively. One can also set an index to be transparent
with the setTransparentIndex() method.
The protected methods getReds(), getGreens(),
getBlues(), and getAlphas() are used to
convert a HorizonColroModel to an IndexColorModel via createIndexColorModel.
Subclasses should return references for these methods when possible.
| Field Summary | |
| int | mapsz
the size of the color table |
| int | transi
the index to the transparent pixel. |
| Fields inherited from class java.awt.image.ColorModel | |
| pixel_bits, transferType | |
| Constructor Summary | |
| HorizonColorModel(int bits,
int size)
instantiate a HorizonColorModel. |
|
| Method Summary | |
| void | addHorizonColorModelListener(HorizonColorModelListener l)
add a listener of changes to this color model |
| void | clearChanged()
clear the change status of this ColorModel |
| java.lang.Object | clone()
clone this color model. |
| java.awt.image.IndexColorModel | createIndexColorModel()
convert this ColorModel into an IndexColorModel |
| boolean | delayNotify()
return true if notification of Listeners is delayed until an explicit call to notifyListeners(). |
| boolean | delayNotify(boolean yes)
set whether notification of Listeners is delayed until an explicit call to notifyListeners(). |
| byte[] | getAlpha()
return the alpha components of the color table as an array A reference rather than a copy should be returned when possible. |
| void | getAlphas(byte[] a)
copy the alpha components of the color table as an array |
| byte[] | getBlue()
return the blue components of the color table as an array A reference rather than a copy should be returned when possible. |
| void | getBlues(byte[] b)
copy the blue components of the color table as an array |
| byte[] | getGreen()
return the green components of the color table as an array A reference rather than a copy should be returned when possible. |
| void | getGreens(byte[] g)
copy the green components of the color table as an array |
| int | getMapSize()
return the number of colors in this table |
| int[] | getOverflowColor()
return the color to be given to datum values greater than some minimum threshold. |
| byte[] | getRed()
return the red components of the color table as an array. |
| void | getReds(byte[] r)
copy the red components of the color table into an array |
| int | getTransparentIndex()
return the index that is to be completely transparent (alpha=255). |
| int[] | getUndefinedColor()
return the color to be given to undefined datum values. |
| int[] | getUnderflowColor()
return the color to be given to datum values less than some minimum threshold. |
| boolean | hasChanged()
return true if there have been changes made that are pending notification of listeners |
| void | notifyListeners()
notify listeners of any changes |
| void | removeAllListeners()
remove all listeners |
| void | removeListener(HorizonColorModelListener l)
remove a listener |
| void | saveColorModel(java.io.Writer out,
PixelFormat pfmt)
save the color table to an output stream |
| void | saveColorModel(java.io.Writer out)
save the color table to an output stream |
| void | saveColorModel(java.io.File file)
save the color table to a file. |
| void | setChanged()
indicate that model has changed in an unspecified way |
| void | setChanged(int flags)
indicate that model has changed in an specified ways |
| void | setOverflowColor(int red,
int green,
int blue,
int alpha)
set the color to be given to datum values greater than some minimum threshold. |
| void | setTransparentIndex(int index)
get the index that is to be completely transparent (alpha=255). |
| 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 datum values less than some minimum threshold. |
| 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 int mapsz
protected int transi
| Constructor Detail |
public HorizonColorModel(int bits,
int size)
bits
- the number of bits each pixel
size
- the number of colors in the color table| Method Detail |
public int getMapSize()
protected abstract byte[] getRed()
protected abstract byte[] getGreen()
protected abstract byte[] getBlue()
protected abstract byte[] getAlpha()
public java.awt.image.IndexColorModel createIndexColorModel()
public final int[] getUndefinedColor()
public abstract void setUndefinedColor(int red,
int green,
int blue,
int alpha)
public final int[] getUnderflowColor()
public abstract void setUnderflowColor(int red,
int green,
int blue,
int alpha)
public final int[] getOverflowColor()
public abstract void setOverflowColor(int red,
int green,
int blue,
int alpha)
public final int getTransparentIndex()
public final void setTransparentIndex(int index)
public void addHorizonColorModelListener(HorizonColorModelListener l)
public void notifyListeners()
protected void clearChanged()
public boolean hasChanged()
public void removeListener(HorizonColorModelListener l)
public void removeAllListeners()
protected void setChanged()
protected void setChanged(int flags)
flags
- change flags ORed together. These will be ORed
with the already pending changes.public boolean delayNotify()
public boolean delayNotify(boolean yes)
public void getReds(byte[] r)
public void getGreens(byte[] g)
public void getBlues(byte[] b)
public void getAlphas(byte[] a)
public void saveColorModel(java.io.Writer out,
PixelFormat pfmt)
throws java.io.IOException
out
- the output stream
pfmt
- the format to use
public void saveColorModel(java.io.Writer out)
throws java.io.IOException
out
- the output stream
pfmt
- the format to use
public void saveColorModel(java.io.File file)
throws java.io.IOException
public java.lang.Object clone()
| Overview | Package | Class | Tree | Deprecated | Index | Help | |||
| PREV CLASS | NEXT CLASS | FRAMES | NO FRAMES | ||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||