Package org.opensourcephysics.display2d
Class ComplexColorMapper
java.lang.Object
org.opensourcephysics.display2d.ComplexColorMapper
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncomplexToColor(double re, double im) Converts a complex number to hue, saturation, and brightness.doublegetCeil()Gets the ceiling color.Gets the ceiling color.phaseToColor(double phi) Converts a phase angle in the range [-Pi,Pi] to hue, saturation, and brightness.pointToColor(double[] vertex) Converts a vertex point array of samples to hue, saturation, and brightness.samplesToColor(double[] samples) Converts an array of samples to hue, saturation, and brightness.byte[]sampleToPixel(double[] samples, byte[] retRGB) Return a pixel in the standard rgba format of raster.getPixel.voidsetCeilColor(Color _ceilColor) Sets the ceiling.voidsetScale(double _ceil) Sets the z scale.voidsetZMap(ZExpansion map) Sets map for z values.Shows the phase legend.static JFrame
-
Field Details
-
zMap
-
-
Constructor Details
-
ComplexColorMapper
public ComplexColorMapper(double _ceil) Constructor ComplexColorMapper- Parameters:
_ceil-
-
-
Method Details
-
showPhaseLegend
-
showLegend
Shows the phase legend. -
setScale
public void setScale(double _ceil) Sets the z scale.- Parameters:
_ceil-
-
phaseToColor
Converts a phase angle in the range [-Pi,Pi] to hue, saturation, and brightness.- Parameters:
phi- phase angle- Returns:
- the HSB color
-
complexToColor
Converts a complex number to hue, saturation, and brightness.- Parameters:
re-im-- Returns:
- the HSB color
-
samplesToColor
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
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
Sets map for z values.- Parameters:
map- ZExpansion
-
getCeil
public double getCeil()Gets the ceiling color.- Returns:
-
getCeilColor
Gets the ceiling color.- Returns:
-
setCeilColor
Sets the ceiling.- Parameters:
_ceilColor-
-