alternative Standard Libary  0.29.8
std::math::color< T > Template-Klassenreferenz

#include <color.hpp>

+ Klassendiagramm für std::math::color< T >:
+ Zusammengehörigkeiten von std::math::color< T >:

Öffentliche Typen

typedef T value_type
 
typedef T * pointer
 
typedef color< T > self_type
 

Öffentliche Methoden

 color (void)
 
 color (value_type _r, value_type _g, value_type _b, value_type _a)
 
 color (value_type _r, value_type _g, value_type _b)
 
 color (value_type f)
 
 color (value_type *com)
 
 color (const int _r, const int _g, const int _b)
 
 color (const int _r, const int _g, const int _b, const int _a)
 
 color (const int *pComponent)
 
 color (const int c)
 
 operator unsigned long () const
 
 operator T* ()
 
self_typeoperator= (const self_type &c)
 
self_typeoperator+= (const self_type &c)
 
self_typeoperator-= (const self_type &c)
 
self_typeoperator*= (const self_type &c)
 
self_typeoperator*= (const value_type f)
 
self_typeoperator/= (const self_type &c)
 
self_typeoperator/= (const value_type f)
 
virtual std::string to_string ()
 

Öffentliche Attribute

union {
   struct {
      value_type   r
 
      value_type   g
 
      value_type   b
 
      value_type   a
 
   } 
 
   struct {
      value_type   red
 
      value_type   green
 
      value_type   blue
 
      value_type   alpha
 
   } 
 
   value_type   c [4]
 
}; 
 

Ausführliche Beschreibung

template<typename T>
class std::math::color< T >

Dokumentation der benutzerdefinierten Datentypen

◆ pointer

template<typename T >
typedef T* std::math::color< T >::pointer

◆ self_type

template<typename T >
typedef color<T> std::math::color< T >::self_type

◆ value_type

template<typename T >
typedef T std::math::color< T >::value_type

Beschreibung der Konstruktoren und Destruktoren

◆ color() [1/9]

template<typename T >
std::math::color< T >::color ( void  )
inline
71 {}

◆ color() [2/9]

template<typename T >
std::math::color< T >::color ( value_type  _r,
value_type  _g,
value_type  _b,
value_type  _a 
)
inline
72 : r(_r), g(_g), b(_b), a(_a) {}
value_type b
Definition: color.hpp:60
value_type a
Definition: color.hpp:61
value_type g
Definition: color.hpp:59
value_type r
Definition: color.hpp:58

◆ color() [3/9]

template<typename T >
std::math::color< T >::color ( value_type  _r,
value_type  _g,
value_type  _b 
)
inline
73 : r(_r), g(_g), b(_b), a(1.0) {}
value_type b
Definition: color.hpp:60
value_type a
Definition: color.hpp:61
value_type g
Definition: color.hpp:59
value_type r
Definition: color.hpp:58

◆ color() [4/9]

template<typename T >
std::math::color< T >::color ( value_type  f)
inline
74 : r(f), g(f), b(f), a(f) {}
value_type b
Definition: color.hpp:60
value_type a
Definition: color.hpp:61
value_type g
Definition: color.hpp:59
value_type r
Definition: color.hpp:58

◆ color() [5/9]

template<typename T >
std::math::color< T >::color ( value_type com)
inline
75 : r(com[0]), g(com[1]), b(com[2]), a(com[3]) {}
value_type b
Definition: color.hpp:60
value_type a
Definition: color.hpp:61
value_type g
Definition: color.hpp:59
value_type r
Definition: color.hpp:58

◆ color() [6/9]

template<typename T >
std::math::color< T >::color ( const int  _r,
const int  _g,
const int  _b 
)
inline
76 : r((T)(_r) * colorcon), g((T)(_g) * colorcon), b((T)(_b) * colorcon), a(1.0f) {}
value_type b
Definition: color.hpp:60
value_type a
Definition: color.hpp:61
value_type g
Definition: color.hpp:59
value_type r
Definition: color.hpp:58

◆ color() [7/9]

template<typename T >
std::math::color< T >::color ( const int  _r,
const int  _g,
const int  _b,
const int  _a 
)
inline
77 : r((T)(_r) * colorcon), g((T)(_g) * colorcon), b((T)(_b) * colorcon), a((T)(_a) * colorcon) {}
value_type b
Definition: color.hpp:60
value_type a
Definition: color.hpp:61
value_type g
Definition: color.hpp:59
value_type r
Definition: color.hpp:58

◆ color() [8/9]

template<typename T >
std::math::color< T >::color ( const int *  pComponent)
inline
78 : r((T)(pComponent[0]) * colorcon), g((T)(pComponent[1]) * colorcon), b((T)(pComponent[2]) * colorcon), a((T)(pComponent[3]) * colorcon) {}
value_type b
Definition: color.hpp:60
value_type a
Definition: color.hpp:61
value_type g
Definition: color.hpp:59
value_type r
Definition: color.hpp:58

◆ color() [9/9]

template<typename T >
std::math::color< T >::color ( const int  c)
inline
79 : r(colorcon * (T)(c >> 16)), g(colorcon * (T)(c >> 8)), b(colorcon * (T)(c)), a(colorcon * (T)(c >> 24)) {}
value_type b
Definition: color.hpp:60
value_type a
Definition: color.hpp:61
value_type c[4]
Definition: color.hpp:69
value_type g
Definition: color.hpp:59
value_type r
Definition: color.hpp:58

Dokumentation der Elementfunktionen

◆ operator T*()

template<typename T >
std::math::color< T >::operator T* ( )
inline
88 {return (T*)(c);}
value_type c[4]
Definition: color.hpp:69

◆ operator unsigned long()

template<typename T >
std::math::color< T >::operator unsigned long ( ) const
inline
82  {
83  return ((a >= 1.0f ? 255 : a <= 0.0f ? 0 : (unsigned long)(a * 255.0f)) << 24) |
84  ((r >= 1.0f ? 255 : r <= 0.0f ? 0 : (unsigned long)(r * 255.0f)) << 16) |
85  ((g >= 1.0f ? 255 : g <= 0.0f ? 0 : (unsigned long)(g * 255.0f)) << 8) |
86  (b >= 1.0f ? 255 : b <= 0.0f ? 0 : (unsigned long)(b * 255.0f));
87  }
value_type b
Definition: color.hpp:60
value_type a
Definition: color.hpp:61
value_type g
Definition: color.hpp:59
value_type r
Definition: color.hpp:58

◆ operator*=() [1/2]

template<typename T >
self_type& std::math::color< T >::operator*= ( const self_type c)
inline
93 {r *= c.r; g *= c.g; b *= c.b; a *= c.a; return *this;}
value_type b
Definition: color.hpp:60
value_type a
Definition: color.hpp:61
value_type c[4]
Definition: color.hpp:69
value_type g
Definition: color.hpp:59
value_type r
Definition: color.hpp:58

◆ operator*=() [2/2]

template<typename T >
self_type& std::math::color< T >::operator*= ( const value_type  f)
inline
94 {r *= f; g *= f; b *= f; a *= f; return *this;}
value_type b
Definition: color.hpp:60
value_type a
Definition: color.hpp:61
value_type g
Definition: color.hpp:59
value_type r
Definition: color.hpp:58

◆ operator+=()

template<typename T >
self_type& std::math::color< T >::operator+= ( const self_type c)
inline
91 {r += c.r; g += c.g; b += c.b; a += c.a; return *this;}
value_type b
Definition: color.hpp:60
value_type a
Definition: color.hpp:61
value_type c[4]
Definition: color.hpp:69
value_type g
Definition: color.hpp:59
value_type r
Definition: color.hpp:58

◆ operator-=()

template<typename T >
self_type& std::math::color< T >::operator-= ( const self_type c)
inline
92 {r -= c.r; g -= c.g; b -= c.b; a -= c.a; return *this;}
value_type b
Definition: color.hpp:60
value_type a
Definition: color.hpp:61
value_type c[4]
Definition: color.hpp:69
value_type g
Definition: color.hpp:59
value_type r
Definition: color.hpp:58

◆ operator/=() [1/2]

template<typename T >
self_type& std::math::color< T >::operator/= ( const self_type c)
inline
95 {r /= c.r; g /= c.g; b /= c.b; a /= c.a; return *this;}
value_type b
Definition: color.hpp:60
value_type a
Definition: color.hpp:61
value_type c[4]
Definition: color.hpp:69
value_type g
Definition: color.hpp:59
value_type r
Definition: color.hpp:58

◆ operator/=() [2/2]

template<typename T >
self_type& std::math::color< T >::operator/= ( const value_type  f)
inline
96 {r /= f; g /= f; b /= f; a /= f; return *this;}
value_type b
Definition: color.hpp:60
value_type a
Definition: color.hpp:61
value_type g
Definition: color.hpp:59
value_type r
Definition: color.hpp:58

◆ operator=()

template<typename T >
self_type& std::math::color< T >::operator= ( const self_type c)
inline
90 {a = c.a; b = c.b; g = c.g; r = c.r; return *this;}
value_type b
Definition: color.hpp:60
value_type a
Definition: color.hpp:61
value_type c[4]
Definition: color.hpp:69
value_type g
Definition: color.hpp:59
value_type r
Definition: color.hpp:58

◆ to_string()

template<typename T >
virtual std::string std::math::color< T >::to_string ( )
inlinevirtual
98  {
99  return std::frmstring("Color: R:%d G:%d B:%d A:%d",
100  red, green, blue, alpha);
101  }
value_type blue
Definition: color.hpp:66
size_t frmstring(basic_string< E, TAllocator, TStorage > &dest, const char *format, va_list arg)
Definition: string.hpp:99
value_type red
Definition: color.hpp:64
value_type green
Definition: color.hpp:65
value_type alpha
Definition: color.hpp:67

Dokumentation der Datenelemente

◆ @8

union { ... }

◆ a

template<typename T >
value_type std::math::color< T >::a

◆ alpha

template<typename T >
value_type std::math::color< T >::alpha

◆ b

template<typename T >
value_type std::math::color< T >::b

◆ blue

template<typename T >
value_type std::math::color< T >::blue

◆ c

template<typename T >
value_type std::math::color< T >::c[4]

◆ g

template<typename T >
value_type std::math::color< T >::g

◆ green

template<typename T >
value_type std::math::color< T >::green

◆ r

template<typename T >
value_type std::math::color< T >::r

◆ red

template<typename T >
value_type std::math::color< T >::red

Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei: