MorphoGraphX
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
mgx::util::Color< T > Class Template Reference

A utility class to encapsulate color data. More...

#include <Color.hpp>

+ Inheritance diagram for mgx::util::Color< T >:

Public Member Functions

template<typename T1 >
 Color (const Vector< 4, T1 > &color, const T &scale=1)
 Constructor to convert from one color type to another.
 
template<typename T1 >
 Color (const Vector< 4, T1 > &color, const T1 &scale)
 
 Color (const Vector< 4, T > &copy)
 
 Color (const QColor &c)
 
 Color (const T &r=T(), const T &g=T(), const T &b=T(), const T &a=T())
 Constructor. More...
 
T & r ()
 Return the red component.
 
T & g ()
 Return the green component.
 
T & b ()
 Return the blue component.
 
T & a ()
 Return the alpha component.
 
const T & r () const
 Return the red component.
 
const T & g () const
 Return the green component.
 
const T & b () const
 Return the blue component.
 
const T & a () const
 Return the alpha component.
 
void r (const T &val)
 Set the red component.
 
void g (const T &val)
 Set the green component.
 
void b (const T &val)
 Set the blue component.
 
void a (const T &val)
 Set the alpha component.
 
Color< T > & operator= (const Color< T > &c)
 Assignment of color data. More...
 
Color< T > & operator= (const Vector< 4, T > &c)
 
Color< T > & operator= (const T &val)
 
Color< T > & operator= (const QColor &c)
 
 operator QColor () const
 
- Public Member Functions inherited from mgx::util::Vector< 4, T >
CU_HOST_DEVICE Vector (const Vector &vec)
 Copy another vector.
 
CU_HOST_DEVICE Vector (const Vector< dim, T1 > &vec)
 Copy another vector with different number of elements.
 
CU_HOST_DEVICE Vector (const Vector< d1, T1 > &vec)
 Copy another vector with different number of elements.
 
CU_HOST_DEVICE Vector (const Vec &el)
 Initialize a vector from any object behaving like an array. More...
 
CU_HOST_DEVICE Vector (const T &x=T())
 Initialize a vector with all values to x.
 
CU_HOST_DEVICE Vector (const T &x, const T &y)
 Initialize a 2D vector.
 
CU_HOST_DEVICE Vector (const T &x, const T &y, const T &z)
 Initialize a 3D vector.
 
CU_HOST_DEVICE Vector (const T &x, const T &y, const T &z, const T &t)
 Initialize a 4D vector.
 
CU_HOST_DEVICE Vector (const T &x, const T &y, const T &z, const T &a, const T &b)
 Initialize a 5D vector.
 
CU_HOST_DEVICE Vector (const T &x, const T &y, const T &z, const T &a, const T &b, const T &c)
 Initialize a 6D vector.
 
CU_HOST_DEVICE Vector (const T &x, const T &y, const T &z, const T &a, const T &b, const T &c, const T &d)
 Initialize a 7D vector.
 
CU_HOST_DEVICE Vector (const T &a, const T &b, const T &c, const T &d, const T &e, const T &f, const T &g, const T &h, const T &i, const T &j, const T &k, const T &l)
 Initialize a 12D vector.
 
CU_HOST_DEVICE T * data ()
 Returns a raw pointer on the data.
 
CU_HOST_DEVICE iterator begin ()
 STL-iteration begin.
 
CU_HOST_DEVICE const_iterator begin () const
 Stl-iteration constant begin.
 
CU_HOST_DEVICE iterator end ()
 STL-iteration end.
 
CU_HOST_DEVICE const_iterator end () const
 Stl-iteration constant end.
 
CU_HOST_DEVICE const T * c_data () const
 Returns a constant raw pointer on the data.
 
CU_HOST_DEVICE Vector operator- (void) const
 Vector negation.
 
CU_HOST_DEVICE Vector operator- (const Vector &vec) const
 Vector subtraction.
 
CU_HOST_DEVICE Vector operator+ (const Vector &vec) const
 Vector addition.
 
CU_HOST_DEVICE Vector mult (const Vector &vec) const
 Element-wise multiplcation.
 
CU_HOST_DEVICE Vector operator* (const T &scalar) const
 Multiplication by a scalar.
 
CU_HOST_DEVICE T operator* (const Vector &vec) const
 Dot product.
 
CU_HOST_DEVICE Vector operator/ (const T &scalar) const
 Division by a scalar.
 
CU_HOST_DEVICE Vector operator/ (const Vector &vec) const
 Element-wise division.
 
CU_HOST_DEVICE Vectoroperator/= (const Vector &vec)
 In-place element-wise division by a scalar.
 
CU_HOST_DEVICE Vectoroperator/= (const T &scalar)
 In-place division by a scalar.
 
CU_HOST_DEVICE Vectoroperator/= (const T1 &scalar)
 In-place division by a scalar.
 
CU_HOST_DEVICE Vectoroperator= (const Vector &vec)
 Vector copy.
 
CU_HOST_DEVICE Vectoroperator= (const T &value)
 Set all the elements to value.
 
CU_HOST_DEVICE Vectoroperator+= (const Vector &vec)
 In-place vector addition.
 
CU_HOST_DEVICE Vectoroperator+= (const T &val)
 In-place constant addition.
 
CU_HOST_DEVICE Vectoroperator-= (const Vector &vec)
 In-place vector subtraction.
 
CU_HOST_DEVICE Vectoroperator-= (const T &val)
 In-place value subtraction.
 
CU_HOST_DEVICE Vectoroperator*= (const T &scalar)
 In-place multiplication by a scalar.
 
CU_HOST_DEVICE Vectoroperator*= (const T1 &scalar)
 In-place multiplication by a scalar.
 
CU_HOST_DEVICE bool operator== (const Vector &vec) const
 Element-wise equality.
 
CU_HOST_DEVICE bool operator!= (const Vector &vec) const
 Element-wise inequality.
 
CU_HOST_DEVICE T & operator[] (size_t idx)
 Access to the element idx.
 
CU_HOST_DEVICE const T & operator[] (size_t idx) const
 Access to the element idx.
 
CU_HOST_DEVICE T norm () const
 Euclidean norm of the vector.
 
CU_HOST_DEVICE T normsq () const
 Square of the Euclidean norm of the vector.
 
CU_HOST_DEVICE Vectornormalize (void)
 Normalize the vector.
 
CU_HOST_DEVICE Vector normalized (void) const
 Returns a normalized version of the vector.
 
bool iszero (void)
 
Vectorzero (void)
 
CU_HOST_DEVICE void set (const T &x)
 Set the values of a 1-D vector.
 
CU_HOST_DEVICE void set (const T &x, const T &y)
 Set the values of a 2-D vector.
 
CU_HOST_DEVICE void set (const T &x, const T &y, const T &z)
 Set the values of a 3-D vector.
 
CU_HOST_DEVICE void set (const T &x, const T &y, const T &z, const T &t)
 Set the values of a 4-D vector.
 
CU_HOST_DEVICE Vector cross (const Vector &other) const
 Compute the cross product as this x other.
 
CU_HOST_DEVICE void x (const T &v)
 Short access to the first element.
 
CU_HOST_DEVICE T & x ()
 Short access to the first element.
 
CU_HOST_DEVICE const T & x () const
 Short access to the first element.
 
CU_HOST_DEVICE void y (const T &v)
 Short access to the second element.
 
CU_HOST_DEVICE T & y ()
 Short access to the second element.
 
CU_HOST_DEVICE const T & y () const
 Short access to the second element.
 
CU_HOST_DEVICE void z (const T &v)
 Short access to the third element.
 
CU_HOST_DEVICE T & z ()
 Short access to the third element.
 
CU_HOST_DEVICE const T & z () const
 Short access to the third element.
 
CU_HOST_DEVICE void t (const T &v)
 Short access to the fourth element.
 
CU_HOST_DEVICE T & t ()
 Short access to the fourth element.
 
CU_HOST_DEVICE const T & t () const
 Short access to the fourth element.
 
CU_HOST_DEVICE void i (const T &v)
 Short access to the first element.
 
CU_HOST_DEVICE T & i ()
 Short access to the first element.
 
CU_HOST_DEVICE const T & i () const
 Short access to the first element.
 
CU_HOST_DEVICE void j (const T &v)
 Short access to the second element.
 
CU_HOST_DEVICE T & j ()
 Short access to the second element.
 
CU_HOST_DEVICE const T & j () const
 Short access to the second element.
 
CU_HOST_DEVICE void k (const T &v)
 Short access to the third element.
 
CU_HOST_DEVICE T & k ()
 Short access to the third element.
 
CU_HOST_DEVICE const T & k () const
 Short access to the third element.
 
CU_HOST_DEVICE void l (const T &v)
 Short access to the fourth element.
 
CU_HOST_DEVICE T & l ()
 Short access to the fourth element.
 
CU_HOST_DEVICE const T & l () const
 Short access to the fourth element.
 
CU_HOST_DEVICE Vector< 2, T > projectXY (void)
 Extract the two first elements of the vector.
 
CU_HOST_DEVICE bool operator< (const Vector &other) const
 Comparison operator. More...
 
CU_HOST_DEVICE bool operator<= (const Vector &other) const
 Comparison operator. More...
 
CU_HOST_DEVICE bool operator> (const Vector &other) const
 Comparison operator. More...
 
CU_HOST_DEVICE bool operator>= (const Vector &other) const
 Comparison operator. More...
 

Additional Inherited Members

- Public Types inherited from mgx::util::Vector< 4, T >
typedef T value_type
 
typedef T & reference_type
 
typedef const T & const_reference_type
 
typedef T * pointer_type
 
typedef const T * const_pointer_type
 
typedef T * iterator
 
typedef const T * const_iterator
 
- Static Public Member Functions inherited from mgx::util::Vector< 4, T >
static CU_HOST_DEVICE size_t size ()
 Returns the size of the vector (i.e. More...
 
- Protected Attributes inherited from mgx::util::Vector< 4, T >
elems [dim]
 

Detailed Description

template<class T>
class mgx::util::Color< T >

A utility class to encapsulate color data.

Constructor & Destructor Documentation

template<class T>
mgx::util::Color< T >::Color ( const T &  r = T(),
const T &  g = T(),
const T &  b = T(),
const T &  a = T() 
)
inline

Constructor.

Parameters
rValue for red.
gValue for green.
bValue for blue.
aValue for alpha.

Member Function Documentation

template<class T>
Color< T > & mgx::util::Color< T >::operator= ( const Color< T > &  c)

Assignment of color data.


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