org.biojava.bio.structure.gui.util.color
Class LogColorMapper
java.lang.Object
org.biojava.bio.structure.gui.util.color.ContinuousColorMapperTransform
org.biojava.bio.structure.gui.util.color.LogColorMapper
- All Implemented Interfaces:
- ContinuousColorMapper
public class LogColorMapper
- extends ContinuousColorMapperTransform
Performs a log10 transform on input before passing the values off to another
colorMapper.
For instance, to map [10^0, 10^10] to a rainbow gradient, use
new LogColorMapper(GradientMapper.getGradientMapper(GradientMapper.RAINBOW_GRADIENT, 0, 10))
- Author:
- Spencer Bliven
Method Summary |
double |
transform(double value)
Apply log transform. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LogColorMapper
public LogColorMapper(ContinuousColorMapper logspaceMapper)
- Creates a new LogColorMapper with base 10.
- Parameters:
logspaceMapper
-
LogColorMapper
public LogColorMapper(ContinuousColorMapper logspaceMapper,
int base)
- If logspaceMapper maps values x1 to x2, this creates a
mapper for values base^x1 to base^x2
- Parameters:
logspaceMapper
- logspace mapperbase
- The base of the logorithm
transform
public double transform(double value)
- Apply log transform.
- Specified by:
transform
in class ContinuousColorMapperTransform
- Parameters:
value
-
- Returns:
- log_b(value)
- See Also:
ContinuousColorMapperTransform.transform(double)