Perlin Noise Generator class.
More...
#include <perlin_noise.h>
|
virtual float | amplitude () const =0 |
| Get the amplitude of the perlin noise. More...
|
|
virtual PixelBufferPtr | create_noise1d (float start_x, float end_x)=0 |
| Create the perlin noise. More...
|
|
virtual PixelBufferPtr | create_noise2d (float start_x, float end_x, float start_y, float end_y)=0 |
| Create the perlin noise. More...
|
|
virtual PixelBufferPtr | create_noise3d (float start_x, float end_x, float start_y, float end_y, float z_position)=0 |
| Create the perlin noise. More...
|
|
virtual PixelBufferPtr | create_noise4d (float start_x, float end_x, float start_y, float end_y, float z_position, float w_position)=0 |
| Create the perlin noise. More...
|
|
virtual TextureFormat | format () const =0 |
| Get the format of the output pixelbuffer. More...
|
|
virtual int | octaves () const =0 |
| Get the number of octaves of the perlin noise. More...
|
|
virtual void | set_amplitude (float amplitude=1.0f)=0 |
| Set the amplitude of the perlin noise. More...
|
|
virtual void | set_format (TextureFormat texture_format=tf_rgb8)=0 |
| Set the format of the output pixelbuffer. More...
|
|
virtual void | set_octaves (int octaves=1)=0 |
| Set the number of octaves of the perlin noise. More...
|
|
virtual void | set_permutations (const unsigned char *table, unsigned int size=256)=0 |
| Set the permutation table. More...
|
|
void | set_size (int width=256, int height=256) |
| Set the size of the output pixelbuffer. More...
|
|
virtual void | set_size (const Size &size)=0 |
| Set the size of the output pixelbuffer. More...
|
|
virtual Size | size () const =0 |
| Get the size of the output pixelbuffer. More...
|
|
Perlin Noise Generator class.
virtual float uicore::PerlinNoise::amplitude |
( |
| ) |
const |
|
pure virtual |
Get the amplitude of the perlin noise.
static std::shared_ptr<PerlinNoise> uicore::PerlinNoise::create |
( |
| ) |
|
|
static |
virtual PixelBufferPtr uicore::PerlinNoise::create_noise1d |
( |
float |
start_x, |
|
|
float |
end_x |
|
) |
| |
|
pure virtual |
Create the perlin noise.
Remember to call set_size() with the height set to 1.
The period of these parameters are from 0 to 255
- Parameters
-
start_x | = Start x position of the noise |
end_x | = End x position of the noise |
start_y | = Start y position of the noise |
end_y | = End y position of the noise |
virtual PixelBufferPtr uicore::PerlinNoise::create_noise2d |
( |
float |
start_x, |
|
|
float |
end_x, |
|
|
float |
start_y, |
|
|
float |
end_y |
|
) |
| |
|
pure virtual |
Create the perlin noise.
The period of these parameters are from 0 to 255
- Parameters
-
start_x | = Start x position of the noise |
end_x | = End x position of the noise |
start_y | = Start y position of the noise |
end_y | = End y position of the noise |
virtual PixelBufferPtr uicore::PerlinNoise::create_noise3d |
( |
float |
start_x, |
|
|
float |
end_x, |
|
|
float |
start_y, |
|
|
float |
end_y, |
|
|
float |
z_position |
|
) |
| |
|
pure virtual |
Create the perlin noise.
The period of these parameters are from 0 to 255
- Parameters
-
start_x | = Start x position of the noise |
end_x | = End x position of the noise |
start_y | = Start y position of the noise |
end_y | = End y position of the noise |
z_position | = The z position of the noise |
virtual PixelBufferPtr uicore::PerlinNoise::create_noise4d |
( |
float |
start_x, |
|
|
float |
end_x, |
|
|
float |
start_y, |
|
|
float |
end_y, |
|
|
float |
z_position, |
|
|
float |
w_position |
|
) |
| |
|
pure virtual |
Create the perlin noise.
The period of these parameters are from 0 to 255
- Parameters
-
start_x | = Start x position of the noise |
end_x | = End x position of the noise |
start_y | = Start y position of the noise |
end_y | = End y position of the noise |
z_position | = The z position of the noise |
w_position | = The w position of the noise |
Get the format of the output pixelbuffer.
virtual int uicore::PerlinNoise::octaves |
( |
| ) |
const |
|
pure virtual |
Get the number of octaves of the perlin noise.
virtual void uicore::PerlinNoise::set_amplitude |
( |
float |
amplitude = 1.0f | ) |
|
|
pure virtual |
Set the amplitude of the perlin noise.
If this function is not used, the amplitude defaults to 1.0f
- Parameters
-
amplitude | = The amplitude to set |
Set the format of the output pixelbuffer.
If this function is not used, the format defaults to tf_rgb8
These following formats are supported:
tf_rgba8, tf_rgb8, tf_r8, tf_r32f
- Parameters
-
format | = The specified format |
virtual void uicore::PerlinNoise::set_octaves |
( |
int |
octaves = 1 | ) |
|
|
pure virtual |
Set the number of octaves of the perlin noise.
If this function is not used, the octaves count defaults to 1
- Parameters
-
octaves | = The number of octaves to set |
virtual void uicore::PerlinNoise::set_permutations |
( |
const unsigned char * |
table, |
|
|
unsigned int |
size = 256 |
|
) |
| |
|
pure virtual |
Set the permutation table.
If this function is not used, this class uses rand() to create a permutation table instead
- Parameters
-
table | = The permutation table |
size | = The permutation table size (2,4,8,16,32,64,128,256). Usually 256 (the maximum) unless a lower periodic table is required |
void uicore::PerlinNoise::set_size |
( |
int |
width = 256 , |
|
|
int |
height = 256 |
|
) |
| |
|
inline |
Set the size of the output pixelbuffer.
If this function is not used, the size defaults to 256x256
- Parameters
-
width | = Output pixelbuffer width |
height | = Output pixelbuffer height |
References set_size().
Referenced by set_size().
virtual void uicore::PerlinNoise::set_size |
( |
const Size & |
size | ) |
|
|
pure virtual |
Set the size of the output pixelbuffer.
If this function is not used, the size defaults to 256x256
- Parameters
-
width | = Output pixelbuffer width |
height | = Output pixelbuffer height |
virtual Size uicore::PerlinNoise::size |
( |
| ) |
const |
|
pure virtual |
Get the size of the output pixelbuffer.
The documentation for this class was generated from the following file: