|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjavax.vecmath.Tuple3d
de.grogra.ray.physics.Spectrum3d
public class Spectrum3d
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.
| Field Summary |
|---|
| Fields inherited from class javax.vecmath.Tuple3d |
|---|
x, y, z |
| Constructor Summary | |
|---|---|
Spectrum3d()
|
|
Spectrum3d(double x,
double y,
double z)
|
|
| Method Summary | |
|---|---|
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 |
| Methods inherited from class javax.vecmath.Tuple3d |
|---|
absolute, absolute, add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, epsilonEquals, equals, equals, get, get, hashCode, interpolate, interpolate, max, min, negate, negate, scale, scale, scaleAdd, scaleAdd, set, set, set, set, sub, sub, toString |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface de.grogra.ray.physics.Spectrum |
|---|
get, scale, set, set |
| Constructor Detail |
|---|
public Spectrum3d()
public Spectrum3d(double x,
double y,
double z)
| Method Detail |
|---|
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).
add in interface Spectrums - the spectrum to addpublic void clampMinZero()
clampMinZero in interface Spectrumpublic Spectrum3d clone()
Spectrum
clone in interface Spectrumclone in class Tuple3dpublic 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 ArithmeticException
div in interface Spectrums - the spectrum to divide withpublic void div(Tuple3d t)
Spectrumfactor.
Note that a factor with 0 causes a ArithmeticException
div in interface Spectrumt - the divisorpublic void div(Tuple3f t)
Spectrumfactor.
Note that a factor with 0 causes a ArithmeticException
div in interface Spectrumt - the divisor
public 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.
dot in interface Spectrums - another spectrumout - result of dot product, split into three integration domainspublic double evaluateDouble(double nu)
Spectrumnu
(measured in Hz).
evaluateDouble in interface SpectrumevaluateDouble in interface DoubleToDoublenu - frequency in Hz
nupublic void get(Tuple3f out)
Spectrumcolor for this
spectrum.
get in interface Spectrumout - RGB spectrum will be placed in herepublic double getMax()
getMax in interface Spectrumpublic double integrate()
Spectrum
integrate in interface 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.
mul in interface Spectrums - the spectrum to multiply withpublic void mul(Tuple3d t)
Spectrumfactor.
mul in interface Spectrumt - the multiplicatorpublic void mul(Tuple3f t)
Spectrumfactor.
mul in interface Spectrumt - the multiplicatorpublic Spectrum3d newInstance()
Spectrum
newInstance 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).
set in interface Spectrums - another spectrumpublic void setIdentity()
Spectrum
setIdentity in interface Spectrumpublic void setZero()
Spectrum
setZero in interface 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).
sub in interface Spectrums - the spectrum to subtractpublic double sum()
Spectrum
sum in interface Spectrum
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||