Package org.sunflow.image
Class SpectralCurve
- java.lang.Object
-
- org.sunflow.image.SpectralCurve
-
- Direct Known Subclasses:
BlackbodySpectrum
,ChromaticitySpectrum
,ConstantSpectralCurve
,IrregularSpectralCurve
,RegularSpectralCurve
public abstract class SpectralCurve extends java.lang.Object
This class is an abstract interface to sampled or analytic spectral data.
-
-
Field Summary
Fields Modifier and Type Field Description private static double[]
CIE_xbar
private static double[]
CIE_ybar
private static double[]
CIE_zbar
private static int
WAVELENGTH_MAX
private static int
WAVELENGTH_MIN
private static int
WAVELENGTH_STEP
-
Constructor Summary
Constructors Constructor Description SpectralCurve()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract float
sample(float lambda)
This function determines the actual spectral curve data.XYZColor
toXYZ()
Convert this curve to a tristimulus CIE XYZ color by integrating against the CIE color matching functions.
-
-
-
Field Detail
-
WAVELENGTH_MIN
private static final int WAVELENGTH_MIN
- See Also:
- Constant Field Values
-
WAVELENGTH_MAX
private static final int WAVELENGTH_MAX
- See Also:
- Constant Field Values
-
CIE_xbar
private static final double[] CIE_xbar
-
CIE_ybar
private static final double[] CIE_ybar
-
CIE_zbar
private static final double[] CIE_zbar
-
WAVELENGTH_STEP
private static final int WAVELENGTH_STEP
-
-
Method Detail
-
sample
public abstract float sample(float lambda)
This function determines the actual spectral curve data. Note that the lambda parameter is assumed to be in nanometers.- Parameters:
lambda
- wavelength to sample in nanometers- Returns:
- the value of the spectral curve at this point
-
toXYZ
public final XYZColor toXYZ()
Convert this curve to a tristimulus CIE XYZ color by integrating against the CIE color matching functions.- Returns:
- XYZColor that represents this spectra
-
-