src/rcrt/RGBAColor.h

Go to the documentation of this file.
00001 #ifndef RGBACOLOR_H_
00002 #define RGBACOLOR_H_
00003 
00004 #include "RGBColor.h"
00005 
00006 namespace rcrt
00007 {
00008 
00009 class RGBAColor
00010 {
00011 private:
00012         float values[4];
00013         void assign(const RGBAColor& col);
00014         
00015 public:
00016         RGBAColor();
00017         RGBAColor(float c, float a=1);
00018         RGBAColor(float r, float g, float b, float a=1);
00019         RGBAColor(const RGBAColor& col);
00020         RGBAColor(const RGBColor& col);
00021         virtual ~RGBAColor();
00022         
00023         const RGBAColor& operator= (const RGBAColor& col);
00024         
00025         RGBAColor operator+ (const RGBAColor& col) const;
00026         RGBAColor operator- (const RGBAColor& col) const;
00027         
00028         RGBAColor operator* (float f) const;
00029         RGBAColor operator/ (float f) const;
00030         
00031         RGBAColor blendAssoc(const RGBAColor& col);
00032         RGBAColor blendOver(const RGBAColor& col);
00033         
00034         float r() const;
00035         float g() const;
00036         float b() const;
00037         float a() const;
00038         
00039         float getLuminance() const;
00040         
00041         RGBColor getRGB() const;
00042         
00043 };
00044 
00045 inline std::ostream& operator<<(std::ostream& o, const RGBAColor& v)
00046 {
00047         o << "RGBAColor(" << v.r() << "," << v.g() << "," << v.b() << "," << v.a() << ")";
00048         return o;
00049 }
00050 
00051 }
00052 
00053 #endif /*RGBACOLOR_H_*/

Generated on Thu Jan 31 19:26:19 2008 for RenderingCompetitionRayTracer by  doxygen 1.5.3