Class ContourPlot.SimpleColorMap

java.lang.Object
gov.nih.mipav.model.algorithms.ContourPlot.SimpleColorMap
All Implemented Interfaces:
ContourPlot.ColorMap
Enclosing class:
ContourPlot

public class ContourPlot.SimpleColorMap extends Object implements ContourPlot.ColorMap
Implementation of the ContourPlot.ColorMap interface.
Author:
hageldave
  • Field Details

    • colors

      protected int[] colors
    • locations

      protected double[] locations
  • Constructor Details

    • SimpleColorMap

      public SimpleColorMap(int[] colors, double[] locations)
      Creates a ContourPlot.SimpleColorMap with the specified colors and corresponding locations in the unit interval. As required by the ContourPlot.ColorMap interface the first location has to be 0, the last location has to 1 and the locations in between have to monotonically increase within ]0,1[.
      Parameters:
      colors - integer packed ARGB values (e.g. 0xff00ff00 is opaque green)
      locations - corresponding to colors. Within [0,1].
      Throws:
      IllegalArgumentException - if colors and locations are of different lengths, if less than 2 colors are specified, if locations does not start with 0 or does not end with 1, if locations is not sorted in ascending order.
    • SimpleColorMap

      public SimpleColorMap(int... colors)
      Creates a new ContourPlot.SimpleColorMap with the specified colors and uniform spacing.
      Parameters:
      colors - integer packed ARGB values (e.g. 0xff00ff00 is opaque green)
      Throws:
      IllegalArgumentException - when less than 2 colors are specified.
  • Method Details