Marsyas  0.6.0-alpha
/usr/src/RPM/BUILD/marsyas-0.6.0/src/marsyas/Color.cpp
Go to the documentation of this file.
00001 /*
00002 ** Copyright (C) 1998-2005 George Tzanetakis <gtzan@cs.uvic.ca>
00003 **
00004 ** This program is free software; you can redistribute it and/or modify
00005 ** it under the terms of the GNU General Public License as published by
00006 ** the Free Software Foundation; either version 2 of the License, or
00007 ** (at your option) any later version.
00008 **
00009 ** This program is distributed in the hope that it will be useful,
00010 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 ** GNU General Public License for more details.
00013 **
00014 ** You should have received a copy of the GNU General Public License
00015 ** along with this program; if not, write to the Free Software
00016 ** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017 */
00018 
00019 
00020 #include "Color.h"
00021 
00022 using namespace Marsyas;
00023 
00024 Color::Color()
00025 {
00026   red_ = 0.5;
00027   green_ = 0.5;
00028   blue_ = 0.5;
00029 }
00030 
00031 Color::~Color()
00032 {
00033 }
00034 
00035 Color::Color(float r, float g, float b)
00036 {
00037   red_ = r;
00038   green_ = g;
00039   blue_ = b;
00040 }
00041 
00042 
00043 void
00044 Color::setRGB(float r, float g, float b)
00045 {
00046   red_ = r;
00047   green_ = g;
00048   blue_ = b;
00049 }
00050 
00051 
00052 void
00053 Color::setR()
00054 {
00055   red_ = 1.0;
00056   green_ = 0.0;
00057   blue_ = 0.0;
00058 }
00059 
00060 
00061 void
00062 Color::setG()
00063 {
00064   red_ = 0.0;
00065   green_ = 1.0;
00066   blue_ = 0.0;
00067 }
00068 
00069 void
00070 Color::setB()
00071 {
00072   red_ = 0.0;
00073   green_ = 0.0;
00074   blue_ = 1.0;
00075 }
00076 
00077 
00078 float
00079 Color::getR()
00080 {
00081   return red_;
00082 }
00083 
00084 
00085 float
00086 Color::getG()
00087 {
00088   return green_;
00089 }
00090 
00091 float
00092 Color::getB()
00093 {
00094   return blue_;
00095 }