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 Summary
-
Constructor Summary
ConstructorDescriptionCreates a transform. -
Method Summary
-
Field Details
-
mapper
-
-
Constructor Details
-
ContinuousColorMapperTransform
Creates a transform.- Parameters:
submapper
- A color mapper which acts on the transformed input value.
-
-
Method Details
-
getColor
Return the color corresponding to submapper.getColor(transform(value)).- Specified by:
getColor
in interfaceContinuousColorMapper
- 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
-