public final class IrregularSpectralCurve extends SpectralCurve
IrregularSpectralCurve
is an implementation of SpectralCurve
that contains irregular spectral data.
This class is immutable and therefore suitable for concurrent use without external synchronization.
Constructor and Description |
---|
IrregularSpectralCurve(float[] amplitudes,
float[] wavelengths)
Constructs a new
IrregularSpectralCurve instance. |
Modifier and Type | Method and Description |
---|---|
float |
sample(float lambda)
Returns a sample based on the wavelength
lambda in nanometers. |
toXYZ
public IrregularSpectralCurve(float[] amplitudes, float[] wavelengths)
IrregularSpectralCurve
instance.
If either amplitudes
or wavelengths
are null
, a NullPointerException
will be thrown.
Both arrays amplitudes
and wavelengths
will be cloned.
amplitudes
- an array with amplitudeswavelengths
- an array with wavelengths in nanometersjava.lang.NullPointerException
- thrown if, and only if, either amplitudes
or wavelengths
are null
public float sample(float lambda)
lambda
in nanometers.sample
in class SpectralCurve
lambda
- the wavelength in nanometerslambda
in nanometers