|
|
/*************************************************************************** vim:tabstop=4 couleur.h - description ------------------- begin : Sun Jul 1 2001 copyright : (C) 2001 by Francois Biot email : fbiot@free.fr *************************************************************************** * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * ***************************************************************************/ #ifndef _COULEUR_H_ #define _COULEUR_H_ class couleur; extern couleur col_black; extern couleur col_white; extern couleur col_red ; extern couleur col_green; extern couleur col_yellow; extern couleur col_blue; /** * Color definition in red/green/blue with alpha channel. */ class couleur { public: couleur(float r,float v,float b) : mr (r), mv (v), mb (b), ma (1.0) {}; couleur(float r,float v,float b,float a) : mr (r), mv (v), mb (b), ma (a) {}; couleur() : mr (0.5), mv (0.5), mb (0.9), ma (1.0) {}; couleur(const couleur& col,float alpha) : mr (col.mr), mv (col.mv), mb (col.mb), ma (alpha) {}; couleur operator*(const float f) { return couleur(mr*f,mv*f,mb*f); }; bool operator ==(const couleur &c) const { return (mr==c.mr) & (mv==c.mv) & (mb==c.mb) & (ma==c.ma); }; couleur* Duplicate() const; void Render() const ; private: float mr; // Red channel float mv; // Green channel float mb; // Blue channel float ma; // Alpha channel }; #endif
Generated by: saturn on FrancoisLinux on Sun Feb 3 20:01:44 2002, using kdoc 2.0a53. |