libtcod
Loading...
Searching...
No Matches
noise.h File Reference

Texture noise generator module. More...

#include "config.h"
#include "mersenne_types.h"
#include "noise_defaults.h"

Go to the source code of this file.

Classes

struct  TCOD_Noise

Typedefs

typedef struct TCOD_Noise TCOD_Noise
typedef TCOD_NoiseTCOD_noise_t

Enumerations

enum  TCOD_noise_type_t { TCOD_NOISE_PERLIN = 1 , TCOD_NOISE_SIMPLEX = 2 , TCOD_NOISE_WAVELET = 4 , TCOD_NOISE_DEFAULT = 0 }

Functions

TCOD_NoiseTCOD_noise_new (int dimensions, float hurst, float lacunarity, TCOD_Random *random)
void TCOD_noise_set_type (TCOD_Noise *noise, TCOD_noise_type_t type)
float TCOD_noise_get_ex (TCOD_Noise *noise, const float *f, TCOD_noise_type_t type)
float TCOD_noise_get_fbm_ex (TCOD_Noise *noise, const float *f, float octaves, TCOD_noise_type_t type)
float TCOD_noise_get_turbulence_ex (TCOD_Noise *noise, const float *f, float octaves, TCOD_noise_type_t type)
float TCOD_noise_get (TCOD_Noise *noise, const float *f)
float TCOD_noise_get_fbm (TCOD_Noise *noise, const float *f, float octaves)
float TCOD_noise_get_turbulence (TCOD_Noise *noise, const float *f, float octaves)
void TCOD_noise_delete (TCOD_Noise *noise)
void TCOD_noise_get_vectorized (TCOD_Noise *noise, TCOD_noise_type_t type, int n, float *x, float *y, float *z, float *w, float *out)
 Generate noise as a vectorized operation.
void TCOD_noise_get_fbm_vectorized (TCOD_Noise *noise, TCOD_noise_type_t type, float octaves, int n, float *x, float *y, float *z, float *w, float *out)
 Generate noise as a vectorized operation with fractional Brownian motion.
void TCOD_noise_get_turbulence_vectorized (TCOD_Noise *noise, TCOD_noise_type_t type, float octaves, int n, float *x, float *y, float *z, float *w, float *out)
 Generate noise as a vectorized operation with turbulence.

Detailed Description

Texture noise generator module.

Function Documentation

◆ TCOD_noise_get_fbm_vectorized()

void TCOD_noise_get_fbm_vectorized ( TCOD_Noise * noise,
TCOD_noise_type_t type,
float octaves,
int n,
float * x,
float * y,
float * z,
float * w,
float * out )

Generate noise as a vectorized operation with fractional Brownian motion.

octaves are the number of samples to take.

The remaining parameters are the same as TCOD_noise_get_vectorized.

embed:rst:leading-asterisk 
.. versionadded:: 1.16

◆ TCOD_noise_get_turbulence_vectorized()

void TCOD_noise_get_turbulence_vectorized ( TCOD_Noise * noise,
TCOD_noise_type_t type,
float octaves,
int n,
float * x,
float * y,
float * z,
float * w,
float * out )

Generate noise as a vectorized operation with turbulence.

octaves are the number of samples to take.

The remaining parameters are the same as TCOD_noise_get_vectorized.

embed:rst:leading-asterisk 
.. versionadded:: 1.16

◆ TCOD_noise_get_vectorized()

void TCOD_noise_get_vectorized ( TCOD_Noise * noise,
TCOD_noise_type_t type,
int n,
float * x,
float * y,
float * z,
float * w,
float * out )

Generate noise as a vectorized operation.

noise is the TCOD_Noise object to be used. Its dimensions will determine how many input arrays are required.

type is which noise generator should be used. Can be TCOD_NOISE_DEFAULT to use the type set by the TCOD_Noise object.

n is the length of the input and output arrays.

x[n], y[n], z[n], w[n] are the input coordinates for the noise generator. For a 2D generator you'd provide the x[n] and y[n] arrays and leave the remaining arrays as NULL.

out[n] is the output array, which will receive the noise values.

embed:rst:leading-asterisk 
.. versionadded:: 1.16