From 0ea5fc66924303d1bf73ba283a383e2aadee02f2 Mon Sep 17 00:00:00 2001 From: neodarz Date: Sat, 11 Aug 2018 20:21:34 +0200 Subject: Initial commit --- docs/doxygen/nel/a02989.html | 207 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 docs/doxygen/nel/a02989.html (limited to 'docs/doxygen/nel/a02989.html') diff --git a/docs/doxygen/nel/a02989.html b/docs/doxygen/nel/a02989.html new file mode 100644 index 00000000..8a1da1a8 --- /dev/null +++ b/docs/doxygen/nel/a02989.html @@ -0,0 +1,207 @@ + + +NeL: NLMISC::CNoiseColorGradient class Reference + + + +
+

NLMISC::CNoiseColorGradient Class Reference

#include <noise_value.h> +

+


Detailed Description

+A noisy color generator
Author:
Lionel Berenguier

+Nevrax France

+
Date:
2001
+ +

+ +

+Definition at line 89 of file noise_value.h. + + + + + + + + + + + + +

Public Member Functions

void eval (const CVector &posInWorld, CRGBAF &result) const
void serial (IStream &f)

Data Fields

std::vector< CRGBAFGradients
CNoiseValue NoiseValue
 Abs and Rand should be 0 and 1 here. If not, some colors may not be generated...

+


Member Function Documentation

+

+ + + + +
+ + + + + + + + + + + + + + + + + + + +
void NLMISC::CNoiseColorGradient::eval const CVector posInWorld,
CRGBAF result
const
+
+ + + + + +
+   + + +

+Use NoiseValue to compute a PerlinNoise E [0..1], and peek in Gradients, with linear interpolation. result unmodified if no colors. If only one color, copied into result. Warning! Use OptFastFloor()! So call must be enclosed with a OptFastFloorBegin()/OptFastFloorEnd(). +

+Definition at line 309 of file noise_value.cpp. +

+References NLMISC::clamp(), NLMISC::CNoiseValue::eval(), Gradients, NoiseValue, NLMISC::OptFastFloor(), and uint. +

+Referenced by NL3D::CVegetable::generateInstance(). +

+

00310 {
+00311         // test if not null grads.
+00312         uint    nGrads= Gradients.size();
+00313         if(nGrads==0)
+00314                 return;
+00315         // if only one color, easy
+00316         if(nGrads==1)
+00317         {
+00318                 result= Gradients[0];
+00319         }
+00320         else
+00321         {
+00322                 // eval noise
+00323                 float   f= NoiseValue.eval(posInWorld) * (nGrads-1);
+00324                 clamp(f, 0.f, (float)(nGrads-1));
+00325                 // look up in table of gradients.
+00326                 uint    id= OptFastFloor(f);
+00327                 clamp(id, 0U, nGrads-2);
+00328                 // fractionnal part.
+00329                 f= f-id;
+00330                 clamp(f, 0, 1);
+00331                 // interpolate the gradient.
+00332                 result= Gradients[id]*(1-f) + Gradients[id+1]*f;
+00333         }
+00334 }
+
+

+ + + + +
+ + + + + + + + + + +
void NLMISC::CNoiseColorGradient::serial IStream f  ) 
+
+ + + + + +
+   + + +

+ +

+Definition at line 337 of file noise_value.cpp. +

+References Gradients, NoiseValue, NLMISC::IStream::serial(), NLMISC::IStream::serialCont(), and NLMISC::IStream::serialVersion(). +

+

00338 {
+00339         (void)f.serialVersion(0);
+00340         f.serial(NoiseValue);
+00341         f.serialCont(Gradients);
+00342 }
+
+


Field Documentation

+

+ + + + +
+ + +
std::vector<CRGBAF> NLMISC::CNoiseColorGradient::Gradients +
+
+ + + + + +
+   + + +

+ +

+Definition at line 94 of file noise_value.h. +

+Referenced by eval(), and serial().

+

+ + + + +
+ + +
CNoiseValue NLMISC::CNoiseColorGradient::NoiseValue +
+
+ + + + + +
+   + + +

+Abs and Rand should be 0 and 1 here. If not, some colors may not be generated... +

+ +

+Definition at line 93 of file noise_value.h. +

+Referenced by eval(), and serial().

+


The documentation for this class was generated from the following files: +
Generated on Tue Mar 16 13:23:24 2004 for NeL by + +doxygen +1.3.6
+ + -- cgit v1.2.1