# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

ps_color.h

Go to the documentation of this file.
00001 
00007 /* Copyright, 2001 Nevrax Ltd.
00008  *
00009  * This file is part of NEVRAX NEL.
00010  * NEVRAX NEL is free software; you can redistribute it and/or modify
00011  * it under the terms of the GNU General Public License as published by
00012  * the Free Software Foundation; either version 2, or (at your option)
00013  * any later version.
00014 
00015  * NEVRAX NEL is distributed in the hope that it will be useful, but
00016  * WITHOUT ANY WARRANTY; without even the implied warranty of
00017  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00018  * General Public License for more details.
00019 
00020  * You should have received a copy of the GNU General Public License
00021  * along with NEVRAX NEL; see the file COPYING. If not, write to the
00022  * Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
00023  * MA 02111-1307, USA.
00024  */
00025 
00026 #ifndef NL_PS_COLOR_H
00027 #define NL_PS_COLOR_H
00028 
00029 #include "nel/misc/types_nl.h"
00030 #include "3d/ps_attrib_maker_template.h"
00031 #include "3d/ps_attrib_maker_bin_op.h"
00032 #include "nel/misc/rgba.h"
00033 #include "nel/3d/animation_time.h"
00034 
00035 
00036 
00037 
00038 
00039 
00040 namespace NL3D {
00041 
00042 
00043 
00044 const char *CPSAttribMaker<NLMISC::CRGBA>::getType() { return "CRGBA"; }
00045 
00046 
00055 
00056 
00058 class CPSColorBlenderExact : public CPSValueBlender<NLMISC::CRGBA>
00059 {
00060 public:
00061         NLMISC_DECLARE_CLASS(CPSColorBlenderExact);
00062         CPSColorBlenderExact(NLMISC::CRGBA startColor = NLMISC::CRGBA::White , NLMISC::CRGBA endColor = NLMISC::CRGBA::Black, float nbCycles = 1.0f) : CPSValueBlender<NLMISC::CRGBA>(nbCycles)
00063         {
00064                 _F.setValues(startColor, endColor);
00065         }               
00066         CPSAttribMakerBase *clone() const { return new CPSColorBlenderExact(*this); }
00067 
00068 };
00069 
00070 
00071 
00072 // an int blender class that perform 64 color sample between colors, it is faster than CPSColorBlenderExact
00073 class CPSColorBlender : public CPSValueBlenderSample<NLMISC::CRGBA, 64>
00074 {
00075 public:
00076         NLMISC_DECLARE_CLASS(CPSColorBlender);
00077         CPSColorBlender(NLMISC::CRGBA startColor = NLMISC::CRGBA::White , NLMISC::CRGBA endColor = NLMISC::CRGBA::Black, float nbCycles = 1.0f) : CPSValueBlenderSample<NLMISC::CRGBA, 64>(nbCycles)
00078         {
00079                 _F.setValues(startColor, endColor);
00080         }               
00081         CPSAttribMakerBase *clone() const { return new CPSColorBlender(*this); }
00082 };
00083 
00084 
00085 
00087 class CPSColorGradient : public CPSValueGradient<NLMISC::CRGBA>
00088 {
00089 public:
00090         NLMISC_DECLARE_CLASS(CPSColorGradient);
00091 
00098         CPSColorGradient(const NLMISC::CRGBA *colorTab = CPSColorGradient::_DefaultGradient
00099                                                 , uint32 nbValues = 2, uint32 nbStages = 64, float nbCycles = 1.0f);
00100         static NLMISC::CRGBA _DefaultGradient[];        
00101         CPSAttribMakerBase *clone() const { return new CPSColorGradient(*this); }
00102 };
00103 
00104 
00109 class CPSColorMemory : public CPSAttribMakerMemory<NLMISC::CRGBA>
00110 {
00111 public:
00112         CPSColorMemory() { setDefaultValue(NLMISC::CRGBA::White); }
00113         NLMISC_DECLARE_CLASS(CPSColorMemory);
00114         CPSAttribMakerBase *clone() const { return new CPSColorMemory(*this); }
00115 };
00116 
00117 
00121 class CPSColorBinOp : public CPSAttribMakerBinOp<NLMISC::CRGBA>
00122 {
00123         public:
00124         NLMISC_DECLARE_CLASS(CPSColorBinOp);
00125         CPSAttribMakerBase *clone() const { return new CPSColorBinOp(*this); }
00126 };
00127 
00128 } // NL3D
00129 #endif // NL_PS_COLOR_H
00130 
00131 /* End of ps_color.h */