SpikeStream Library
0.2
|
00001 #include "RGBColor.h" 00002 using namespace spikestream; 00003 00004 //Declare and initialize static colors 00005 RGBColor RGBColor::BLACK = RGBColor(0.0f, 0.0f, 0.0f); 00006 00007 00009 RGBColor::RGBColor(){ 00010 this->red = 0.0f; 00011 this->green = 0.0f; 00012 this->blue = 0.0f; 00013 } 00014 00015 00017 RGBColor::RGBColor(float red, float green, float blue){ 00018 this->red = red; 00019 this->green = green; 00020 this->blue = blue; 00021 } 00022 00023 00025 RGBColor::RGBColor(const RGBColor& rgbColor){ 00026 this->red = rgbColor.red; 00027 this->green = rgbColor.green; 00028 this->blue = rgbColor.blue; 00029 } 00030 00031 00032 /*----------------------------------------------------------*/ 00033 /*------ PUBLIC METHODS ------*/ 00034 /*----------------------------------------------------------*/ 00035 00037 RGBColor& RGBColor::operator=(const RGBColor& rhs){ 00038 if(this == &rhs) 00039 return *this; 00040 00041 this->red = rhs.red; 00042 this->green = rhs.green; 00043 this->blue = rhs.blue; 00044 00045 return *this; 00046 } 00047 00048 00050 void RGBColor::set(float red, float green, float blue){ 00051 this->red = red; 00052 this->green = green; 00053 this->blue = blue; 00054 } 00055