|
utility 2026.1.9
A comprehensive C++ utilities library tailored for the development of modern desktop and extended reality (XR) applications.
|
The Texture class represents a texture resource that can be used for rendering in a graphics application. More...
#include <headers/utility/graphic/texture.hpp>
Public Types | |
| enum class | TextureType { Albedo , Normal , Roughness , FontAtlas } |
| Describes the type of texture, such as albedo, normal, roughness, or font atlas. More... | |
Public Member Functions | |
| Texture (uint32_t width, uint32_t height, TextureType type=TextureType::Albedo) | |
| Constructs a Texture object with the specified width and height. | |
| ~Texture ()=default | |
| Destructs the Texture object. | |
| uint32_t | width () const |
| Retrieves the width of the texture. | |
| uint32_t | height () const |
| Retrieves the height of the texture. | |
| const std::vector< uint8_t > & | pixels () const noexcept |
| Retrieve the pixel data. | |
| std::vector< uint8_t > & | pixels () noexcept |
| Retrieve the pixel data for mutation. | |
| TextureType | type () const noexcept |
| Retrieve the type of the texture. | |
Protected Attributes | |
| std::vector< uint8_t > | _pixels |
| The corresponding pixel data for this texture, stored as a vector of bytes (RGBA format). | |
| TextureType | _type |
| The type of the texture. | |
| uint32_t | _width |
| The width of the texture in pixels. | |
| uint32_t | _height |
| The height of the texture in pixels. | |
The Texture class represents a texture resource that can be used for rendering in a graphics application.
The Texture class manages pixel data for a texture, including its width and height. It provides functionality to store and retrieve pixel data, which can be used for rendering operations in conjunction with shaders and materials.
Definition at line 25 of file texture.hpp.
|
strong |
Describes the type of texture, such as albedo, normal, roughness, or font atlas.
Definition at line 32 of file texture.hpp.
| utility::graphic::Texture::Texture | ( | uint32_t | width, |
| uint32_t | height, | ||
| TextureType | type = TextureType::Albedo |
||
| ) |
Constructs a Texture object with the specified width and height.
This constructor initializes a Texture object with the given width and height, and it sets up the internal pixel data storage for the texture. The pixel data is stored as a vector of bytes in RGBA format, allowing for efficient management of texture data for rendering purposes.
| width | The width of the texture in pixels. |
| height | The height of the texture in pixels. |
| type | The type of the texture. |
Definition at line 12 of file texture.cpp.

|
inline |
Retrieves the height of the texture.
This method returns the height of the texture in pixels, which is stored as a member variable in the Texture class. The height is an important property of the texture that is used for rendering operations and managing texture data.
Definition at line 90 of file texture.hpp.

|
inlinenoexcept |
Retrieve the pixel data.
Definition at line 100 of file texture.hpp.
|
inlinenoexcept |
Retrieve the pixel data for mutation.
Definition at line 110 of file texture.hpp.
|
inlinenoexcept |
Retrieve the type of the texture.
Definition at line 119 of file texture.hpp.

|
inline |
Retrieves the width of the texture.
This method returns the width of the texture in pixels, which is stored as a member variable in the Texture class. The width is an important property of the texture that is used for rendering operations and managing texture data.
Definition at line 75 of file texture.hpp.

|
protected |
The height of the texture in pixels.
Definition at line 144 of file texture.hpp.
|
protected |
The corresponding pixel data for this texture, stored as a vector of bytes (RGBA format).
Definition at line 129 of file texture.hpp.
|
protected |
The type of the texture.
Definition at line 134 of file texture.hpp.
|
protected |
The width of the texture in pixels.
Definition at line 139 of file texture.hpp.