org.biojava.bio.structure.gui.util.color
Class LogColorMapper

java.lang.Object
  extended by org.biojava.bio.structure.gui.util.color.ContinuousColorMapperTransform
      extended by 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

Field Summary
 
Fields inherited from class org.biojava.bio.structure.gui.util.color.ContinuousColorMapperTransform
mapper
 
Constructor Summary
LogColorMapper(ContinuousColorMapper logspaceMapper)
          Creates a new LogColorMapper with base 10.
LogColorMapper(ContinuousColorMapper logspaceMapper, int base)
          If logspaceMapper maps values x1 to x2, this creates a mapper for values base^x1 to base^x2
 
Method Summary
 double transform(double value)
          Apply log transform.
 
Methods inherited from class org.biojava.bio.structure.gui.util.color.ContinuousColorMapperTransform
getColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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 mapper
base - The base of the logorithm
Method Detail

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)