mn::math::basic_color< T > Class Template Reference

A class for RGBA Color handling. More...

#include <mn_color.hpp>

Public Types

using value_type = T
 
using pointer = T *
 
using self_type = basic_color< T >
 

Public Member Functions

 basic_color (void)
 Construct a new basic color object. More...
 
 basic_color (value_type _r, value_type _g, value_type _b, value_type _a)
 Construct a new basic color object. More...
 
 basic_color (value_type _r, value_type _g, value_type _b)
 Construct a new basic color object. More...
 
 basic_color (value_type *com)
 Construct a new basic color object. More...
 
 basic_color (const int _r, const int _g, const int _b)
 Construct a new basic color object. More...
 
 basic_color (const int _r, const int _g, const int _b, const int _a)
 Construct a new basic color object. More...
 
 basic_color (const int *pComponent)
 Construct a new basic color object. More...
 
 basic_color (const int c)
 Construct a new basic color object. More...
 
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 mn::string to_string ()
 
 operator unsigned long ()
 
 operator T* ()
 

Public Attributes

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

Static Private Attributes

static constexpr double colorcon = 0.003921568627450980392156862745098
 

Detailed Description

template<typename T>
class mn::math::basic_color< T >

A class for RGBA Color handling.

Template Parameters
TThe value of the color value

Member Typedef Documentation

◆ pointer

template<typename T >
using mn::math::basic_color< T >::pointer = T*

◆ self_type

template<typename T >
using mn::math::basic_color< T >::self_type = basic_color<T>

◆ value_type

template<typename T >
using mn::math::basic_color< T >::value_type = T

Constructor & Destructor Documentation

◆ basic_color() [1/8]

template<typename T >
mn::math::basic_color< T >::basic_color ( void  )
inline

Construct a new basic color object.

◆ basic_color() [2/8]

template<typename T >
mn::math::basic_color< T >::basic_color ( value_type  _r,
value_type  _g,
value_type  _b,
value_type  _a 
)
inline

Construct a new basic color object.

Parameters
_rThe red vaule
_gThe green vaule
_bThe blue vaule
_aThe alpha vaule

◆ basic_color() [3/8]

template<typename T >
mn::math::basic_color< T >::basic_color ( value_type  _r,
value_type  _g,
value_type  _b 
)
inline

Construct a new basic color object.

Parameters
_rThe red vaule
_gThe green vaule
_bThe blue vaule

◆ basic_color() [4/8]

template<typename T >
mn::math::basic_color< T >::basic_color ( value_type com)
inline

Construct a new basic color object.

Parameters
coma array of the rgba color

◆ basic_color() [5/8]

template<typename T >
mn::math::basic_color< T >::basic_color ( const int  _r,
const int  _g,
const int  _b 
)
inline

Construct a new basic color object.

Parameters
_rThe red value an int 0-255
_gThe green value an int 0-255
_bThe blue value an int 0-255

◆ basic_color() [6/8]

template<typename T >
mn::math::basic_color< T >::basic_color ( const int  _r,
const int  _g,
const int  _b,
const int  _a 
)
inline

Construct a new basic color object.

Parameters
_rThe red value an int 0-255
_gThe green value an int 0-255
_bThe blue value an int 0-255
_aThe alpha value an int 0-255

◆ basic_color() [7/8]

template<typename T >
mn::math::basic_color< T >::basic_color ( const int *  pComponent)
inline

Construct a new basic color object.

Parameters
pComponenta array of the rgba color as in [RRRGGGBBBAAA]

◆ basic_color() [8/8]

template<typename T >
mn::math::basic_color< T >::basic_color ( const int  c)
inline

Construct a new basic color object.

Member Function Documentation

◆ operator T*()

template<typename T >
mn::math::basic_color< T >::operator T* ( )
inline

◆ operator unsigned long()

template<typename T >
mn::math::basic_color< T >::operator unsigned long ( )
inline

◆ operator*=() [1/2]

template<typename T >
self_type& mn::math::basic_color< T >::operator*= ( const self_type c)
inline

◆ operator*=() [2/2]

template<typename T >
self_type& mn::math::basic_color< T >::operator*= ( const value_type  f)
inline

◆ operator+=()

template<typename T >
self_type& mn::math::basic_color< T >::operator+= ( const self_type c)
inline

◆ operator-=()

template<typename T >
self_type& mn::math::basic_color< T >::operator-= ( const self_type c)
inline

◆ operator/=() [1/2]

template<typename T >
self_type& mn::math::basic_color< T >::operator/= ( const self_type c)
inline

◆ operator/=() [2/2]

template<typename T >
self_type& mn::math::basic_color< T >::operator/= ( const value_type  f)
inline

◆ operator=()

template<typename T >
self_type& mn::math::basic_color< T >::operator= ( const self_type c)
inline

◆ to_string()

template<typename T >
virtual mn::string mn::math::basic_color< T >::to_string ( )
inlinevirtual

Member Data Documentation

◆ 

union { ... }

◆ colorcon

template<typename T >
constexpr double mn::math::basic_color< T >::colorcon = 0.003921568627450980392156862745098
staticconstexprprivate

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