|
Ray Tracer Common Project
Image rendering program based on the ray tracing technique.
|
Image texture. More...
#include <imagetexture.hpp>
Public Member Functions | |
| ImageTexture (rt::image *) | |
| Construct a texture from a pointer to a rt::image. More... | |
| rt::image * | image () const |
| The image of the texture. More... | |
| void | setImage (rt::image *) |
| Set the image of the texture. More... | |
| virtual color | value (const vector &) const |
| Get the value/color of the texture. More... | |
Public Member Functions inherited from rt::Texture | |
| virtual | ~Texture ()=0 |
| Virtualdestructor. | |
Image texture.
A TextureImage is a 2D texture based on a rt::image. \((0.0, 0.0, 0.0)\) is the top-left corner of the image, \((1.0, 1.0, 0.0)\) the bottom-right corner.
| rt::ImageTexture::ImageTexture | ( | rt::image * | img | ) |
Construct a texture from a pointer to a rt::image.
If the pointer is null, the black color will always be returned.
| rt::image * rt::ImageTexture::image | ( | ) | const |
The image of the texture.
May be null.
| void rt::ImageTexture::setImage | ( | rt::image * | img | ) |
Set the image of the texture.
If the pointer is null, the black color will always be returned.
Get the value/color of the texture.
| pos | A position in texture space. Because it is a 2D texture, the z component of the vector is ignored. |
Implements rt::Texture.
1.8.15