- All Superinterfaces:
DoubleToDouble
- All Known Subinterfaces:
Collector
- All Known Implementing Classes:
Collector3d
,Collector3dList
,CollectorW3d
,Spectrum3d
,Spectrum3f
This interface represents a spectrum, i.e., a function f(ν)
of frequency ν of a wave.
- Author:
- Ole Kniemeyer
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the functionspec
to this function.void
clone()
Returns a clone of this spectrum.void
Performs an componentwise division of this spectrum byspec
.void
Performs a pointwise division of this spectrum by the given RGB spectumfactor
.void
Performs a pointwise division of this spectrum by the given RGB spectumfactor
.void
Computes the scalar product of this spectrum withspec
, i.e., the integral of the pointwise product of both spectra over all frequencies.double
evaluateDouble
(double nu) Evaluates the spectrum at frequencynu
(measured in Hz).void
Computes the RGB spectrumcolor
for this spectrum.void
Computes the RGB spectrumcolor
for this spectrum.double
getMax()
double
Returns the integral over all frequencies of this spectrum.void
Performs an componentwise multiplication of this spectrum byspec
.void
Performs a pointwise multiplication of this spectrum by the given RGB spectumfactor
.void
Performs a pointwise multiplication of this spectrum by the given RGB spectumfactor
.Returns a new instance of the class of this spectrum.void
scale
(double factor) Scales this spectrum by the givenfactor
.void
Sets this spectrum tospec
.void
Sets this spectrum to the spectrum of the specified RGBcolor
.void
Sets this spectrum to the spectrum of the specified RGBcolor
.void
Sets this spectrum to the identity, i.e., its value is 1 everywhere.void
setZero()
Sets this spectrum to the zero function.void
Subtracts the functionspec
from this function.double
sum()
Computes the spectrum sum
-
Method Details
-
clone
Spectrum clone()Returns a clone of this spectrum.- Returns:
- clone of this spectrum
-
newInstance
Spectrum newInstance()Returns a new instance of the class of this spectrum. It is initialized to the zero function.- Returns:
- new instance of same class
-
evaluateDouble
double evaluateDouble(double nu) Evaluates the spectrum at frequencynu
(measured in Hz).- Specified by:
evaluateDouble
in interfaceDoubleToDouble
- Parameters:
nu
- frequency in Hz- Returns:
- function value at
nu
-
scale
void scale(double factor) Scales this spectrum by the givenfactor
.- Parameters:
factor
- scaling factor
-
setIdentity
void setIdentity()Sets this spectrum to the identity, i.e., its value is 1 everywhere. -
setZero
void setZero()Sets this spectrum to the zero function. -
integrate
double integrate()Returns the integral over all frequencies of this spectrum.- Returns:
- integrated spectrum over all frequencies
-
set
Sets this spectrum tospec
.spec
has to be compatible with this spectrum (usually this means that it has to be of the same class).- Parameters:
spec
- another spectrum
-
add
Adds the functionspec
to this function.spec
has to be compatible with this spectrum (usually this means that it has to be of the same class).- Parameters:
spec
- the spectrum to add
-
sub
Subtracts the functionspec
from this function.spec
has to be compatible with this spectrum (usually this means that it has to be of the same class).- Parameters:
spec
- the spectrum to subtract
-
clampMinZero
void clampMinZero() -
dot
Computes the scalar product of this spectrum withspec
, 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 inout.x
. The second part ranges over the green part of the spectrum and is stored inout.y
, the third part ranges over the blue part and is stored inout.z
.- Parameters:
spec
- another spectrumout
- result of dot product, split into three integration domains
-
mul
Performs an componentwise multiplication of this spectrum byspec
.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.- Parameters:
factor
- the spectrum to multiply with
-
mul
Performs a pointwise multiplication of this spectrum by the given RGB spectumfactor
.- Parameters:
factor
- the multiplicator
-
mul
Performs a pointwise multiplication of this spectrum by the given RGB spectumfactor
.- Parameters:
factor
- the multiplicator
-
div
Performs an componentwise division of this spectrum byspec
.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 ArithmeticException- Parameters:
factor
- the spectrum to divide with
-
div
Performs a pointwise division of this spectrum by the given RGB spectumfactor
. Note that a factor with 0 causes a ArithmeticException- Parameters:
factor
- the divisor
-
div
Performs a pointwise division of this spectrum by the given RGB spectumfactor
. Note that a factor with 0 causes a ArithmeticException- Parameters:
factor
- the divisor
-
set
Sets this spectrum to the spectrum of the specified RGBcolor
.- Parameters:
color
- RGB color
-
get
Computes the RGB spectrumcolor
for this spectrum.- Parameters:
color
- RGB spectrum will be placed in here
-
set
Sets this spectrum to the spectrum of the specified RGBcolor
.- Parameters:
color
- RGB color
-
get
Computes the RGB spectrumcolor
for this spectrum.- Parameters:
color
- RGB spectrum will be placed in here
-
sum
double sum()Computes the spectrum sum -
getMax
double getMax()
-