|
Ray Tracer Common Project
Image rendering program based on the ray tracing technique.
|
#include <photon.hpp>
Public Member Functions | |
| photon () | |
| Create a new null photon (with no energy). | |
| photon (const photon &) | |
| Copy constructor. | |
| photon (const rt::color &clr, double e=1.0) | |
| Create a photon from a color. More... | |
| photon (double r, double g, double b, double e=1.0) | |
| Create a photon from color components. More... | |
| const rt::color & | color () const |
| Photon color. | |
| double | energy () const |
| Photon energy. More... | |
| void | operator+= (const photon &) |
| Additive synthesys with another photon. | |
| photon | operator+ (const photon &) const |
| Additive synthesys with another photon. More... | |
| void | operator*= (const rt::color &) |
| Make a color absorb a photon. | |
| photon | operator* (const rt::color &) const |
| Make a color absorb a photon. More... | |
| void | operator*= (double f) |
| Multiply the photon energy. More... | |
| photon | operator* (double f) const |
| Multiply the photon energy. More... | |
| operator bool () const | |
| Boolean convertion. More... | |
Light photon class.
A photon represent a light particle with a color and an energy. This class provides some basic operation for photon manipulations sush as additive synthese (operator+) with another photon and absorbtion (operator*) with a color.
| rt::photon::photon | ( | const rt::color & | clr, |
| double | e = 1.0 |
||
| ) |
Create a photon from a color.
| clr | A RGB color |
| rt::photon::photon | ( | double | r, |
| double | g, | ||
| double | b, | ||
| double | e = 1.0 |
||
| ) |
Create a photon from color components.
| r | Red component. |
| g | Green component. |
| b | Blue component. |
| double rt::photon::energy | ( | ) | const |
Photon energy.
\[ p_{energy} = max(p_{red}, p_{green}, p_{blue}) \]
| rt::photon::operator bool | ( | ) | const |
Boolean convertion.
Make a color absorb a photon.
| photon rt::photon::operator* | ( | double | f | ) | const |
Multiply the photon energy.
| f | energy factor |
| void rt::photon::operator*= | ( | double | f | ) |
Multiply the photon energy.
| f | energy factor. |
Additive synthesys with another photon.
1.8.15