#include <OMKColor.h>
Collaboration diagram for OMK::Type::Color:
operators | |
Color & | operator= (const Color &color) |
Color & | operator= (float v[4]) |
float & | operator[] (int i) |
float | operator[] (int i) const |
OMK_API bool | operator== (const Color &c0, const Color &c1) |
equality operator | |
OMK_API bool | operator!= (const Color &c0, const Color &c1) |
inequality operator | |
Public Member Functions | |
Get accessors | |
float | getR () const |
Get the red component of the color. | |
float | getG () const |
Get the green component of the color. | |
float | getB () const |
Get the blue component of the color. | |
float | getA () const |
Get the alpha channel of the color. | |
Set accessors | |
void | setR (float r) |
Set the red component of the color. | |
void | setG (float g) |
Set the green component of the color. | |
void | setB (float b) |
Set the blue component of the color. | |
void | setA (float a) |
Set the alpha channel of the color. | |
Private Member Functions | |
void | _copy (const Color &color) |
copy, for constructor and operator | |
Private Attributes | |
float | _array [4] |
vecor of 4 float | |
Friends | |
Friend stream operators. | |
std::ostream & | operator<< (std::ostream &out, const Color &color) |
stream operator for ostream. | |
std::istream & | operator>> (std::istream &in, Color &color) |
stream operator for istream. | |
OMK::OutgoingSynchronisationMessage & | operator<< (OMK::OutgoingSynchronisationMessage &out, const Color &color) |
stream operator for OutgoingSynchronisationMessage. | |
OMK::IncomingSynchronisationMessage & | operator>> (OMK::IncomingSynchronisationMessage &in, Color &color) |
stream operator for IncomingSynchronisationMessage. |
The color is a array of Red, Green, Blue components plus Alpha channel (transparency). The set for each value is between 0 and 1.
black [0 0 0] white [1 1 1] withAlpha [0.4 0.3 1.0 .5] fullGreen [255 0 0] darkGreen [0.5 0 0]
withAlpha "0.4 0.3 1.0 .5"
Definition at line 82 of file OMKColor.h.
Color::Color | ( | ) |
Color::Color | ( | const Color & | color | ) |
Copy constructor.
Definition at line 38 of file OMKColor.cpp.
References _copy().
00039 { 00040 _copy( color ) ; 00041 }
Color::Color | ( | float | r, | |
float | g, | |||
float | b, | |||
float | a = 1.0f | |||
) |
Color::~Color | ( | ) | [virtual] |
Color::Color | ( | ) |
Color::Color | ( | const Color & | color | ) |
Copy constructor.
Definition at line 38 of file OMKColor.cpp.
References _copy().
00039 { 00040 _copy( color ) ; 00041 }
Color::Color | ( | float | r, | |
float | g, | |||
float | b, | |||
float | a = 1.0f | |||
) |
Color::~Color | ( | ) | [virtual] |
float OMK::Type::Color::getR | ( | ) | const [inline] |
Get the red component of the color.
Definition at line 102 of file OMKColor.h.
Referenced by OMK::ParametersAccessor::setValue().
00102 { return _array[0] ; }
float OMK::Type::Color::getG | ( | ) | const [inline] |
Get the green component of the color.
Definition at line 105 of file OMKColor.h.
Referenced by OMK::ParametersAccessor::setValue().
00105 { return _array[1] ; }
float OMK::Type::Color::getB | ( | ) | const [inline] |
Get the blue component of the color.
Definition at line 108 of file OMKColor.h.
Referenced by OMK::ParametersAccessor::setValue().
00108 { return _array[2] ; }
float OMK::Type::Color::getA | ( | ) | const [inline] |
Get the alpha channel of the color.
Definition at line 111 of file OMKColor.h.
Referenced by OMK::ParametersAccessor::setValue().
00111 { return _array[3] ; }
void OMK::Type::Color::setR | ( | float | r | ) | [inline] |
Set the red component of the color.
[in] | r | is the red component of the color in set [0, 1] |
Definition at line 118 of file OMKColor.h.
00118 { _array[0] = r ; }
void OMK::Type::Color::setG | ( | float | g | ) | [inline] |
Set the green component of the color.
[in] | g | is the green component of the color in set [0, 1] |
Definition at line 121 of file OMKColor.h.
00121 { _array[1] = g ; }
void OMK::Type::Color::setB | ( | float | b | ) | [inline] |
Set the blue component of the color.
[in] | b | is the blue component of the color in set [0, 1] |
Definition at line 124 of file OMKColor.h.
00124 { _array[2] = b ; }
void OMK::Type::Color::setA | ( | float | a | ) | [inline] |
Set the alpha channel of the color.
[in] | a | is the alpha channel of the color in set [0, 1] |
Definition at line 127 of file OMKColor.h.
00127 { _array[3] = a ; }
Definition at line 135 of file OMKColor.h.
00135 { if ( this != &color ) _copy( color ) ; return *this ; }
Color & Color::operator= | ( | float | v[4] | ) |
Definition at line 55 of file OMKColor.cpp.
References _array.
00056 { 00057 for ( int i = 0 ; i < 4 ; i++ ) 00058 { 00059 _array[i] = values[i] ; 00060 } 00061 return * this ; 00062 }
float& OMK::Type::Color::operator[] | ( | int | i | ) | [inline] |
float OMK::Type::Color::operator[] | ( | int | i | ) | const [inline] |
void Color::_copy | ( | const Color & | color | ) | [private] |
std::ostream& operator<< | ( | std::ostream & | out, | |
const Color & | color | |||
) | [friend] |
stream operator for ostream.
Use by OMK::Type::SimpleTypeT::insertInStream.
Definition at line 110 of file OMKColor.cpp.
00111 { 00112 for( int i = 0 ; i < 4 ; i++ ) 00113 { 00114 out << color._array[i] << " " ; 00115 } 00116 return out ; 00117 }
std::istream& operator>> | ( | std::istream & | in, | |
Color & | color | |||
) | [friend] |
stream operator for istream.
Use by OMK::Type::SimpleTypeT::extract.
Definition at line 101 of file OMKColor.cpp.
00102 { 00103 for ( int i = 0 ; i < 4 ; i++ ) 00104 { 00105 in >> color._array[i] ; 00106 } 00107 return in ; 00108 }
OMK::OutgoingSynchronisationMessage& operator<< | ( | OMK::OutgoingSynchronisationMessage & | out, | |
const Color & | color | |||
) | [friend] |
stream operator for OutgoingSynchronisationMessage.
Use by OMK::Type::SimpleTypeT::pack.
Definition at line 95 of file OMKColor.cpp.
OMK::IncomingSynchronisationMessage& operator>> | ( | OMK::IncomingSynchronisationMessage & | in, | |
Color & | color | |||
) | [friend] |
stream operator for IncomingSynchronisationMessage.
Use by OMK::Type::SimpleTypeT::unpack.
Definition at line 88 of file OMKColor.cpp.
float OMK::Type::Color::_array[4] [private] |
vecor of 4 float
Definition at line 165 of file OMKColor.h.
Referenced by _copy(), Color(), operator<<(), operator=(), OMK::Type::operator==(), and operator>>().
Documentation generated on Mon Jun 9 11:46:05 2008 |
Generated with doxygen by Dimitri van Heesch , 1997-2007 |