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

rcolor.h

Go to the documentation of this file.
00001 // $Id: rcolor.h,v 1.1 2005/06/13 13:18:03 rcr_muc Exp $
00002 // a color object that holds the rlevant values in hsv format
00003 // 2005-06-02 rcr
00004 
00005 #ifndef RCOLOR_H
00006 #define RCOLOR_H
00007 
00008 class rColor
00009 {
00010   int hue, sat, val;
00011   int red, green, blue, alpha;
00012   bool dirty;
00013 
00014   void normalizeHSV( int*, int*, int* );
00015   void createRGB();
00016 public:
00017   rColor();
00018   rColor( int h, int s, int v, int a = 255 ); // init hsv
00019   rColor &operator=( const rColor& );
00023   bool operator==( const rColor &c ) const { return
00024       hue == c.hue &&
00025       sat == c.sat &&
00026       val == c.val &&
00027       alpha == c.alpha; }
00028   void setHSV( int, int, int );
00029   void setRGB( int, int, int );
00030   void setAlpha( int a ) { alpha = a; };
00031   void getHSV( int*, int*, int* ) const;
00032   void getRGB( int*, int*, int* );
00033   int getAlpha() const { return alpha; }
00034   int gray();
00035   unsigned int rgb();
00036 };
00037 
00038 #endif // RCOLOR_H

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