Welcome to mirror list, hosted at ThFree Co, Russian Federation.

PseudoNoise.h « system « intern « freestyle « blender « source - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fda1dd1d083e6bf62509cb331954eb0ca6a8847f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/* SPDX-License-Identifier: GPL-2.0-or-later */

#pragma once

/** \file
 * \ingroup freestyle
 * \brief Class to define a pseudo Perlin noise
 */

#include "Precision.h"

#ifdef WITH_CXX_GUARDEDALLOC
#  include "MEM_guardedalloc.h"
#endif

namespace Freestyle {

class PseudoNoise {
 public:
  virtual ~PseudoNoise()
  {
  }

  real smoothNoise(real x);
  real linearNoise(real x);

  real turbulenceSmooth(real x, unsigned nbOctave = 8);
  real turbulenceLinear(real x, unsigned nbOctave = 8);

  static void init(long seed);

 protected:
  static const unsigned NB_VALUE_NOISE = 512;
  static real _values[NB_VALUE_NOISE];

#ifdef WITH_CXX_GUARDEDALLOC
  MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:PseudoNoise")
#endif
};

} /* namespace Freestyle */