Class ContinuousColorMapperTransform

java.lang.Object
org.biojava.nbio.structure.gui.util.color.ContinuousColorMapperTransform
All Implemented Interfaces:
ContinuousColorMapper
Direct Known Subclasses:
LogColorMapper, SqrtColorMapper

public abstract class ContinuousColorMapperTransform extends Object implements ContinuousColorMapper
Maps colors by performing a transform of the input data and then passing the transformed value to a ContinuousColorMapper for rendering. 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 Details

  • Constructor Details

    • ContinuousColorMapperTransform

      public ContinuousColorMapperTransform(ContinuousColorMapper submapper)
      Creates a transform.
      Parameters:
      submapper - A color mapper which acts on the transformed input value.
  • Method Details

    • getColor

      public Color getColor(double value)
      Return the color corresponding to submapper.getColor(transform(value)).
      Specified by:
      getColor in interface ContinuousColorMapper
      Parameters:
      value - Value to be mapped
      Returns:
      color corresponding to transform(value)
      See Also:
    • transform

      public abstract double transform(double value)
      An arbitrary transform over reals
      Parameters:
      the - input value
      Returns:
      the transformed value