public class IcyColorMapComponent extends java.lang.Object implements XMLPersistent
Modifier and Type | Class and Description |
---|---|
class |
IcyColorMapComponent.ControlPoint |
Modifier and Type | Field and Description |
---|---|
short[] |
map
we use short to store byte to avoid "sign problem"
|
float[] |
mapf
normalized maps
|
Constructor and Description |
---|
IcyColorMapComponent(IcyColorMap colorMap) |
IcyColorMapComponent(IcyColorMap colorMap,
short initValue) |
Modifier and Type | Method and Description |
---|---|
byte[] |
asByteArray()
Returns colormap content as an array of byte (length = IcyColorMap.SIZE).
|
void |
beginUpdate() |
void |
controlPointAdded(IcyColorMapComponent.ControlPoint controlPoint)
Called when a control point has been added
|
void |
controlPointChanged(IcyColorMapComponent.ControlPoint controlPoint)
Called when a control point has been modified
|
void |
controlPointRemoved(IcyColorMapComponent.ControlPoint controlPoint)
Called when a control point has been removed
|
void |
controlPointsChanged()
called when the controller modified Control Point list
|
void |
copyFrom(byte[] src)
Copy data from specified byte array
|
void |
copyFrom(IcyColorMapComponent source)
Copy data from specified source colormap band
|
void |
copyFrom(short[] src,
int shift)
Copy data from specified short array.
|
void |
endUpdate() |
boolean |
equals(java.lang.Object obj) |
IcyColorMapComponent.ControlPoint |
getControlPoint(int index)
get the control point
|
int |
getControlPointCount() |
java.util.ArrayList<IcyColorMapComponent.ControlPoint> |
getControlPoints() |
IcyColorMapComponent.ControlPoint |
getControlPointWithIndex(int index,
boolean create)
get the control point at specified index (return null if not found)
|
short |
getIntensity(int index)
Deprecated.
Use
getValue(int) instead. |
short |
getValue(int index)
Return value for specified index
|
boolean |
hasControlPointWithIndex(int index)
Return true if there is a control point at specified index
|
int |
hashCode() |
boolean |
isAllOne()
Return true is the color map band is all set to one.
|
boolean |
isAllSame()
Return true is the color map band is all set to a fixed value.
|
boolean |
isAllZero()
Return true is the color map band is all set to zero.
|
boolean |
isLinear()
Return true is the color map band is a linear one.
|
boolean |
isRawData()
returns true when the LUT is specified by raw data (for example GIF files),
false when the LUT is specified by control points.
|
boolean |
isUpdating() |
boolean |
loadFromXML(org.w3c.dom.Node node)
LOAD
|
void |
mapDataChanged()
called when the controller directly modified the map (int) data
|
void |
mapFDataChanged()
called when the controller directly modified the map (float) data
|
void |
onControlPointsChanged()
common process on Control Point list change
|
void |
onMapDataChanged()
common process on map (int) data change
|
void |
onMapFDataChanged()
common process on map (float) data change
|
void |
removeAllControlPoint()
Remove all control point
|
void |
removeControlPoint(IcyColorMapComponent.ControlPoint controlPoint)
Remove the specified control point
|
boolean |
saveToXML(org.w3c.dom.Node node)
SAVE
|
IcyColorMapComponent.ControlPoint |
setControlPoint(int index,
float value)
Set a control point to specified index and value (normalized)
|
IcyColorMapComponent.ControlPoint |
setControlPoint(int index,
int value)
Set a control point to specified index and value
|
void |
setNormalizedValue(int index,
float value)
Set direct intensity (normalized) value to specified index
|
void |
setValue(int index,
int value)
Set direct intensity value to specified index
|
public final short[] map
public final float[] mapf
public IcyColorMapComponent(IcyColorMap colorMap, short initValue)
public IcyColorMapComponent(IcyColorMap colorMap)
public int getControlPointCount()
public java.util.ArrayList<IcyColorMapComponent.ControlPoint> getControlPoints()
public IcyColorMapComponent.ControlPoint getControlPoint(int index)
public IcyColorMapComponent.ControlPoint getControlPointWithIndex(int index, boolean create)
public boolean hasControlPointWithIndex(int index)
public IcyColorMapComponent.ControlPoint setControlPoint(int index, float value)
public IcyColorMapComponent.ControlPoint setControlPoint(int index, int value)
public void removeControlPoint(IcyColorMapComponent.ControlPoint controlPoint)
controlPoint
- public void removeAllControlPoint()
public void copyFrom(IcyColorMapComponent source)
public void copyFrom(byte[] src)
public void copyFrom(short[] src, int shift)
src
- data short arrayshift
- shift factor if value need to be shifted (8 if data are short formatted)public byte[] asByteArray()
public short getValue(int index)
@Deprecated public short getIntensity(int index)
getValue(int)
instead.public void setValue(int index, int value)
public void setNormalizedValue(int index, float value)
public boolean isAllSame()
public boolean isAllZero()
public boolean isAllOne()
public boolean isLinear()
public void controlPointChanged(IcyColorMapComponent.ControlPoint controlPoint)
controlPoint
- modified control pointpublic void controlPointAdded(IcyColorMapComponent.ControlPoint controlPoint)
controlPoint
- added control pointpublic void controlPointRemoved(IcyColorMapComponent.ControlPoint controlPoint)
controlPoint
- removed control pointpublic void onControlPointsChanged()
public void onMapDataChanged()
public void onMapFDataChanged()
public void controlPointsChanged()
public void mapDataChanged()
public void mapFDataChanged()
public void beginUpdate()
public void endUpdate()
public boolean isUpdating()
public boolean isRawData()
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
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object