Main Page | Class List | Directories | File List | Class Members | File Members | Related Pages

rColor Class Reference

#include <rcolor.h>

List of all members.

Public Member Functions

 rColor ()
 rColor (int h, int s, int v, int a=255)
rColoroperator= (const rColor &)
bool operator== (const rColor &c) const
void setHSV (int, int, int)
void setRGB (int, int, int)
void setAlpha (int a)
void getHSV (int *, int *, int *) const
void getRGB (int *, int *, int *)
int getAlpha () const
int gray ()
unsigned int rgb ()

Private Member Functions

void normalizeHSV (int *, int *, int *)
void createRGB ()

Private Attributes

int hue
int sat
int val
int red
int green
int blue
int alpha
bool dirty


Detailed Description

This class was created to hold HSV values at a better resolution than this is possible with QColor. It can however be used for RGB values also, but in this it is significantly slower than QColor.


Constructor & Destructor Documentation

rColor::rColor  ) 
 

This constructor takes no arguments and sets the current color to an opaque white.

Here is the call graph for this function:

rColor::rColor int  h,
int  s,
int  v,
int  a = 255
 

Here is the call graph for this function:


Member Function Documentation

void rColor::createRGB  )  [private]
 

Converts the current color to an RGB triple.

int rColor::getAlpha  )  const [inline]
 

void rColor::getHSV int *  h,
int *  s,
int *  v
const
 

Returns the current values for hue, saturation, and value in the parameters.

void rColor::getRGB int *  r,
int *  g,
int *  b
 

Returns the RGB triple for the current color.

Here is the call graph for this function:

int rColor::gray  ) 
 

Returns a gray value based on the current color in the range of 0 ... 255.

Here is the call graph for this function:

void rColor::normalizeHSV int *  ,
int *  ,
int * 
[private]
 

rColor & rColor::operator= const rColor c  ) 
 

Copies the values for hue, saturation and value from c. If the values for red, green and blue are useable, they are copied too. If not, only the corresponding flag dirty is set.

bool rColor::operator== const rColor c  )  const [inline]
 

Returns true if the components hue, saturation, value and alpha of the compared rColors are the same.

unsigned int rColor::rgb  ) 
 

Returns a pixel value for the current color, including alpha value.

Here is the call graph for this function:

void rColor::setAlpha int  a  )  [inline]
 

void rColor::setHSV int  h,
int  s,
int  v
 

Sets the current color to a new HSV triple.

Here is the call graph for this function:

void rColor::setRGB int  r,
int  g,
int  b
 

Sets the current color to the values provided for r, g, and b.


Member Data Documentation

int rColor::alpha [private]
 

int rColor::blue [private]
 

bool rColor::dirty [private]
 

int rColor::green [private]
 

int rColor::hue [private]
 

int rColor::red [private]
 

int rColor::sat [private]
 

int rColor::val [private]
 


The documentation for this class was generated from the following files:
Go back to rwm - the window manager's - Home page.
created 13 Jun 2005 for colordlg $Revision:1.1$ by Rolf C. Rönnau using doxygen 1.4.2