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

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

Field Summary
 
Fields inherited from class org.biojava.bio.structure.gui.util.color.ContinuousColorMapperTransform
mapper
 
Constructor Summary
SqrtColorMapper(ContinuousColorMapper sqrtspaceMapper)
          Creates a new SqrtColorMapper.
 
Method Summary
 double transform(double value)
          Return sqrt(value).
 
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

SqrtColorMapper

public SqrtColorMapper(ContinuousColorMapper sqrtspaceMapper)
Creates a new SqrtColorMapper.

Parameters:
sqrtspaceMapper -
Method Detail

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)