Class ComplexColorMapper

java.lang.Object
org.opensourcephysics.display2d.ComplexColorMapper

public class ComplexColorMapper extends Object
  • Field Details

  • Constructor Details

    • ComplexColorMapper

      public ComplexColorMapper(double _ceil)
      Constructor ComplexColorMapper
      Parameters:
      _ceil -
  • Method Details

    • showPhaseLegend

      public static JFrame showPhaseLegend()
    • showLegend

      public JFrame showLegend()
      Shows the phase legend.
    • setScale

      public void setScale(double _ceil)
      Sets the z scale.
      Parameters:
      _ceil -
    • phaseToColor

      public Color phaseToColor(double phi)
      Converts a phase angle in the range [-Pi,Pi] to hue, saturation, and brightness.
      Parameters:
      phi - phase angle
      Returns:
      the HSB color
    • complexToColor

      public Color complexToColor(double re, double im)
      Converts a complex number to hue, saturation, and brightness.
      Parameters:
      re -
      im -
      Returns:
      the HSB color
    • samplesToColor

      public Color samplesToColor(double[] samples)
      Converts an array of samples to hue, saturation, and brightness. Samples contains magnitude, re, and im.
      Parameters:
      samples -
      Returns:
      the HSB color
    • sampleToPixel

      public byte[] sampleToPixel(double[] samples, byte[] retRGB)
      Return a pixel in the standard rgba format of raster.getPixel.
      Parameters:
      samples -
      retRGB - temp array to be returned
      Returns:
      byte[] in the form of filling [r g b a]
    • pointToColor

      public Color pointToColor(double[] vertex)
      Converts a vertex point array of samples to hue, saturation, and brightness. A vertex containing x, y, magnitude, re, and im.
      Parameters:
      vertex - the point
      Returns:
      the HSB color
    • setZMap

      public void setZMap(ZExpansion map)
      Sets map for z values.
      Parameters:
      map - ZExpansion
    • getCeil

      public double getCeil()
      Gets the ceiling color.
      Returns:
    • getCeilColor

      public Color getCeilColor()
      Gets the ceiling color.
      Returns:
    • setCeilColor

      public void setCeilColor(Color _ceilColor)
      Sets the ceiling.
      Parameters:
      _ceilColor -