- 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 TypeMethodDescriptionvoidAdds the functionspecto this function.voidclone()Returns a clone of this spectrum.voidPerforms an componentwise division of this spectrum byspec.voidPerforms a pointwise division of this spectrum by the given RGB spectumfactor.voidPerforms a pointwise division of this spectrum by the given RGB spectumfactor.voidComputes the scalar product of this spectrum withspec, i.e., the integral of the pointwise product of both spectra over all frequencies.doubleevaluateDouble(double nu) Evaluates the spectrum at frequencynu(measured in Hz).voidComputes the RGB spectrumcolorfor this spectrum.voidComputes the RGB spectrumcolorfor this spectrum.doublegetMax()doubleReturns the integral over all frequencies of this spectrum.voidPerforms an componentwise multiplication of this spectrum byspec.voidPerforms a pointwise multiplication of this spectrum by the given RGB spectumfactor.voidPerforms a pointwise multiplication of this spectrum by the given RGB spectumfactor.Returns a new instance of the class of this spectrum.voidscale(double factor) Scales this spectrum by the givenfactor.voidSets this spectrum tospec.voidSets this spectrum to the spectrum of the specified RGBcolor.voidSets this spectrum to the spectrum of the specified RGBcolor.voidSets this spectrum to the identity, i.e., its value is 1 everywhere.voidsetZero()Sets this spectrum to the zero function.voidSubtracts the functionspecfrom this function.doublesum()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:
evaluateDoublein 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.spechas 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 functionspecto this function.spechas 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 functionspecfrom this function.spechas 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.spechas 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.spechas 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 spectrumcolorfor 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 spectrumcolorfor this spectrum.- Parameters:
color- RGB spectrum will be placed in here
-
sum
double sum()Computes the spectrum sum -
getMax
double getMax()
-