00001
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
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
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 }
00129 #endif // NL_PS_COLOR_H
00130
00131