|
Visual Computing Library
devel
|
Describes the properties of a texture, such as its source path and rendering parameters. More...
#include <vclib/space/core/texture_descriptor.h>
Public Types | |
| enum class | MagnificationFilter { NONE = -1 , NEAREST = 9728 , LINEAR } |
| Defines the texture magnification filter modes, following the glTF 2.0 specification. The magnification filter is used when the pixel being textured maps to an area less than or equal to one texel. More... | |
| enum class | MinificationFilter { NONE = -1 , NEAREST = 9728 , LINEAR , NEAREST_MIPMAP_NEAREST , LINEAR_MIPMAP_NEAREST , NEAREST_MIPMAP_LINEAR , LINEAR_MIPMAP_LINEAR } |
| Defines the texture minification filter modes, following the glTF 2.0 specification. The minification filter is used when the pixel being textured maps to an area greater than one texel. More... | |
| enum class | WrapMode { REPEAT = 10497 , CLAMP_TO_EDGE = 33071 , MIRRORED_REPEAT = 33648 } |
| Defines the texture wrapping modes for S (U) and T (V) coordinates, following the glTF 2.0 specification. More... | |
Public Member Functions | |
| void | deserialize (std::istream &is) |
| Deserializes the TextureDescriptor from an input stream. | |
| bool | isNull () const |
| Checks whether the texture descriptor is null (i.e., has an empty path). | |
| MagnificationFilter & | magFilter () |
| Gets a mutable reference to the magnification filter of the texture. | |
| MagnificationFilter | magFilter () const |
| Gets the magnification filter of the texture. | |
| MinificationFilter & | minFilter () |
| Gets a mutable reference to the minification filter of the texture. | |
| MinificationFilter | minFilter () const |
| Gets the minification filter of the texture. | |
| bool | operator== (const TextureDescriptor &other) const =default |
| Compares this TextureDescriptor with another for equality. | |
| std::string & | path () |
| Gets a mutable reference to the file path of the texture. | |
| const std::string & | path () const |
| Gets the file path of the texture. | |
| void | serialize (std::ostream &os) const |
| Serializes the TextureDescriptor to an output stream. | |
| TextureDescriptor () | |
| Default constructor. Initializes with an empty path and default filter/wrap modes. | |
| TextureDescriptor (const std::string &path) | |
| Constructs a TextureDescriptor from a file path. | |
| WrapMode & | wrapU () |
| Gets a mutable reference to the wrap mode for the U (S) texture coordinate. | |
| WrapMode | wrapU () const |
| Gets the wrap mode for the U (S) texture coordinate. | |
| WrapMode & | wrapV () |
| Gets a mutable reference to the wrap mode for the V (T) texture coordinate. | |
| WrapMode | wrapV () const |
| Gets the wrap mode for the V (T) texture coordinate. | |
Private Attributes | |
| MagnificationFilter | mMagFilter |
| The magnification filter mode. | |
| MinificationFilter | mMinFilter |
| The minification filter mode. | |
| std::string | mPath |
| The file path to the texture source. | |
| WrapMode | mWrapU |
| The wrap mode for the U (S) texture coordinate. | |
| WrapMode | mWrapV |
| The wrap mode for the V (T) texture coordinate. | |
Describes the properties of a texture, such as its source path and rendering parameters.
This class encapsulates metadata for a texture, including its file path, minification and magnification filters, and texture coordinate wrapping modes. The enum values for filters and wrap modes follow the glTF 2.0 specification.
|
strong |
|
strong |
Defines the texture minification filter modes, following the glTF 2.0 specification. The minification filter is used when the pixel being textured maps to an area greater than one texel.
|
strong |
|
inline |
Constructs a TextureDescriptor from a file path.
Filter/wrap modes are initialized to default values.
| [in] | path | The file path of the texture. |
|
inline |
Deserializes the TextureDescriptor from an input stream.
| [in/out] | is: The input stream. |
|
inline |
Checks whether the texture descriptor is null (i.e., has an empty path).
|
inline |
Gets a mutable reference to the magnification filter of the texture.
|
inline |
Gets the magnification filter of the texture.
|
inline |
Gets a mutable reference to the minification filter of the texture.
|
inline |
Gets the minification filter of the texture.
|
default |
Compares this TextureDescriptor with another for equality.
| [in] | other | The other TextureDescriptor to compare against. |
|
inline |
Gets a mutable reference to the file path of the texture.
|
inline |
Gets the file path of the texture.
|
inline |
Serializes the TextureDescriptor to an output stream.
| [in/out] | os: The output stream. |
|
inline |
Gets a mutable reference to the wrap mode for the U (S) texture coordinate.
|
inline |
Gets the wrap mode for the U (S) texture coordinate.
|
inline |
Gets a mutable reference to the wrap mode for the V (T) texture coordinate.
|
inline |
Gets the wrap mode for the V (T) texture coordinate.
|
private |
The magnification filter mode.
|
private |
The minification filter mode.
|
private |
The wrap mode for the U (S) texture coordinate.
|
private |
The wrap mode for the V (T) texture coordinate.