public final class RegularSpectralCurve extends SpectralCurve
RegularSpectralCurve
is an implementation of SpectralCurve
that contains regular spectral data.
This class is immutable and therefore suitable for concurrent use without external synchronization.
Constructor and Description |
---|
RegularSpectralCurve(float lambdaMin,
float lambdaMax,
float[] spectrum)
Constructs a new
RegularSpectralCurve instance. |
Modifier and Type | Method and Description |
---|---|
float |
sample(float lambda)
Returns a sample based on the wavelength
lambda in nanometers. |
toXYZ
public RegularSpectralCurve(float lambdaMin, float lambdaMax, float[] spectrum)
RegularSpectralCurve
instance.
If spectrum
is null
, a NullPointerException
will be thrown.
The array spectrum
will be cloned.
lambdaMin
- the minimum wavelength in nanometerslambdaMax
- the maximum wavelength in nanometersspectrum
- an array with spectral datajava.lang.NullPointerException
- thrown if, and only if, spectrum
is null
public float sample(float lambda)
lambda
in nanometers.sample
in class SpectralCurve
lambda
- the wavelength in nanometerslambda
in nanometers