Package gov.nih.mipav.model.algorithms
Enum ContourPlot.DefaultColorMap
- java.lang.Object
-
- java.lang.Enum<ContourPlot.DefaultColorMap>
-
- gov.nih.mipav.model.algorithms.ContourPlot.DefaultColorMap
-
- All Implemented Interfaces:
ContourPlot.ColorMap
,java.io.Serializable
,java.lang.Comparable<ContourPlot.DefaultColorMap>
- Enclosing class:
- ContourPlot
public static enum ContourPlot.DefaultColorMap extends java.lang.Enum<ContourPlot.DefaultColorMap> implements ContourPlot.ColorMap
-
-
Enum Constant Summary
Enum Constants Enum Constant Description D_COOL_WARM
S_COPPER
-
Field Summary
Fields Modifier and Type Field Description (package private) ContourPlot.ColorMap
map
-
Constructor Summary
Constructors Modifier Constructor Description private
DefaultColorMap(int... colors)
private
DefaultColorMap(int[] colors, double[] locations)
private
DefaultColorMap(ContourPlot.ColorMap map)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getColor(int index)
Returns the ith colorint[]
getColors()
double
getLocation(int index)
Returns the location of the ith color within the unit interval.double[]
getLocations()
int
numColors()
static ContourPlot.DefaultColorMap
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ContourPlot.DefaultColorMap[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
-
Methods inherited from interface gov.nih.mipav.model.algorithms.ContourPlot.ColorMap
copy, interpolate, resample
-
-
-
-
Enum Constant Detail
-
S_COPPER
public static final ContourPlot.DefaultColorMap S_COPPER
-
D_COOL_WARM
public static final ContourPlot.DefaultColorMap D_COOL_WARM
-
-
Field Detail
-
map
final ContourPlot.ColorMap map
-
-
Constructor Detail
-
DefaultColorMap
private DefaultColorMap(int[] colors, double[] locations)
-
DefaultColorMap
private DefaultColorMap(int... colors)
-
DefaultColorMap
private DefaultColorMap(ContourPlot.ColorMap map)
-
-
Method Detail
-
values
public static ContourPlot.DefaultColorMap[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ContourPlot.DefaultColorMap c : ContourPlot.DefaultColorMap.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ContourPlot.DefaultColorMap valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
numColors
public int numColors()
- Specified by:
numColors
in interfaceContourPlot.ColorMap
- Returns:
- the number of discrete colors in this
ContourPlot.ColorMap
-
getColor
public int getColor(int index)
Description copied from interface:ContourPlot.ColorMap
Returns the ith color- Specified by:
getColor
in interfaceContourPlot.ColorMap
- Parameters:
index
- index of the color- Returns:
- ith color in integer packed ARGB format (0xff00ff00 is opaque green)
-
getColors
public int[] getColors()
- Specified by:
getColors
in interfaceContourPlot.ColorMap
- Returns:
- all discrete colors in this
ContourPlot.ColorMap
in integer packed ARGB format (0xff00ff00 is opaque green)
-
getLocation
public double getLocation(int index)
Description copied from interface:ContourPlot.ColorMap
Returns the location of the ith color within the unit interval.- Specified by:
getLocation
in interfaceContourPlot.ColorMap
- Parameters:
index
- index of the location/color- Returns:
- location within [0,1]
-
getLocations
public double[] getLocations()
- Specified by:
getLocations
in interfaceContourPlot.ColorMap
- Returns:
- all locations of the discrete colors in this
ContourPlot.ColorMap
-
-