WPSColor Struct Reference

the class to store a color More...

#include <libwps_internal.h>

List of all members.

Public Member Functions

 WPSColor (uint32_t argb=0)
 constructor
 WPSColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
 constructor from color
WPSColoroperator= (uint32_t argb)
 operator=
uint32_t value () const
 return the rgba value
unsigned char getAlpha () const
 returns the alpha value
unsigned char getBlue () const
 returns the green value
unsigned char getRed () const
 returns the red value
unsigned char getGreen () const
 returns the green value
bool isBlack () const
 return true if the color is black
bool isWhite () const
 return true if the color is white
bool operator== (WPSColor const &c) const
 operator==
bool operator!= (WPSColor const &c) const
 operator!=
bool operator< (WPSColor const &c) const
 operator<
bool operator<= (WPSColor const &c) const
 operator<=
bool operator> (WPSColor const &c) const
 operator>
bool operator>= (WPSColor const &c) const
 operator>=
std::string str () const
 print the color in the form #rrggbb

Static Public Member Functions

static WPSColor black ()
 return the back color
static WPSColor white ()
 return the white color
static WPSColor barycenter (float alpha, WPSColor const &colA, float beta, WPSColor const &colB)
 return alpha*colA+beta*colB

Protected Attributes

uint32_t m_value
 the argb color

Friends

std::ostream & operator<< (std::ostream &o, WPSColor const &c)
 operator<< in the form #rrggbb

Detailed Description

the class to store a color


Constructor & Destructor Documentation

WPSColor::WPSColor ( uint32_t  argb = 0) [inline]

constructor

Referenced by black(), and white().

WPSColor::WPSColor ( unsigned char  r,
unsigned char  g,
unsigned char  b,
unsigned char  a = 255 
) [inline]

constructor from color


Member Function Documentation

unsigned char WPSColor::getAlpha ( ) const [inline]

returns the alpha value

unsigned char WPSColor::getBlue ( ) const [inline]

returns the green value

unsigned char WPSColor::getGreen ( ) const [inline]

returns the green value

unsigned char WPSColor::getRed ( ) const [inline]

returns the red value

bool WPSColor::isBlack ( ) const [inline]

return true if the color is black

Referenced by operator<<().

bool WPSColor::operator!= ( WPSColor const &  c) const [inline]

operator!=

bool WPSColor::operator< ( WPSColor const &  c) const [inline]

operator<

Referenced by operator>=().

bool WPSColor::operator<= ( WPSColor const &  c) const [inline]

operator<=

Referenced by operator>().

WPSColor& WPSColor::operator= ( uint32_t  argb) [inline]

operator=

bool WPSColor::operator== ( WPSColor const &  c) const [inline]

operator==

Referenced by operator!=().

bool WPSColor::operator> ( WPSColor const &  c) const [inline]

operator>

bool WPSColor::operator>= ( WPSColor const &  c) const [inline]

operator>=

std::string WPSColor::str ( ) const
uint32_t WPSColor::value ( ) const [inline]

return the rgba value


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  o,
WPSColor const &  c 
) [friend]

operator<< in the form #rrggbb


Member Data Documentation


The documentation for this struct was generated from the following files: