java.lang.Object
javax.vecmath.Tuple3d
de.grogra.ray.physics.Spectrum3d
- All Implemented Interfaces:
Spectrum,DoubleToDouble,Serializable,Cloneable
- Direct Known Subclasses:
Collector3d,CollectorW3d
This class implements a spectrum which is represented by three
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.- Author:
- Ole Kniemeyer
- See Also:
-
Field Summary
-
Constructor Summary
Constructors -
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.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.voidSets this spectrum tospec.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 sumMethods inherited from class javax.vecmath.Tuple3d
absolute, absolute, add, add, clamp, clamp, clamp, clamp, clampMax, clampMax, clampMax, clampMax, clampMin, clampMin, clampMin, clampMin, epsilonEquals, equals, equals, get, get, get, hashCode, interpolate, interpolate, interpolate, interpolate, max, min, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, sub, sub, toString
-
Constructor Details
-
Spectrum3d
public Spectrum3d() -
Spectrum3d
public Spectrum3d(double x, double y, double z)
-
-
Method Details
-
clampMinZero
public void clampMinZero()- Specified by:
clampMinZeroin interfaceSpectrum
-
evaluateDouble
public double evaluateDouble(double nu) Description copied from interface:SpectrumEvaluates the spectrum at frequencynu(measured in Hz).- Specified by:
evaluateDoublein interfaceDoubleToDouble- Specified by:
evaluateDoublein interfaceSpectrum- Parameters:
nu- frequency in Hz- Returns:
- function value at
nu
-
setZero
public void setZero()Description copied from interface:SpectrumSets this spectrum to the zero function. -
setIdentity
public void setIdentity()Description copied from interface:SpectrumSets this spectrum to the identity, i.e., its value is 1 everywhere.- Specified by:
setIdentityin interfaceSpectrum
-
clone
Description copied from interface:SpectrumReturns a clone of this spectrum. -
newInstance
Description copied from interface:SpectrumReturns a new instance of the class of this spectrum. It is initialized to the zero function.- Specified by:
newInstancein interfaceSpectrum- Returns:
- new instance of same class
-
add
Description copied from interface:SpectrumAdds the functionspecto this function.spechas to be compatible with this spectrum (usually this means that it has to be of the same class). -
sub
Description copied from interface:SpectrumSubtracts the functionspecfrom this function.spechas to be compatible with this spectrum (usually this means that it has to be of the same class). -
dot
Description copied from interface:SpectrumComputes 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. -
mul
Description copied from interface:SpectrumPerforms 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. -
mul
Description copied from interface:SpectrumPerforms a pointwise multiplication of this spectrum by the given RGB spectumfactor. -
mul
Description copied from interface:SpectrumPerforms a pointwise multiplication of this spectrum by the given RGB spectumfactor. -
div
Description copied from interface:SpectrumPerforms 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 -
div
Description copied from interface:SpectrumPerforms a pointwise division of this spectrum by the given RGB spectumfactor. Note that a factor with 0 causes a ArithmeticException -
div
Description copied from interface:SpectrumPerforms a pointwise division of this spectrum by the given RGB spectumfactor. Note that a factor with 0 causes a ArithmeticException -
get
Description copied from interface:SpectrumComputes the RGB spectrumcolorfor this spectrum. -
integrate
public double integrate()Description copied from interface:SpectrumReturns the integral over all frequencies of this spectrum. -
set
Description copied from interface:SpectrumSets this spectrum tospec.spechas to be compatible with this spectrum (usually this means that it has to be of the same class). -
sum
public double sum()Description copied from interface:SpectrumComputes the spectrum sum -
getMax
public double getMax()
-