SOFA API  3944ba52
Open source framework for multi-physics simuation
sofa::helper::types::RGBAColor Class Reference

#include <RGBAColor.h>

encode a 4 RGBA component color More...

Inheritance diagram for sofa::helper::types::RGBAColor:

Detailed Description

encode a 4 RGBA component color

Public Member Functions

floatr ()
 
floatg ()
 
floatb ()
 
floata ()
 
const floatr () const
 
const floatg () const
 
const floatb () const
 
const floata () const
 
void r (const float r)
 
void g (const float g)
 
void b (const float b)
 
void a (const float a)
 
void set (float r, float g, float b, float a)
 
bool operator== (const fixed_array< float, 4 > &b) const
 
bool operator!= (const fixed_array< float, 4 > &b) const
 
 RGBAColor ()
 
 RGBAColor (const fixed_array< float, 4 > &)
 
 RGBAColor (const float r, const float g, const float b, const float a)
 
- Public Member Functions inherited from sofa::helper::fixed_array< T, N >
 fixed_array ()
 
template<int NN = N, typename std::enable_if< NN==1, int >::type = 0>
 fixed_array (value_type r1)
 Specific constructor for 1-element vectors. More...
 
template<int NN = N, typename std::enable_if< NN==2, int >::type = 0>
 fixed_array (value_type r1, value_type r2)
 Specific constructor for 2-elements vectors. More...
 
template<int NN = N, typename std::enable_if< NN==3, int >::type = 0>
 fixed_array (value_type r1, value_type r2, value_type r3)
 Specific constructor for 3-elements vectors. More...
 
template<int NN = N, typename std::enable_if< NN==4, int >::type = 0>
 fixed_array (value_type r1, value_type r2, value_type r3, value_type r4)
 Specific constructor for 4-elements vectors. More...
 
template<int NN = N, typename std::enable_if< NN==5, int >::type = 0>
 fixed_array (value_type r1, value_type r2, value_type r3, value_type r4, value_type r5)
 Specific constructor for 5-elements vectors. More...
 
template<int NN = N, typename std::enable_if< NN==6, int >::type = 0>
 fixed_array (value_type r1, value_type r2, value_type r3, value_type r4, value_type r5, value_type r6)
 Specific constructor for 6-elements vectors. More...
 
template<int NN = N, typename std::enable_if< NN==7, int >::type = 0>
 fixed_array (value_type r1, value_type r2, value_type r3, value_type r4, value_type r5, value_type r6, value_type r7)
 Specific constructor for 7-elements vectors. More...
 
template<int NN = N, typename std::enable_if< NN==8, int >::type = 0>
 fixed_array (value_type r1, value_type r2, value_type r3, value_type r4, value_type r5, value_type r6, value_type r7, value_type r8)
 Specific constructor for 8-elements vectors. More...
 
template<int NN = N, typename std::enable_if< NN==9, int >::type = 0>
 fixed_array (value_type r1, value_type r2, value_type r3, value_type r4, value_type r5, value_type r6, value_type r7, value_type r8, value_type r9)
 Specific constructor for 9-elements vectors. More...
 
template<int NN = N, typename std::enable_if< NN==10, int >::type = 0>
 fixed_array (value_type r1, value_type r2, value_type r3, value_type r4, value_type r5, value_type r6, value_type r7, value_type r8, value_type r9, value_type r10)
 Specific constructor for 10-elements vectors. More...
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
reference operator[] (size_type i)
 
const_reference operator[] (size_type i) const
 
reference at (size_type i)
 
const_reference at (size_type i) const
 
reference front ()
 
const_reference front () const
 
reference back ()
 
const_reference back () const
 
void swap (fixed_array< T, N > &y)
 
const T * data () const
 
const Arrayarray () const
 direct access to array More...
 
Arrayarray ()
 direct access to array More...
 
template<typename T2 >
fixed_array< T, N > & operator= (const fixed_array< T2, N > &rhs)
 
void assign (const T &value)
 
bool operator< (const fixed_array &v) const
 

Static Public Member Functions

static RGBAColor fromString (const std::string &str)
 
static RGBAColor fromFloat (const float r, const float g, const float b, const float a)
 
static RGBAColor fromVec4 (const fixed_array< float, 4 > &color)
 
static RGBAColor fromVec4 (const fixed_array< double, 4 > &color)
 
static RGBAColor fromHSVA (float h, float s, float v, float a)
 
static bool read (const std::string &str, RGBAColor &color)
 
static RGBAColor white ()
 
static RGBAColor black ()
 
static RGBAColor red ()
 
static RGBAColor green ()
 
static RGBAColor blue ()
 
static RGBAColor cyan ()
 
static RGBAColor magenta ()
 
static RGBAColor yellow ()
 
static RGBAColor gray ()
 
static RGBAColor lightgray ()
 
static RGBAColor darkgray ()
 
static RGBAColor lighten (const RGBAColor &in, const SReal factor)
 enlight a color by a given factor. More...
 
- Static Public Member Functions inherited from sofa::helper::fixed_array< T, N >
static size_type size ()
 
static bool empty ()
 
static size_type max_size ()
 

Friends

SOFA_HELPER_API std::ostream & operator<< (std::ostream &i, const RGBAColor &t)
 Write to an output stream. More...
 
SOFA_HELPER_API std::istream & operator>> (std::istream &i, RGBAColor &t)
 

Additional Inherited Members

- Public Attributes inherited from sofa::helper::fixed_array< T, N >
elems [N]
 

Constructor details

sofa::helper::types::RGBAColor::RGBAColor ( )
sofa::helper::types::RGBAColor::RGBAColor ( const fixed_array< float, 4 > &  c)
sofa::helper::types::RGBAColor::RGBAColor ( const float  r,
const float  g,
const float  b,
const float  a 
)

Function details

float& sofa::helper::types::RGBAColor::a ( )
inline
const float& sofa::helper::types::RGBAColor::a ( ) const
inline
void sofa::helper::types::RGBAColor::a ( const float  a)
inline
float& sofa::helper::types::RGBAColor::b ( )
inline
const float& sofa::helper::types::RGBAColor::b ( ) const
inline
void sofa::helper::types::RGBAColor::b ( const float  b)
inline
static RGBAColor sofa::helper::types::RGBAColor::black ( )
inlinestatic
static RGBAColor sofa::helper::types::RGBAColor::blue ( )
inlinestatic
static RGBAColor sofa::helper::types::RGBAColor::cyan ( )
inlinestatic
static RGBAColor sofa::helper::types::RGBAColor::darkgray ( )
inlinestatic
RGBAColor sofa::helper::types::RGBAColor::fromFloat ( const float  r,
const float  g,
const float  b,
const float  a 
)
static
RGBAColor sofa::helper::types::RGBAColor::fromHSVA ( float  h,
float  s,
float  v,
float  a 
)
static
RGBAColor sofa::helper::types::RGBAColor::fromString ( const std::string &  str)
static
RGBAColor sofa::helper::types::RGBAColor::fromVec4 ( const fixed_array< float, 4 > &  color)
static
RGBAColor sofa::helper::types::RGBAColor::fromVec4 ( const fixed_array< double, 4 > &  color)
static
float& sofa::helper::types::RGBAColor::g ( )
inline
const float& sofa::helper::types::RGBAColor::g ( ) const
inline
void sofa::helper::types::RGBAColor::g ( const float  g)
inline
static RGBAColor sofa::helper::types::RGBAColor::gray ( )
inlinestatic
static RGBAColor sofa::helper::types::RGBAColor::green ( )
inlinestatic
RGBAColor sofa::helper::types::RGBAColor::lighten ( const RGBAColor in,
const SReal  factor 
)
static

enlight a color by a given factor.

static RGBAColor sofa::helper::types::RGBAColor::lightgray ( )
inlinestatic
static RGBAColor sofa::helper::types::RGBAColor::magenta ( )
inlinestatic
bool sofa::helper::types::RGBAColor::operator!= ( const fixed_array< float, 4 > &  b) const
inline
bool sofa::helper::types::RGBAColor::operator== ( const fixed_array< float, 4 > &  b) const
inline
float& sofa::helper::types::RGBAColor::r ( )
inline
const float& sofa::helper::types::RGBAColor::r ( ) const
inline
void sofa::helper::types::RGBAColor::r ( const float  r)
inline
bool sofa::helper::types::RGBAColor::read ( const std::string &  str,
RGBAColor color 
)
static
static RGBAColor sofa::helper::types::RGBAColor::red ( )
inlinestatic
void sofa::helper::types::RGBAColor::set ( float  r,
float  g,
float  b,
float  a 
)
static RGBAColor sofa::helper::types::RGBAColor::white ( )
inlinestatic
static RGBAColor sofa::helper::types::RGBAColor::yellow ( )
inlinestatic

Related details

SOFA_HELPER_API std::ostream& operator<< ( std::ostream &  i,
const RGBAColor t 
)
friend

Write to an output stream.

SOFA_HELPER_API std::istream& operator>> ( std::istream &  i,
RGBAColor t 
)
friend