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

color.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           color.h  -  description
00003                              -------------------
00004     begin                : Tue Sep 11 2001
00005     copyright            : (C) 2001 by T Kontkanen
00006     email                : tkontkanen@mail.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018 #ifndef COLOR_H
00019 #define COLOR_H
00020 
00021 
00026 class Color {
00027 public:
00029     Color( float r=1, float g=1, float b=1, float a=1 );
00031     Color( float *color );
00033     ~Color();
00034     
00036     void set( float r=-1, float g=-1, float b=-1, float a=-1 );
00038     void set( float *color );
00040     const float* RGBA() { return rgba; }
00041     
00043     float r() { return rgba[0]; }
00045     float g() { return rgba[1]; }
00047     float b() { return rgba[2]; }
00049     float a() { return rgba[3]; }
00050     
00052     Color operator*(const Color &c);
00054     Color operator+(const Color &c);
00056     Color operator-(const Color &c);
00058     Color operator=(const Color& c);
00059     
00060 private:
00062     void clamp();
00063     float rgba[4];
00064 };
00065 
00066 #endif

Generated at Fri Oct 5 20:23:52 2001 for Executor by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001