STOFFColor Struct Reference

the class to store a color More...

#include <libstaroffice_internal.hxx>

List of all members.

Public Member Functions

 STOFFColor (uint32_t argb=0)
 constructor
 STOFFColor (unsigned char r, unsigned char g, unsigned char b, unsigned char a=255)
 constructor from color
STOFFColoroperator= (uint32_t argb)
 operator=
uint32_t value () const
 return the rgba value
unsigned char getAlpha () const
 returns the alpha value
void setAlpha (unsigned char alpha)
 reset 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== (STOFFColor const &c) const
 operator==
bool operator!= (STOFFColor const &c) const
 operator!=
bool operator< (STOFFColor const &c) const
 operator<
bool operator<= (STOFFColor const &c) const
 operator<=
bool operator> (STOFFColor const &c) const
 operator>
bool operator>= (STOFFColor const &c) const
 operator>=
std::string str () const
 print the color in the form #rrggbb

Static Public Member Functions

static STOFFColor colorFromCMYK (unsigned char c, unsigned char m, unsigned char y, unsigned char k)
 return a color from a cmyk color ( basic)
static STOFFColor colorFromHSL (unsigned char H, unsigned char S, unsigned char L)
 return a color from a hsl color (basic)
static STOFFColor black ()
 return the back color
static STOFFColor white ()
 return the white color
static STOFFColor barycenter (float alpha, STOFFColor const &colA, float beta, STOFFColor const &colB)
 return alpha*colA+beta*colB

Protected Attributes

uint32_t m_value
 the argb color

Friends

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

Detailed Description

the class to store a color


Constructor & Destructor Documentation

STOFFColor::STOFFColor ( uint32_t  argb = 0) [inline, explicit]

constructor

Referenced by barycenter(), black(), colorFromCMYK(), colorFromHSL(), and white().

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

constructor from color


Member Function Documentation

STOFFColor STOFFColor::barycenter ( float  alpha,
STOFFColor const &  colA,
float  beta,
STOFFColor const &  colB 
) [static]

return alpha*colA+beta*colB

Referenced by StarGraphicStruct::StarBrush::getColor().

static STOFFColor STOFFColor::black ( ) [inline, static]

return the back color

Referenced by StarCharAttribute::addInitTo(), and StarGraphicAttribute::addInitTo().

static STOFFColor STOFFColor::colorFromCMYK ( unsigned char  c,
unsigned char  m,
unsigned char  y,
unsigned char  k 
) [inline, static]

return a color from a cmyk color ( basic)

static STOFFColor STOFFColor::colorFromHSL ( unsigned char  H,
unsigned char  S,
unsigned char  L 
) [inline, static]

return a color from a hsl color (basic)

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

returns the alpha value

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

returns the green value

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

returns the green value

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

returns the red value

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

operator!=

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

operator<

Referenced by operator>=().

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

operator<=

Referenced by operator>().

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

operator=

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

operator==

Referenced by operator!=().

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

operator>

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

operator>=

void STOFFColor::setAlpha ( unsigned char  alpha) [inline]

reset the alpha value

uint32_t STOFFColor::value ( ) const [inline]

return the rgba value

Referenced by StarGraphicStruct::getBMPData().


Friends And Related Function Documentation

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

operator<< in the form #rrggbb


Member Data Documentation


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