de.grogra.ray.physics
public class Spectrum3d extends Tuple3d implements Spectrum
double values which are interpreted as the red,
green and blue part of the spectrum. Specta of this class are
compatible with each other and with spectra
of class Spectrum3f.| Constructor and Description |
|---|
Spectrum3d() |
Spectrum3d(double x,
double y,
double z) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Spectrum s)
Adds the function
spec to this function. |
void |
clampMinZero() |
Spectrum3d |
clone()
Returns a clone of this spectrum.
|
void |
div(Spectrum s)
Performs an componentwise division of this spectrum
by
spec. |
void |
div(Tuple3d t)
Performs a pointwise division of this spectrum
by the given RGB spectum
factor. |
void |
div(Tuple3f t)
Performs a pointwise division of this spectrum
by the given RGB spectum
factor. |
void |
dot(Spectrum s,
Tuple3d out)
Computes the scalar product of this spectrum with
spec,
i.e., the integral of the pointwise product of both spectra over all
frequencies. |
double |
evaluateDouble(double nu)
Evaluates the spectrum at frequency
nu
(measured in Hz). |
void |
get(Tuple3f out)
Computes the RGB spectrum
color for this
spectrum. |
double |
getMax() |
double |
integrate()
Returns the integral over all frequencies of this
spectrum.
|
void |
mul(Spectrum s)
Performs an componentwise multiplication of this spectrum
by
spec. |
void |
mul(Tuple3d t)
Performs a pointwise multiplication of this spectrum
by the given RGB spectum
factor. |
void |
mul(Tuple3f t)
Performs a pointwise multiplication of this spectrum
by the given RGB spectum
factor. |
Spectrum3d |
newInstance()
Returns a new instance of the class of this spectrum.
|
void |
set(Spectrum s)
Sets this spectrum to
spec. |
void |
setIdentity()
Sets this spectrum to the identity, i.e., its value
is 1 everywhere.
|
void |
setZero()
Sets this spectrum to the zero function.
|
void |
sub(Spectrum s)
Subtracts the function
spec from this function. |
double |
sum()
Computes the spectrum sum
|
absolute, absolute, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, epsilonEquals, equals, equals, get, get, get, hashCode, interpolate, interpolate, max, min, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, sub, sub, toStringpublic Spectrum3d()
public Spectrum3d(double x,
double y,
double z)
public void add(Spectrum s)
Spectrumspec to this function.
spec has to
be compatible with this spectrum (usually this means that it has
to be of the same class).public void clampMinZero()
clampMinZero in interface Spectrumpublic Spectrum3d clone()
Spectrumpublic void div(Spectrum s)
Spectrumspec. spec has to
be compatible with this spectrum (usually this means that it has
to be of the same class). The result of each component is stored
in this spectrum.
Note that a factor with 0 causes a ArithmeticExceptionpublic void div(Tuple3d t)
Spectrumfactor.
Note that a factor with 0 causes a ArithmeticExceptionpublic void div(Tuple3f t)
Spectrumfactor.
Note that a factor with 0 causes a ArithmeticExceptionpublic void dot(Spectrum s, Tuple3d out)
Spectrumspec,
i.e., the integral of the pointwise product of both spectra over all
frequencies. The integration is split into three parts: The first part
ranges over the red part of the spectrum, its result is stored in
out.x. The second part ranges over the green part of the
spectrum and is stored in out.y, the third part ranges
over the blue part and is stored in out.z.public double evaluateDouble(double nu)
Spectrumnu
(measured in Hz).evaluateDouble in interface SpectrumevaluateDouble in interface DoubleToDoublenu - frequency in Hznupublic void get(Tuple3f out)
Spectrumcolor for this
spectrum.public double integrate()
Spectrumpublic void mul(Spectrum s)
Spectrumspec. spec has to
be compatible with this spectrum (usually this means that it has
to be of the same class). The result of each component is stored
in this spectrum.public void mul(Tuple3d t)
Spectrumfactor.public void mul(Tuple3f t)
Spectrumfactor.public Spectrum3d newInstance()
SpectrumnewInstance in interface Spectrumpublic void set(Spectrum s)
Spectrumspec. spec has to
be compatible with this spectrum (usually this means that it has
to be of the same class).public void setIdentity()
SpectrumsetIdentity in interface Spectrumpublic void setZero()
Spectrumpublic void sub(Spectrum s)
Spectrumspec from this function.
spec has to
be compatible with this spectrum (usually this means that it has
to be of the same class).