Visual Computing Library
Loading...
Searching...
No Matches
vcl::TexCoord< Scalar > Class Template Reference

The TexCoord class represents a 2-dimensional texture coordinate containing two scalar values. More...

#include <vclib/space/core/tex_coord.h>

Inheritance diagram for vcl::TexCoord< Scalar >:

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
 

Detailed Description

template<typename Scalar>
class vcl::TexCoord< Scalar >

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].

Template Parameters
ScalarThe scalar type of the texture coordinate components.

The documentation for this class was generated from the following file: