MobileRT
1.0
A multi platform C++ CPU progressive Ray Tracer.
|
#include <Texture.hpp>
Public Member Functions | |
Texture ()=default | |
Texture (::std::shared_ptr<::std::uint8_t > pointer, ::std::int32_t width, ::std::int32_t height, ::std::int32_t channels) | |
Texture (const Texture &texture)=default | |
Texture (Texture &&texture) noexcept=default | |
~Texture ()=default | |
Texture & | operator= (const Texture &texture)=default |
Texture & | operator= (Texture &&texture) noexcept=default |
::glm::vec3 | loadColor (const ::glm::vec2 &texCoords) const |
bool | isValid () const |
bool | operator== (const Texture &texture) const |
Static Public Member Functions | |
static Texture | createTexture (::std::string &&texture, long size) |
static Texture | createTexture (const ::std::string &texturePath) |
Private Attributes | |
::std::shared_ptr<::std::uint8_t > | pointer_ {} |
::std::uint8_t * | image_ {} |
::std::int32_t | width_ {} |
::std::int32_t | height_ {} |
::std::int32_t | channels_ {} |
A texture of a material.
A texture is an image where each cell in the image represents the reflection of light in the object on an intersection point.
|
explicitdefault |
|
explicit |
The constructor.
pointer | A shared_ptr to the texture data. |
width | The width of the texture. |
height | The height of the texture. |
channels | The number of channels in the texture. |
|
default |
|
defaultnoexcept |
|
default |
|
static |
|
static |
A factory which loads a texture file and creates a new Texture.
texturePath | The path to the texture file. |
bool Texture::isValid | ( | ) | const |
Checks if the texture is valid or not.
glm::vec3 Texture::loadColor | ( | const ::glm::vec2 & | texCoords | ) | const |
Gets the color of a point in the texture.
texCoords | The texture coordinates. |
bool Texture::operator== | ( | const Texture & | texture | ) | const |
The operator equals.
texture | A texture. |
|
private |
|
private |
|
private |
|
private |
|
private |