public interface IColorMap
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.Modifier and Type | Method and Description |
---|---|
double |
colorComponentAbsolute(double value,
double bLeft,
double bRight,
double tLeft,
double tRight)
Defines a simple function for a color.
|
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.
|
Color |
getColor(IColorMappable colorable,
double v) |
Color |
getColor(IColorMappable colorable,
double x,
double y,
double z)
Computes the color of a
IColorMappable object according to the Z value of each
of its components. |
boolean |
getDirection() |
void |
setDirection(boolean isStandard)
Indicates if the colormap use the standard or reverted color direction
|
Color getColor(IColorMappable colorable, double x, double y, double z)
IColorMappable
object according to the Z value of each
of its components.colorable
- A ColorMappable
object.x
- y
- z
- Color getColor(IColorMappable colorable, double v)
colorable
- A ColorMappable
object.v
- the variable that is Color-dependent, and can be independent of the coordinates.void setDirection(boolean isStandard)
isStandard
- boolean getDirection()
double colorComponentRelative(double value, double center, double topwidth, double bottomwidth)
blue green red
/-------\/-------\/-------\
/ /\ /\ \
/ / \ / \ \
/ / \ / \ \
|----------------|----------------|
0 0.5 1
In order to get the color of an input value standing between 0 and 1, the user
should call:
float 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 );
value
- center
- topwidth
- bottomwidth
- double colorComponentAbsolute(double value, double bLeft, double bRight, double tLeft, double tRight)
tLeft tRight
/-----------\
/ \
/ \
-------|-----------------|--------
bLeft bRight
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 1Copyright © 2016. All rights reserved.