public class IcyColorMap extends java.lang.Object implements ChangeListener, XMLPersistent
Modifier and Type | Class and Description |
---|---|
static class |
IcyColorMap.IcyColorMapType |
Modifier and Type | Field and Description |
---|---|
IcyColorMapComponent |
alpha
ALPHA band
|
IcyColorMapComponent |
blue
BLUE band
|
static int |
COLORMAP_BITS
define the wanted colormap bits resolution (never change it)
|
static java.lang.String |
DEFAULT_COLORMAP_DIR
default colormap directory
|
IcyColorMapComponent |
gray
GRAY band
|
IcyColorMapComponent |
green
GREEN band
|
static int |
MAX_INDEX |
static int |
MAX_LEVEL |
IcyColorMapComponent |
red
RED band
|
static int |
SIZE
define colormap size
|
Constructor and Description |
---|
IcyColorMap() |
IcyColorMap(IcyColorMap colormap)
Create a copy of specified colormap.
|
IcyColorMap(java.lang.String name) |
IcyColorMap(java.lang.String name,
IcyColorMap.IcyColorMapType type) |
IcyColorMap(java.lang.String name,
java.lang.Object maps) |
Modifier and Type | Method and Description |
---|---|
void |
addListener(IcyColorMapListener listener)
Add a listener
|
void |
beginUpdate() |
void |
changed()
called when colormap data changed
|
void |
copyFrom(byte[][] maps)
Copy data from specified 2D byte array
|
void |
copyFrom(byte[][] maps,
boolean copyAlpha)
Copy data from specified 2D byte array.
|
void |
copyFrom(IcyColorMap srcColorMap)
Copy data from specified source colormap
|
void |
copyFrom(IcyColorMap srcColorMap,
boolean copyAlpha)
Copy data from specified source colormap.
|
void |
copyFrom(short[][] maps)
Copy data from specified 2D short array.
|
void |
copyFrom(short[][] maps,
boolean copyAlpha)
Copy data from specified 2D short array.
|
void |
endUpdate() |
boolean |
equals(java.lang.Object obj)
Return true if the colormap has the same type and same color intensities than specified one.
|
void |
fireEvent(IcyColorMapEvent e)
fire event
|
static java.util.List<IcyColorMap> |
getAllColorMaps(boolean wantGrayInverse,
boolean wantAlpha)
Returns the list of all available colormaps.
|
short |
getAlpha(float index)
Get alpha intensity from a normalized input index
|
short |
getAlpha(int index)
Get alpha intensity from an input index
|
short[] |
getAlphaMap()
Returns the alpha component map.
|
short |
getBlue(float index)
Get blue intensity from a normalized input index
|
short |
getBlue(int index)
Get blue intensity from an input index
|
short[] |
getBlueMap()
Returns the blue component map.
|
java.awt.Color |
getColor(int index)
Gets a Color object representing the color at the specified index
|
static java.util.List<IcyColorMap> |
getCustomColorMaps()
Returns the list of custom colormap available in the Icy "colormap" folder
|
java.awt.Color |
getDominantColor()
Returns the dominant color of this colormap.
|
short |
getGreen(float index)
Get green intensity from a normalized input index
|
short |
getGreen(int index)
Get green intensity from an input index
|
short[] |
getGreenMap()
Returns the green component map.
|
static java.util.List<IcyColorMap> |
getLinearColorMaps(boolean wantGrayInverse,
boolean wantAlpha)
Returns the list of default linear colormap:
GRAY, [GRAY_INV,] RED, GREEN, BLUE, MAGENTA, YELLOW, CYAN, [ALPHA] |
java.lang.String |
getName() |
float |
getNormalizedAlpha(float index)
Get normalized alpha intensity from a normalized input index
|
float |
getNormalizedAlpha(int index)
Get alpha normalized intensity from an input index
|
float[] |
getNormalizedAlphaMap()
Returns the normalized alpha component map.
|
float |
getNormalizedBlue(float index)
Get normalized blue intensity from a normalized input index
|
float |
getNormalizedBlue(int index)
Get normalized blue intensity from an input index
|
float[] |
getNormalizedBlueMap()
Returns the normalized blue component map.
|
float |
getNormalizedGreen(float index)
Get normalized green intensity from a normalized input index
|
float |
getNormalizedGreen(int index)
Get normalized green intensity from an input index
|
float[] |
getNormalizedGreenMap()
Returns the normalized green component map.
|
float |
getNormalizedRed(float index)
Get normalized red intensity from a normalized input index
|
float |
getNormalizedRed(int index)
Get normalized red intensity from an input index
|
float[] |
getNormalizedRedMap()
Returns the normalized red component map.
|
int[][] |
getPremulRGB()
Return the pre-multiplied RGB cache
|
float[][] |
getPremulRGBNorm()
Return the pre-multiplied RGB cache (normalized)
|
short |
getRed(float index)
Get red intensity from a normalized input index
|
short |
getRed(int index)
Get red intensity from an input index
|
short[] |
getRedMap()
Returns the red component map.
|
static java.util.List<IcyColorMap> |
getSpecialColorMaps()
Returns the list of special colormap:
ICE, FIRE, HSV, JET, GLOW |
IcyColorMap.IcyColorMapType |
getType() |
int |
hashCode() |
boolean |
isAlpha()
Return true if this color map is ALPHA type
|
boolean |
isBlack()
Return true if this is a total black colormap.
|
boolean |
isEnabled() |
boolean |
isGray()
Return true if this color map is GRAY type
|
boolean |
isLinear()
Return true if this is a linear type colormap.
|
boolean |
isRGB()
Return true if this color map is RGB type
|
boolean |
isUpdating() |
boolean |
loadFromXML(org.w3c.dom.Node node)
LOAD
|
void |
onChanged(CollapsibleEvent e)
fire changed event
|
void |
removeListener(IcyColorMapListener listener)
Remove a listener
|
boolean |
saveToXML(org.w3c.dom.Node node)
SAVE
|
void |
setAlpha(int index,
short value)
Set alpha intensity to specified index
|
void |
setAlphaControlPoint(int index,
int value)
Set a alpha control point to specified index and value
|
void |
setAlphaToLinear()
Set the alpha channel to linear opacity (0 to 1)
|
void |
setAlphaToLinear3D()
Set the alpha channel to an optimized linear transparency for 3D volume display
|
void |
setAlphaToOpaque()
Set the alpha channel to opaque
|
void |
setARGB(int index,
java.awt.Color value)
Set ARGB color to specified index
|
void |
setARGB(int index,
int argb)
Set ARGB color to specified index
|
void |
setARGBControlPoint(int index,
java.awt.Color value)
Set ARGB control point values to specified index
|
void |
setBlue(int index,
short value)
Set blue intensity to specified index
|
void |
setBlueControlPoint(int index,
int value)
Set a blue control point to specified index and value
|
void |
setDefaultAlphaFor3D()
Deprecated.
Use
setAlphaToLinear3D() instead |
void |
setEnabled(boolean enabled)
Set enabled flag.
|
void |
setGray(int index,
short value)
Set gray intensity to specified index
|
void |
setGrayControlPoint(int index,
int value)
Set a gray control point to specified index and value
|
void |
setGreen(int index,
short value)
Set green intensity to specified index
|
void |
setGreenControlPoint(int index,
int value)
Set a green control point to specified index and value
|
void |
setName(java.lang.String name) |
void |
setNormalizedAlpha(int index,
float value)
Set alpha intensity (normalized) to specified index
|
void |
setNormalizedBlue(int index,
float value)
Set blue intensity (normalized) to specified index
|
void |
setNormalizedGray(int index,
float value)
Set gray intensity (normalized) to specified index
|
void |
setNormalizedGreen(int index,
float value)
Set green intensity (normalized) to specified index
|
void |
setNormalizedRed(int index,
float value)
Set red intensity (normalized) to specified index
|
void |
setRed(int index,
short value)
Set red intensity to specified index
|
void |
setRedControlPoint(int index,
int value)
Set a red control point to specified index and value
|
void |
setRGB(int index,
java.awt.Color value)
Set RGB color to specified index
|
void |
setRGB(int index,
int rgb)
Set RGB color to specified index
|
void |
setRGBControlPoint(int index,
java.awt.Color value)
Set RGB control point values to specified index
|
void |
setType(IcyColorMap.IcyColorMapType value) |
void |
setTypeFromData()
Define the type of color map depending its RGBA data.
|
void |
setTypeFromData(boolean notifyChange) |
java.lang.String |
toString() |
public static final int COLORMAP_BITS
public static final int MAX_LEVEL
public static final int SIZE
public static final int MAX_INDEX
public static final java.lang.String DEFAULT_COLORMAP_DIR
public final IcyColorMapComponent red
public final IcyColorMapComponent green
public final IcyColorMapComponent blue
public final IcyColorMapComponent gray
public final IcyColorMapComponent alpha
public IcyColorMap(java.lang.String name, IcyColorMap.IcyColorMapType type)
public IcyColorMap(java.lang.String name)
public IcyColorMap(java.lang.String name, java.lang.Object maps)
public IcyColorMap(IcyColorMap colormap)
public IcyColorMap()
public static java.util.List<IcyColorMap> getLinearColorMaps(boolean wantGrayInverse, boolean wantAlpha)
wantGrayInverse
- specify if we want the gray inverse colormapwantAlpha
- specify if we want the alpha colormappublic static java.util.List<IcyColorMap> getSpecialColorMaps()
public static java.util.List<IcyColorMap> getCustomColorMaps()
public static java.util.List<IcyColorMap> getAllColorMaps(boolean wantGrayInverse, boolean wantAlpha)
wantGrayInverse
- specify if we want the gray inverse colormapwantAlpha
- specify if we want the alpha colormappublic boolean isRGB()
public boolean isGray()
public boolean isAlpha()
public IcyColorMap.IcyColorMapType getType()
public void setType(IcyColorMap.IcyColorMapType value)
value
- the type to setpublic void setTypeFromData(boolean notifyChange)
setTypeFromData()
public void setTypeFromData()
IcyColorMapType.ALPHA
IcyColorMapType.GRAY
IcyColorMapType.RGB
public void setRedControlPoint(int index, int value)
public void setGreenControlPoint(int index, int value)
public void setBlueControlPoint(int index, int value)
public void setGrayControlPoint(int index, int value)
public void setAlphaControlPoint(int index, int value)
public void setRGBControlPoint(int index, java.awt.Color value)
public void setARGBControlPoint(int index, java.awt.Color value)
public short[] getBlueMap()
IcyColorMap.IcyColorMapType.GRAY
then it returns the gray map instead.
If the color map type is IcyColorMap.IcyColorMapType.ALPHA
then it returns null
.public short[] getGreenMap()
IcyColorMap.IcyColorMapType.GRAY
then it returns the gray map instead.
If the color map type is IcyColorMap.IcyColorMapType.ALPHA
then it returns null
.public short[] getRedMap()
IcyColorMap.IcyColorMapType.GRAY
then it returns the gray map instead.
If the color map type is IcyColorMap.IcyColorMapType.ALPHA
then it returns null
.public short[] getAlphaMap()
public float[] getNormalizedBlueMap()
IcyColorMap.IcyColorMapType.GRAY
then it returns the gray map instead.
If the color map type is IcyColorMap.IcyColorMapType.ALPHA
then it returns null
.public float[] getNormalizedGreenMap()
IcyColorMap.IcyColorMapType.GRAY
then it returns the gray map instead.
If the color map type is IcyColorMap.IcyColorMapType.ALPHA
then it returns null
.public float[] getNormalizedRedMap()
IcyColorMap.IcyColorMapType.GRAY
then it returns the gray map instead.
If the color map type is IcyColorMap.IcyColorMapType.ALPHA
then it returns null
.public float[] getNormalizedAlphaMap()
public short getBlue(int index)
index
- public short getGreen(int index)
index
- public short getRed(int index)
index
- public short getAlpha(int index)
index
- public float getNormalizedBlue(int index)
index
- public float getNormalizedGreen(int index)
index
- public float getNormalizedRed(int index)
index
- public float getNormalizedAlpha(int index)
index
- public short getBlue(float index)
index
- public short getGreen(float index)
index
- public short getRed(float index)
index
- public short getAlpha(float index)
index
- public float getNormalizedBlue(float index)
index
- public float getNormalizedGreen(float index)
index
- public float getNormalizedRed(float index)
index
- public float getNormalizedAlpha(float index)
index
- public void setRed(int index, short value)
public void setGreen(int index, short value)
public void setBlue(int index, short value)
public void setGray(int index, short value)
public void setAlpha(int index, short value)
public void setNormalizedRed(int index, float value)
public void setNormalizedGreen(int index, float value)
public void setNormalizedBlue(int index, float value)
public void setNormalizedGray(int index, float value)
public void setNormalizedAlpha(int index, float value)
public void setRGB(int index, int rgb)
public void setRGB(int index, java.awt.Color value)
public void setARGB(int index, int argb)
public void setARGB(int index, java.awt.Color value)
public void setAlphaToOpaque()
public void setAlphaToLinear()
public void setAlphaToLinear3D()
@Deprecated public void setDefaultAlphaFor3D()
setAlphaToLinear3D()
insteadpublic java.lang.String getName()
public void setName(java.lang.String name)
name
- the name to setpublic boolean isEnabled()
public void setEnabled(boolean enabled)
enabled
- the enabled to setpublic java.awt.Color getColor(int index)
index
- the index of the color map to retrievepublic int[][] getPremulRGB()
public float[][] getPremulRGBNorm()
public void copyFrom(IcyColorMap srcColorMap, boolean copyAlpha)
copyAlpha
- Also copy the alpha information.public void copyFrom(IcyColorMap srcColorMap)
public void copyFrom(byte[][] maps, boolean copyAlpha)
copyAlpha
- Also copy the alpha information.public void copyFrom(byte[][] maps)
public void copyFrom(short[][] maps, boolean copyAlpha)
copyAlpha
- Also copy the alpha information.public void copyFrom(short[][] maps)
public boolean isLinear()
public boolean isBlack()
public java.awt.Color getDominantColor()
public void addListener(IcyColorMapListener listener)
listener
- public void removeListener(IcyColorMapListener listener)
listener
- public void fireEvent(IcyColorMapEvent e)
public void changed()
public void onChanged(CollapsibleEvent e)
ChangeListener
onChanged
in interface ChangeListener
public void beginUpdate()
UpdateEventHandler.beginUpdate()
public void endUpdate()
UpdateEventHandler.endUpdate()
public boolean isUpdating()
UpdateEventHandler.isUpdating()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean loadFromXML(org.w3c.dom.Node node)
XMLPersistent
loadFromXML
in interface XMLPersistent
public boolean saveToXML(org.w3c.dom.Node node)
XMLPersistent
saveToXML
in interface XMLPersistent