Class Gradient


  • public class Gradient
    extends java.lang.Object
    A class to generate a color map from a given array of colors and the fractions that the colors represent by interpolating between their HSV values. This color map is to be used in the HeatmapTileProvider.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      int mColorMapSize
      Size of a color map for the heatmap
      int[] mColors
      The colors to be used in the gradient
      float[] mStartPoints
      The starting point for each color, given as a percentage of the maximum intensity
    • Constructor Summary

      Constructors 
      Constructor Description
      Gradient​(int[] colors, float[] startPoints)
      Creates a Gradient with the given colors and starting points.
      Gradient​(int[] colors, float[] startPoints, int colorMapSize)
      Creates a Gradient with the given colors and starting points which creates a colorMap of given size.
    • Method Summary

      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mColorMapSize

        public final int mColorMapSize
        Size of a color map for the heatmap
      • mColors

        public int[] mColors
        The colors to be used in the gradient
      • mStartPoints

        public float[] mStartPoints
        The starting point for each color, given as a percentage of the maximum intensity
    • Constructor Detail

      • Gradient

        public Gradient​(int[] colors,
                        float[] startPoints)
        Creates a Gradient with the given colors and starting points. These are given as parallel arrays.
        Parameters:
        colors - The colors to be used in the gradient
        startPoints - The starting point for each color, given as a percentage of the maximum intensity This is given as an array of floats with values in the interval [0,1]
      • Gradient

        public Gradient​(int[] colors,
                        float[] startPoints,
                        int colorMapSize)
        Creates a Gradient with the given colors and starting points which creates a colorMap of given size. The colors and starting points are given as parallel arrays.
        Parameters:
        colors - The colors to be used in the gradient
        startPoints - The starting point for each color, given as a percentage of the maximum intensity This is given as an array of floats with values in the interval [0,1]
        colorMapSize - The size of the colorMap to be generated by the Gradient