Class SqrtColorMapper
java.lang.Object
org.biojava.nbio.structure.gui.util.color.ContinuousColorMapperTransform
org.biojava.nbio.structure.gui.util.color.SqrtColorMapper
- All Implemented Interfaces:
ContinuousColorMapper
Performs a sqrt transform on input before passing the values off to another
colorMapper.
For instance, to map [0^2, 10^2] to a rainbow gradient, use
new LogColorMapper(GradientMapper.getGradientMapper(GradientMapper.RAINBOW_GRADIENT, 0, 10))
- Author:
- Spencer Bliven
-
Field Summary
Fields inherited from class org.biojava.nbio.structure.gui.util.color.ContinuousColorMapperTransform
mapper
-
Constructor Summary
ConstructorDescriptionSqrtColorMapper
(ContinuousColorMapper sqrtspaceMapper) Creates a new SqrtColorMapper. -
Method Summary
Methods inherited from class org.biojava.nbio.structure.gui.util.color.ContinuousColorMapperTransform
getColor
-
Constructor Details
-
SqrtColorMapper
Creates a new SqrtColorMapper.- Parameters:
sqrtspaceMapper
-
-
-
Method Details
-
transform
public double transform(double value) Return sqrt(value). If value is negative, return the color corresponding to negative infinity.- Specified by:
transform
in classContinuousColorMapperTransform
- Parameters:
value
- Value to be mapped- Returns:
- sqrt(value), or NEGATIVE_INFINITY
- See Also:
-