| 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.EditableColorModel
This class supports the HorizonColorModel via 4 internal byte arrays. References to these arrays can be obtains via the getColors() methods and edited directly to update the table.
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 | |
| byte[] | alphas
the alpha component arrays |
| byte[] | blues
the blue component arrays |
| byte[] | greens
the green component arrays |
| byte[] | reds
the red component arrays |
| Fields inherited from class ncsa.horizon.awt.color.HorizonColorModel | |
| mapsz, transi | |
| Fields inherited from class java.awt.image.ColorModel | |
| pixel_bits, transferType | |
| Constructor Summary | |
| EditableColorModel(int bits,
int size)
instantiate a color model with a particular size |
|
| EditableColorModel(int bits,
int size,
byte[] r,
byte[] g,
byte[] b,
byte[] a)
construct a color model from a given set of arrays |
|
| EditableColorModel(java.awt.image.IndexColorModel icm)
construct a color model, initializing it with values from a given IndexColorModel. |
|
| EditableColorModel(HorizonColorModel hcm)
construct a color model, initializing it with values from a given HorizonColorModel. |
|
| EditableColorModel(int size,
java.io.Reader in,
PixelFormat pf)
construct and fill our color table from an input stream. |
|
| Method Summary | |
| java.lang.Object | clone()
|
| byte[] | getAlpha()
return the alpha components of the color table as an array |
| int | getAlpha(int index)
Return the alpha color compoment for the specified pixel in the range 0-255. |
| 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 |
| int | getBlue(int index)
Return the blue color compoment for the specified pixel in the range 0-255. |
| 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 |
| int | getGreen(int index)
Return the green color compoment for the specified pixel in the range 0-255. |
| void | getGreens(byte[] g)
copy the green components of the color table as an array |
| static EditableColorModel | getPresetColorModel(java.lang.String name)
read in a preset color table identified by a name. |
| byte[] | getRed()
return the red components of the color table as an array |
| int | getRed(int index)
Return the red color compoment for the specified pixel in the range 0-255. |
| void | getReds(byte[] r)
copy the red components of the color table into an array |
| void | loadFromReader(java.io.Reader in,
PixelFormat pf)
|
| static EditableColorModel | readEditableColorModel(java.io.Reader in,
PixelFormat pf)
read in a color table from an input stream and return it as an EditableColorModel. |
| static EditableColorModel | readEditableColorModel(java.io.File file,
PixelFormat pf)
read in a color table from a File and return it as an EditableColorModel. |
| static EditableColorModel | readEditableColorModel(java.io.File file)
read in a color table from a File and return it as an EditableColorModel. |
| void | setAlpha(int index,
int value)
set the alpha color compoment for the specified pixel. |
| void | setAlpha(byte[] a)
sets the alpha color compoments. |
| void | setBlue(int index,
int value)
set the blue color compoment for the specified pixel. |
| void | setBlue(byte[] b)
sets the blue color compoments. |
| void | setGreen(int index,
int value)
set the green color compoment for the specified pixel. |
| void | setGreen(byte[] g)
sets the green color compoments. |
| void | setOverflowColor(int r,
int g,
int b,
int a)
set the color to be given to datum values greater than some minimum threshold. |
| void | setRed(int index,
int value)
set the red color compoment for the specified pixel. |
| void | setRed(byte[] r)
set the red color compoments. |
| void | setUndefinedColor(int r,
int g,
int b,
int a)
set the color to be given to undefined datum values. |
| void | setUnderflowColor(int r,
int g,
int b,
int a)
set the color to be given to datum values less than some minimum threshold. |
| 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 byte[] reds
protected byte[] greens
protected byte[] blues
protected byte[] alphas
| Constructor Detail |
protected EditableColorModel(int bits,
int size)
bits
- the number of bits each pixel
size
- the number of colors in the color table
public EditableColorModel(int bits,
int size,
byte[] r,
byte[] g,
byte[] b,
byte[] a)
bits
- the number of bits each pixel
size
- the number of colors in the color table
r
- the red components; a null array means set all values
to zero
g
- the green components; a null array means set all values
to zero
b
- the blue components; a null array means set all values
to zeropublic EditableColorModel(java.awt.image.IndexColorModel icm)
icm
- the IndexColorModel to extract colors frompublic EditableColorModel(HorizonColorModel hcm)
icm
- the IndexColorModel to extract colors from
public EditableColorModel(int size,
java.io.Reader in,
PixelFormat pf)
throws java.io.IOException
| Method Detail |
protected void loadFromReader(java.io.Reader in,
PixelFormat pf)
throws java.io.IOException
protected byte[] getRed()
protected byte[] getGreen()
protected byte[] getBlue()
protected byte[] getAlpha()
public void setUndefinedColor(int r,
int g,
int b,
int a)
public void setUnderflowColor(int r,
int g,
int b,
int a)
public void setOverflowColor(int r,
int g,
int b,
int a)
public int getRed(int index)
public int getGreen(int index)
public int getBlue(int index)
public int getAlpha(int index)
public void setRed(int index,
int value)
public void setGreen(int index,
int value)
public void setBlue(int index,
int value)
public void setAlpha(int index,
int value)
public void setRed(byte[] r)
public void setGreen(byte[] g)
public void setBlue(byte[] b)
public void setAlpha(byte[] a)
public void getReds(byte[] r)
public void getGreens(byte[] g)
public void getBlues(byte[] b)
public void getAlphas(byte[] a)
public static EditableColorModel readEditableColorModel(java.io.Reader in,
PixelFormat pf)
throws java.io.IOException
in
- the input stream as a Reader
pf
- the PixelFormat object that tells how to parse the table;
null means use the default format object
public static EditableColorModel readEditableColorModel(java.io.File file,
PixelFormat pf)
throws java.io.IOException
file
- the input file
pf
- the PixelFormat object that tells how to parse the table.
public static EditableColorModel readEditableColorModel(java.io.File file)
throws java.io.IOException
file
- the input filepublic static EditableColorModel getPresetColorModel(java.lang.String name)
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 | ||