Blender V4.3
Noise.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
12#include "Geom.h"
13
15
16#ifdef WITH_CXX_GUARDEDALLOC
17# include "MEM_guardedalloc.h"
18#endif
19
20using namespace std;
21
22namespace Freestyle {
23
24#define _NOISE_B 0x100
25
26using namespace Geometry;
27
29class Noise {
30 public:
32 Noise(long seed = -1);
33
35 ~Noise() {}
36
38 float turbulence1(float arg, float freq, float amp, uint oct = 4);
39
41 float turbulence2(Vec2f &v, float freq, float amp, uint oct = 4);
42
44 float turbulence3(Vec3f &v, float freq, float amp, uint oct = 4);
45
47 float smoothNoise1(float arg);
48
50 float smoothNoise2(Vec2f &vec);
51
53 float smoothNoise3(Vec3f &vec);
54
55 private:
56 int p[_NOISE_B + _NOISE_B + 2];
57 float g3[_NOISE_B + _NOISE_B + 2][3];
58 float g2[_NOISE_B + _NOISE_B + 2][2];
59 float g1[_NOISE_B + _NOISE_B + 2];
60 /* UNUSED */
61 // int start;
62
63#ifdef WITH_CXX_GUARDEDALLOC
64 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:Noise")
65#endif
66};
67
68} /* namespace Freestyle */
unsigned int uint
Configuration definitions.
Vectors and Matrices (useful type definitions)
Read Guarded memory(de)allocation.
#define _NOISE_B
Definition Noise.h:24
ATTR_WARN_UNUSED_RESULT const BMVert * v
static unsigned long seed
Definition btSoftBody.h:39
float turbulence3(Vec3f &v, float freq, float amp, uint oct=4)
Definition Noise.cpp:101
float turbulence1(float arg, float freq, float amp, uint oct=4)
Definition Noise.cpp:76
float turbulence2(Vec2f &v, float freq, float amp, uint oct=4)
Definition Noise.cpp:88
float smoothNoise3(Vec3f &vec)
Definition Noise.cpp:171
float smoothNoise1(float arg)
Definition Noise.cpp:116
float smoothNoise2(Vec2f &vec)
Definition Noise.cpp:132
inherits from class Rep
Definition AppCanvas.cpp:20