public abstract class AbstractColorMap extends Object implements IColorMap
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
direction |
| Constructor and Description |
|---|
AbstractColorMap() |
| 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.
|
double |
colorComponentRelativeNoLeftBorder(double value,
double center,
double topwidth,
double bottomwidth) |
double |
colorComponentRelativeNoRightBorder(double value,
double center,
double topwidth,
double bottomwidth) |
abstract Color |
getColor(double x,
double y,
double z,
double zMin,
double zMax) |
Color |
getColor(IColorMappable colorable,
double z) |
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() |
protected double |
processRelativeZValue(double z,
double zMin,
double zMax) |
void |
setDirection(boolean isStandard)
Indicates if the colormap use the standard or reverted color direction
|
public abstract Color getColor(double x, double y, double z, double zMin, double zMax)
public void setDirection(boolean isStandard)
IColorMapsetDirection in interface IColorMappublic boolean getDirection()
getDirection in interface IColorMappublic Color getColor(IColorMappable colorable, double x, double y, double z)
IColorMapIColorMappable object according to the Z value of each
of its components.protected double processRelativeZValue(double z,
double zMin,
double zMax)
public Color getColor(IColorMappable colorable, double z)
public double colorComponentRelative(double value,
double center,
double topwidth,
double bottomwidth)
IColorMap
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 );
colorComponentRelative in interface IColorMappublic double colorComponentRelativeNoLeftBorder(double value,
double center,
double topwidth,
double bottomwidth)
public double colorComponentRelativeNoRightBorder(double value,
double center,
double topwidth,
double bottomwidth)
public double colorComponentAbsolute(double value,
double bLeft,
double bRight,
double tLeft,
double tRight)
IColorMap
tLeft tRight
/-----------\
/ \
/ \
-------|-----------------|--------
bLeft bRight
colorComponentAbsolute in interface IColorMapbLeft - 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.