Interface IColorMap
- All Known Implementing Classes:
AbstractColorMap, ColorMapGrayscale, ColorMapHotCold, ColorMapRainbow, ColorMapRainbowNoBorder, ColorMapRBG, ColorMapRedAndGreen, ColorMapWhiteBlue, ColorMapWhiteGreen, ColorMapWhiteRed
public interface IColorMap
This interface defines the set of methods that any concrete colormap should define in order to be
used by an object implementing the
IMultiColorable interface.
The ColorMappable interface impose to an object to provide a Z-scaling, that is, a minimum and
maximum value on the Z axis. These values are used by concrete colormaps in order to set an
interval for the possible colors.- Author:
- Martin Pernollet
-
Method Summary
Modifier and TypeMethodDescriptiondoublecolorComponentAbsolute(double value, double bLeft, double bRight, double tLeft, double tRight) Defines a simple function for a color.doublecolorComponentRelative(double value, double center, double topwidth, double bottomwidth) Return the influence of a color, by comparing the input value to the color spectrum.getColor(double x, double y, double z, double zMin, double zMax) getColor(IColorMappable colorable, double v) getColor(IColorMappable colorable, double x, double y, double z) Computes the color of aIColorMappableobject according to the Z value of each of its components.booleanvoidsetDirection(boolean isStandard) Indicates if the colormap use the standard or reverted color directionvoidsetSpaceTransformer(SpaceTransformer transformer)
-
Method Details
-
getColor
-
getColor
Computes the color of aIColorMappableobject according to the Z value of each of its components.- Parameters:
colorable- Aobject.invalid reference
ColorMappablex-y-z-- Returns:
- a color for the given point.
-
getColor
- Parameters:
colorable- Aobject.invalid reference
ColorMappablev- the variable that is Color-dependent, and can be independent of the coordinates.- Returns:
- a color for the given point.
-
setDirection
void setDirection(boolean isStandard) Indicates if the colormap use the standard or reverted color direction- Parameters:
isStandard-
-
getDirection
boolean getDirection()- Returns:
- the colormap direction: true if standard, false if reverted.
-
colorComponentRelative
double colorComponentRelative(double value, double center, double topwidth, double bottomwidth) Return the influence of a color, by comparing the input value to the color spectrum. The design of a colormap implies defining the influence of each base color (red, green, and blue) over the range of input data. For this reason, the value given to this function is a number between 0 and 1, indicating the position of the input value in the colormap. Any value standing outside of colormap boundaries should have the "maximal" or "minimal" color. Exemple: A rainbow colormap is a progressive transition from blue, to green and red. The mix between these 3 colors, may be expressed by the definition of 3 functions:
In order to get the color of an input value standing between 0 and 1, the user should call:blue green red /-------\/-------\/-------\ / /\ /\ \ / / \ / \ \ / / \ / \ \ |----------------|----------------| 0 0.5 1float blue = (float) colorComponentRelative( rel_value, 0.25, 0.25, 0.75 ); float green = (float) colorComponentRelative( rel_value, 0.50, 0.25, 0.75 ); float red = (float) colorComponentRelative( rel_value, 0.75, 0.25, 0.75 ); return new Color4f( red, green, blue, 1.0f );- Parameters:
value-center-topwidth-bottomwidth-- Returns:
- color influence.
-
colorComponentAbsolute
double colorComponentAbsolute(double value, double bLeft, double bRight, double tLeft, double tRight) Defines a simple function for a color. Between bLeft and tLeft, as well as tRight and bRight, the output value is a linear interpolation between 0 and 1.tLeft tRight /-----------\ / \ / \ -------|-----------------|-------- bLeft bRight- Parameters:
value-bLeft- under this value, the color is 0bRight- up to this value, the color is 0tLeft- from this value until @link tRight, the color is 1tRight- from @link tLeft until this value, the color is 1- Returns:
- color
-
getSpaceTransformer
SpaceTransformer getSpaceTransformer() -
setSpaceTransformer
-