Blender V5.0
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
11
12#include "Geom.h"
13
15
16#include "MEM_guardedalloc.h"
17
18using namespace std;
19
20namespace Freestyle {
21
22#define _NOISE_B 0x100
23
24using namespace Geometry;
25
27class Noise {
28 public:
30 Noise(long seed = -1);
31
33 ~Noise() {}
34
36 float turbulence1(float arg, float freq, float amp, uint oct = 4);
37
39 float turbulence2(Vec2f &v, float freq, float amp, uint oct = 4);
40
42 float turbulence3(Vec3f &v, float freq, float amp, uint oct = 4);
43
45 float smoothNoise1(float arg);
46
48 float smoothNoise2(Vec2f &vec);
49
51 float smoothNoise3(Vec3f &vec);
52
53 private:
54 int p[_NOISE_B + _NOISE_B + 2];
55 float g3[_NOISE_B + _NOISE_B + 2][3];
56 float g2[_NOISE_B + _NOISE_B + 2][2];
57 float g1[_NOISE_B + _NOISE_B + 2];
58 /* UNUSED */
59 // int start;
60
61 MEM_CXX_CLASS_ALLOC_FUNCS("Freestyle:Noise")
62};
63
64} /* namespace Freestyle */
unsigned int uint
Configuration definitions.
Vectors and Matrices (useful type definitions).
Read Guarded memory(de)allocation.
#define _NOISE_B
Definition Noise.h:22
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
Noise(long seed=-1)
Definition Noise.cpp:228
float smoothNoise2(Vec2f &vec)
Definition Noise.cpp:132
VecMat::Vec3< float > Vec3f
Definition Geom.h:28
VecMat::Vec2< float > Vec2f
Definition Geom.h:22
inherits from class Rep
Definition AppCanvas.cpp:20