public class BaseColorControl extends Control
Modifier and Type | Field and Description |
---|---|
static int |
ALPHA
The index of the alpha channel.
|
static int |
BLUE
The index of the color blue
|
static int |
DEFAULT_NUMBER_OF_COLORS
The default number of colors
|
static int |
GREEN
The index of the color green
|
static int |
RED
The index of the color red
|
Constructor and Description |
---|
BaseColorControl(DisplayImpl d,
int components)
Create a basic color control.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone() |
boolean |
equals(Object o)
Return
true if this object is "equal" to the parameter. |
Function |
getFunction()
Return the color lookup
Function . |
int |
getNumberOfColors()
Get the number of colors in the table.
|
int |
getNumberOfComponents()
Get the number of components of the range.
|
String |
getSaveString()
If the colors are defined using a color table, get a
String that can be used to reconstruct this
object later. |
float[][] |
getTable()
Get the table of colors.
|
void |
initGreyWedge()
Initialize the colormap to a grey wedge
|
void |
initGreyWedge(boolean invert) |
void |
initHSV()
Initialize the colormap to Hue-Saturation-Value
|
static float[][] |
initTableGreyWedge(float[][] table)
Initialize table to a grey wedge.
|
static float[][] |
initTableGreyWedge(float[][] table,
boolean invert) |
static float[][] |
initTableHSV(float[][] table)
Initialize table to the Hue-Saturation-Value colormap.
|
static float[][] |
initTableVis5D(float[][] table)
Initialize table to the Vis5D colormap (opaque
blue-green-red rainbow).
|
void |
initVis5D()
Initialize the colormap to the VisAD sine waves
|
float[][] |
lookupRange(int left,
int right)
Return a list of colors for the specified range.
|
float[][] |
lookupValues(float[] values)
Return a list of colors for specified values.
|
void |
setFunction(Function func)
Define the color lookup by a
Function , whose
MathType must have a 1-D domain and a 3-D or
4-D RealTupleType range; the domain and range
Real s must vary over the range (0.0, 1.0) |
void |
setRange(int left,
int right,
float[][] colors)
Set the specified range to the specified colors.
|
void |
setSaveString(String save)
Reconstruct this control using the specified save string.
|
void |
setTable(float[][] t)
Define the color lookup by an array of
float s
which must have the form float[components][table_length] ;
values should be in the range (0.0, 1.0) |
void |
syncControl(Control rmt)
Copy the state of a remote control to this control.
|
String |
toString() |
addControlListener, animation_string, changeControl, checkTicks, getDisplay, getDisplayRenderer, getInstanceNumber, incTick, nullControl, peekTicks, removeControlListener, resetTicks, setTicks, subCheckTicks, subPeekTicks, subResetTicks, subSetTicks
public static final int RED
public static final int GREEN
public static final int BLUE
public static final int ALPHA
NOTE: ALPHA will always be the last index.
public static final int DEFAULT_NUMBER_OF_COLORS
public BaseColorControl(DisplayImpl d, int components)
d
- The display with which this control is associated.components
- Either 3 (if this is a red/green/blue control)
or 4 (if there is also an alpha component).public static float[][] initTableGreyWedge(float[][] table)
table
- Table to be initialized.public static float[][] initTableGreyWedge(float[][] table, boolean invert)
public void initGreyWedge()
public void initGreyWedge(boolean invert)
public static float[][] initTableVis5D(float[][] table)
table
- Table to be initialized.public void initVis5D()
public static float[][] initTableHSV(float[][] table)
table
- Table to be initialized.public void initHSV()
public int getNumberOfComponents()
public int getNumberOfColors()
public void setFunction(Function func) throws RemoteException, VisADException
Function
, whose
MathType
must have a 1-D domain and a 3-D or
4-D RealTupleType
range; the domain and range
Real
s must vary over the range (0.0, 1.0)func
- The new Function
.RemoteException
- If there was an RMI-related problem.VisADException
- If there was a problem with the function.public Function getFunction()
Function
.public void setTable(float[][] t) throws RemoteException, VisADException
float
s
which must have the form float[components][table_length]
;
values should be in the range (0.0, 1.0)t
- The new table of colors.RemoteException
- If there was a problem changing the control.VisADException
- If there is a problem with the table.public float[][] getTable()
public String getSaveString()
String
that can be used to reconstruct this
object later. If the colors are defined using a
Function
, return null.getSaveString
in class Control
public void setSaveString(String save) throws RemoteException, VisADException
setSaveString
in class Control
save
- The save string.VisADException
- If the save string is not valid.RemoteException
- If there was a problem setting the table.public float[][] lookupValues(float[] values) throws RemoteException, VisADException
values
- The values to look up. It is expected that
they nominally lie in the range of 0 through 1.
Values outside this range will be assigned the
color of the nearest end. NaN values will be
assigned NaN colors.[i][j]
is the value of the i
-th color
component for values[j]
, where
i
is RED
, GREEN
,
BLUE
, or ALPHA
. A component
value is in the range from 0 through 1, or is
NaN.RemoteException
- If there was an RMI-related problem.VisADException
- If the function encountered a problem.public float[][] lookupRange(int left, int right) throws VisADException, RemoteException
VisADException
RemoteException
public void setRange(int left, int right, float[][] colors) throws VisADException, RemoteException
VisADException
RemoteException
public void syncControl(Control rmt) throws VisADException
syncControl
in class Control
rmt
- The control to be copied.VisADException
- If the remote control cannot be copied.public boolean equals(Object o)
true
if this object is "equal" to the parameter.Copyright © 1996–2023 The SSEC Visualization Project. All rights reserved.