Ray Tracer Common Project
Image rendering program based on the ray tracing technique.
Public Member Functions | List of all members
rt::ImageTexture Class Reference

Image texture. More...

#include <imagetexture.hpp>

Inheritance diagram for rt::ImageTexture:
rt::Texture

Public Member Functions

 ImageTexture (rt::image *)
 Construct a texture from a pointer to a rt::image. More...
 
rt::imageimage () 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ImageTexture()

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.

Member Function Documentation

◆ image()

rt::image * rt::ImageTexture::image ( ) const

The image of the texture.

May be null.

◆ setImage()

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.

◆ value()

color rt::ImageTexture::value ( const vector v) const
virtual

Get the value/color of the texture.

Parameters
posA position in texture space. Because it is a 2D texture, the z component of the vector is ignored.

Implements rt::Texture.


The documentation for this class was generated from the following files: