Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

IGColor.h

Go to the documentation of this file.
00001 /* $Id: IGColor.h,v 1.1 2001/05/27 15:25:28 formella Exp $ */
00002 
00003 /*
00004  *  Copyright (C) 2001, Dr. Arno Formella
00005  *                      Universidade de Vigo
00006  *                      Departamento de Informatica
00007  *
00008  *  This program is free software; you can redistribute it and/or modify
00009  *  it under the terms of the GNU General Public License as published by
00010  *  the Free Software Foundation; either version 2 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  This program is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  *  GNU General Public License
00017  *          http://www.gnu.ai.mit.edu/copyleft/gpl.html
00018  *  for more details.
00019  */
00020 
00021 #ifndef IGCOLOR_H
00022 #define IGCOLOR_H
00023 
00024 #include <fstream.h>
00025 #include <GL/glut.h>
00026 
00027 class IGColor {
00028 private:
00030   double red;
00032   double green;
00034   double blue;
00035 
00037   double Clamp(double v) const;
00038 public:
00041   IGColor(double gray=0.0);
00043   IGColor(double r, double g, double b);
00044   IGColor(const IGColor& C);
00045   ~IGColor();
00046   void SetColor(void) const;
00047   IGColor& operator=(const IGColor& C);
00049   double  Red(void) const { return red; }
00051   double& Red(void) { return red; }
00053   double  Green(void) const { return green; }
00055   double& Green(void) { return green; }
00057   double  Blue(void) const { return blue; }
00059   double& Blue(void) { return blue; }
00060 
00063   friend istream& operator>>(istream& in, IGColor& C);
00066   friend ostream& operator<<(ostream& out, const IGColor& C);
00067 };
00068 
00069 #endif

Generated at Wed May 30 11:16:28 2001 for Computer Graphics Course by doxygen1.1.5 written by Dimitri van Heesch, © 1997-2000