SOFA API  f9ead076
Open source framework for multi-physics simuation
sofa::type::RGBAColor Class Reference

#include <RGBAColor.h>

encode a 4 RGBA component color More...

Inheritance diagram for sofa::type::RGBAColor:

Detailed Description

encode a 4 RGBA component color

Public Member Functions

constexpr floatr ()
 
constexpr floatg ()
 
constexpr floatb ()
 
constexpr floata ()
 
constexpr const floatr () const
 
constexpr const floatg () const
 
constexpr const floatb () const
 
constexpr const floata () const
 
constexpr void r (const float r)
 
constexpr void g (const float g)
 
constexpr void b (const float b)
 
constexpr 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 operator* (float f) const
 
constexpr RGBAColor ()
 
constexpr RGBAColor (const fixed_array< float, 4 > &c)
 
constexpr RGBAColor (float r, float g, float b, float a)
 
- Public Member Functions inherited from sofa::type::fixed_array< float, 4 >
constexpr fixed_array ()
 
constexpr fixed_array (value_type r1) noexcept
 Specific constructor for 1-element vectors. More...
 
constexpr fixed_array (ArgsT &&... r) noexcept
 
constexpr iterator begin () noexcept
 
constexpr const_iterator begin () const noexcept
 
constexpr const_iterator cbegin () const noexcept
 
constexpr iterator end () noexcept
 
constexpr const_iterator end () const noexcept
 
constexpr const_iterator cend () const noexcept
 
constexpr reference operator[] (size_type i)
 
constexpr const_reference operator[] (size_type i) const
 
constexpr floatget () &noexcept
 
constexpr const floatget () const &noexcept
 
constexpr float && get () &&noexcept
 
constexpr const float && get () const &&noexcept
 
constexpr reference at (size_type i)
 
constexpr const_reference at (size_type i) const
 
constexpr reference front ()
 
constexpr const_reference front () const
 
constexpr reference back ()
 
constexpr const_reference back () const
 
void swap (fixed_array< float, N > &y)
 
constexpr const floatdata () const noexcept
 
constexpr const Arrayarray () const noexcept
 direct access to array More...
 
constexpr Arrayarray () noexcept
 direct access to array More...
 
constexpr fixed_array< float, N > & operator= (const fixed_array< T2, N > &rhs) noexcept
 
constexpr void assign (const float &value) noexcept
 

Static Public Member Functions

static RGBAColor fromString (const std::string &str)
 
static RGBAColor fromFloat (float r, float g, float b, 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)
 
constexpr static const RGBAColorwhite ()
 
constexpr static const RGBAColorblack ()
 
constexpr static const RGBAColorred ()
 
constexpr static const RGBAColorgreen ()
 
constexpr static const RGBAColorblue ()
 
constexpr static const RGBAColorcyan ()
 
constexpr static const RGBAColormagenta ()
 
constexpr static const RGBAColoryellow ()
 
constexpr static const RGBAColorgray ()
 
constexpr static const RGBAColordarkgray ()
 
constexpr static const RGBAColorlightgray ()
 
static RGBAColor lighten (const RGBAColor &in, const SReal factor)
 enlight a color by a given factor. More...
 
- Static Public Member Functions inherited from sofa::type::fixed_array< float, 4 >
static constexpr size_type size () noexcept
 
static bool empty () noexcept
 
static constexpr size_type max_size () noexcept
 

Friends

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

Additional Inherited Members

- Public Attributes inherited from sofa::type::fixed_array< float, 4 >
const typedef floatconst_iterator
 
const typedef floatconst_reference
 
float elems [N]
 

Constructor details

◆ RGBAColor() [1/3]

constexpr sofa::type::RGBAColor::RGBAColor ( )
inlineconstexpr

◆ RGBAColor() [2/3]

constexpr sofa::type::RGBAColor::RGBAColor ( const fixed_array< float, 4 > &  c)
inlineconstexpr

◆ RGBAColor() [3/3]

constexpr sofa::type::RGBAColor::RGBAColor ( float  r,
float  g,
float  b,
float  a 
)
inlineconstexpr

Function details

◆ a() [1/3]

constexpr float& sofa::type::RGBAColor::a ( )
inlineconstexpr

◆ a() [2/3]

constexpr const float& sofa::type::RGBAColor::a ( ) const
inlineconstexpr

◆ a() [3/3]

constexpr void sofa::type::RGBAColor::a ( const float  a)
inlineconstexpr

◆ b() [1/3]

constexpr float& sofa::type::RGBAColor::b ( )
inlineconstexpr

◆ b() [2/3]

constexpr const float& sofa::type::RGBAColor::b ( ) const
inlineconstexpr

◆ b() [3/3]

constexpr void sofa::type::RGBAColor::b ( const float  b)
inlineconstexpr

◆ black()

constexpr const RGBAColor & sofa::type::RGBAColor::black ( )
staticconstexpr

◆ blue()

constexpr const RGBAColor & sofa::type::RGBAColor::blue ( )
staticconstexpr

◆ cyan()

constexpr const RGBAColor & sofa::type::RGBAColor::cyan ( )
staticconstexpr

◆ darkgray()

constexpr const RGBAColor & sofa::type::RGBAColor::darkgray ( )
staticconstexpr

◆ fromFloat()

RGBAColor sofa::type::RGBAColor::fromFloat ( float  r,
float  g,
float  b,
float  a 
)
static

◆ fromHSVA()

RGBAColor sofa::type::RGBAColor::fromHSVA ( float  h,
float  s,
float  v,
float  a 
)
static

◆ fromString()

RGBAColor sofa::type::RGBAColor::fromString ( const std::string &  str)
static

◆ fromVec4() [1/2]

RGBAColor sofa::type::RGBAColor::fromVec4 ( const fixed_array< double, 4 > &  color)
static

◆ fromVec4() [2/2]

RGBAColor sofa::type::RGBAColor::fromVec4 ( const fixed_array< float, 4 > &  color)
static

◆ g() [1/3]

constexpr float& sofa::type::RGBAColor::g ( )
inlineconstexpr

◆ g() [2/3]

constexpr const float& sofa::type::RGBAColor::g ( ) const
inlineconstexpr

◆ g() [3/3]

constexpr void sofa::type::RGBAColor::g ( const float  g)
inlineconstexpr

◆ gray()

constexpr const RGBAColor & sofa::type::RGBAColor::gray ( )
staticconstexpr

◆ green()

constexpr const RGBAColor & sofa::type::RGBAColor::green ( )
staticconstexpr

◆ lighten()

RGBAColor sofa::type::RGBAColor::lighten ( const RGBAColor in,
const SReal  factor 
)
static

enlight a color by a given factor.

◆ lightgray()

constexpr const RGBAColor & sofa::type::RGBAColor::lightgray ( )
staticconstexpr

◆ magenta()

constexpr const RGBAColor & sofa::type::RGBAColor::magenta ( )
staticconstexpr

◆ operator!=()

bool sofa::type::RGBAColor::operator!= ( const fixed_array< float, 4 > &  b) const
inline

◆ operator*()

RGBAColor sofa::type::RGBAColor::operator* ( float  f) const

◆ operator==()

bool sofa::type::RGBAColor::operator== ( const fixed_array< float, 4 > &  b) const
inline

◆ r() [1/3]

constexpr float& sofa::type::RGBAColor::r ( )
inlineconstexpr

◆ r() [2/3]

constexpr const float& sofa::type::RGBAColor::r ( ) const
inlineconstexpr

◆ r() [3/3]

constexpr void sofa::type::RGBAColor::r ( const float  r)
inlineconstexpr

◆ read()

bool sofa::type::RGBAColor::read ( const std::string &  str,
RGBAColor color 
)
static

◆ red()

constexpr const RGBAColor & sofa::type::RGBAColor::red ( )
staticconstexpr

◆ set()

void sofa::type::RGBAColor::set ( float  r,
float  g,
float  b,
float  a 
)

◆ white()

constexpr const RGBAColor & sofa::type::RGBAColor::white ( )
staticconstexpr

◆ yellow()

constexpr const RGBAColor & sofa::type::RGBAColor::yellow ( )
staticconstexpr

Related details

◆ operator<<

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

Write to an output stream.

◆ operator>>

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