00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _RGB_H
00012 #define _RGB_H
00013
00014
00015
00016 namespace columbia
00017 {
00018 class RGB
00019 {
00020 float rgb[3];
00021
00022 public:
00023 RGB(float r=0., float b=0., float g=0.) { rgb[0] = r; rgb[1] = g; rgb[2] = b; }
00024
00025 float& operator[](int idx) { return *(rgb+idx); }
00026 float operator[](int idx) const { return *(rgb+idx); }
00027
00028 RGB& operator*=(float scale) { for(int i=0; i<3; i++) rgb[i] *= scale; return *this; }
00029 RGB operator*(float scale) const { RGB ret(*this); return ret *= scale; }
00030 };
00031
00032
00033
00034 }
00035
00036
00037 #endif