org.biojava.bio.structure.gui.util.color
Class SqrtColorMapper
java.lang.Object
org.biojava.bio.structure.gui.util.color.ContinuousColorMapperTransform
org.biojava.bio.structure.gui.util.color.SqrtColorMapper
- All Implemented Interfaces:
- ContinuousColorMapper
public class SqrtColorMapper
- extends ContinuousColorMapperTransform
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
Method Summary |
double |
transform(double value)
Return sqrt(value). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SqrtColorMapper
public SqrtColorMapper(ContinuousColorMapper sqrtspaceMapper)
- Creates a new SqrtColorMapper.
- Parameters:
sqrtspaceMapper
-
transform
public double transform(double value)
- Return sqrt(value).
If value is negative, return the color corresponding to negative infinity.
- Specified by:
transform
in class ContinuousColorMapperTransform
- Parameters:
value
- Value to be mapped
- Returns:
- sqrt(value), or NEGATIVE_INFINITY
- See Also:
ContinuousColorMapper.getColor(double)