Visual Computing Library
|
The TexCoord class represents a 2-dimensional texture coordinate containing two scalar values. More...
#include <vclib/space/core/tex_coord.h>
Public Types | |
using | ScalarType = Scalar |
Public Member Functions | |
TexCoord (const Scalar &s1, const Scalar &s2) | |
TexCoord (const Point2< Scalar > &p) | |
template<typename S > | |
auto | cast () const |
Scalar | u () const |
Scalar | v () const |
Scalar & | u () |
Scalar & | v () |
void | setU (Scalar s) |
void | setV (Scalar s) |
void | set (Scalar u, Scalar v) |
void | serialize (std::ostream &os) const |
void | deserialize (std::istream &is) |
Scalar & | operator() (uint i) |
const Scalar & | operator() (uint i) const |
Scalar & | operator[] (uint i) |
const Scalar & | operator[] (uint i) const |
auto | operator<=> (const TexCoord &t1) const =default |
Private Attributes | |
Point2< Scalar > | mCoord |
The TexCoord class represents a 2-dimensional texture coordinate containing two scalar values.
The TexCoord class template represents a 2-dimensional texture coordinate containing two scalar values. The scalar type of the texture coordinates is a template parameter of the class.
The class is a specialization of the Point2 class template, where the two components of the texture coordinate are named u
and v
. The class adds setter member functions for setting the u
and v
components of the texture coordinate, with an additional assert that the values are in the range [0, 1].
Scalar | The scalar type of the texture coordinate components. |