|
Avara3D 0.2.0
C++ API reference
|
Image or cubemap data together with the Sampler used to read it. More...
#include <a3d/visual/material/Texture.h>
Public Types | |
| using | Contents = std::variant< std::monostate, std::shared_ptr< Image >, std::shared_ptr< CubeImage > > |
| Texture contents: empty, a 2D Image, or a CubeImage. More... | |
Public Member Functions | |
| Texture () | |
| Creates an empty Texture with no contents or Sampler and mapping channel 0. More... | |
| Texture (const Contents &contents, const std::shared_ptr< Sampler > &sampler=std::make_shared< Sampler >(), unsigned mappingChannel=0) | |
Creates a Texture with shared contents, sampler, and mapping channel. More... | |
| std::shared_ptr< Sampler > | sampler () const |
| Returns the shared Sampler, or nullptr if none is assigned. More... | |
| void | sampler (const std::shared_ptr< Sampler > &sampler) |
| Sets the shared Sampler; nullptr removes the explicit Sampler. More... | |
| const Contents & | contents () const |
| Returns the shared image or cubemap contents. More... | |
| void | contents (const Contents &contents) |
| Sets the shared image or cubemap contents. More... | |
| unsigned | mappingChannel () const |
| Returns the stored texture-coordinate mapping channel. More... | |
| void | mappingChannel (unsigned channel) |
| Sets the stored texture-coordinate mapping channel. More... | |
Image or cubemap data together with the Sampler used to read it.
Texture contents and Sampler are held with shared ownership. Copying a Texture therefore shares the referenced Image or CubeImage and Sampler.
| using a3d::Texture::Contents = std::variant<std::monostate, std::shared_ptr<Image>, std::shared_ptr<CubeImage> > |
| a3d::Texture::Texture | ( | ) |
| const Contents & a3d::Texture::contents | ( | ) | const |
Returns the shared image or cubemap contents.
| void a3d::Texture::contents | ( | const Contents & | contents | ) |
Sets the shared image or cubemap contents.
| unsigned a3d::Texture::mappingChannel | ( | ) | const |
Returns the stored texture-coordinate mapping channel.
The current renderer does not consume this value.
| void a3d::Texture::mappingChannel | ( | unsigned | channel | ) |
Sets the stored texture-coordinate mapping channel.
The current renderer does not consume this value.
| std::shared_ptr< Sampler > a3d::Texture::sampler | ( | ) | const |
Returns the shared Sampler, or nullptr if none is assigned.
| void a3d::Texture::sampler | ( | const std::shared_ptr< Sampler > & | sampler | ) |