geomc 1.0
A c++ linear algebra template library
Loading...
Searching...
No Matches
PerlinNoise< T, N > Class Template Reference

Real-valued smooth noise over N dimensions. More...

#include <geomc/function/PerlinNoise.h>

Inheritance diagram for PerlinNoise< T, N >:
Dimensional< T, N >

Public Types

using elem_t
 The coordinate type of this object.
 
using grid_t = typename gridtype::point_t
 
using gridtype = PointType<index_t,N>
 
using point_t
 The type of a point in this object's space.
 
using pointtype = PointType<T,N>
 

Public Member Functions

 PerlinNoise ()
 
template<typename Generator>
 PerlinNoise (Generator &rng)
 
eval (point_t pt) const
 
std::pair< T, point_tgradient (point_t pt) const
 
operator() (point_t pt) const
 

Static Public Attributes

static constexpr index_t N
 The dimension of this object.
 

Protected Member Functions

const point_tget_grid_gradient (const grid_t &pt) const
 

Static Protected Member Functions

static grid_t corner (index_t i)
 
static T dfade_dt (T t)
 
static T fade (T t)
 

Detailed Description

template<typename T, index_t N>
class geom::PerlinNoise< T, N >

Real-valued smooth noise over N dimensions.

Perlin noise has _O(2N)_ time cost.

Member Typedef Documentation

◆ point_t

using point_t
inherited

The type of a point in this object's space.

An N-vector of T if N > 1, otherwise a T.

Constructor & Destructor Documentation

◆ PerlinNoise() [1/2]

template<typename T, index_t N>
PerlinNoise ( )
inline

Construct a new perlin noise object with a std::random_device as a source of random bits.

◆ PerlinNoise() [2/2]

template<typename T, index_t N>
template<typename Generator>
PerlinNoise ( Generator & rng)
inline

Construct a new perlin noise object with the supplied random number generator.

Parameters
rngA source of random bits.

Member Function Documentation

◆ eval()

template<typename T, index_t N>
T eval ( point_t pt) const
inline

Evaluate the noise at pt.

◆ gradient()

template<typename T, index_t N>
std::pair< T, point_t > gradient ( point_t pt) const
inline

Evaluate the gradient of the noise function at pt.

Parameters
ptLocation at which to sample the noise function.
Returns
A pair of (noise(x), gradient(noise(x))).

The documentation for this class was generated from the following files: