00001
00002
00003
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 );
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