HighMap library (C++)
Loading...
Searching...
No Matches
hmap::ArrayFunction Class Reference

Array (x, y) function class. More...

#include <functions.hpp>

Inheritance diagram for hmap::ArrayFunction:
Collaboration diagram for hmap::ArrayFunction:

Public Member Functions

 ArrayFunction (Array array, glm::vec2 kw, bool periodic=true)
 Construct a new ArrayFunction object.
 
void set_array (Array new_array)
 Set the array object.
 
- Public Member Functions inherited from hmap::Function
 Function ()
 Default constructor. Initializes the delegate function to a default that returns 0.
 
virtual ~Function ()=default
 Virtual destructor to ensure proper cleanup in derived classes.
 
 Function (HMAP_FCT_XY_TYPE delegate)
 Constructor to initialize with a specific delegate function.
 
HMAP_FCT_XY_TYPE get_delegate () const
 Get the current delegate function.
 
float get_value (float x, float y, float ctrl_param) const
 Call the delegate function with given arguments.
 
void set_delegate (HMAP_FCT_XY_TYPE new_delegate)
 Set a new delegate function.
 

Protected Attributes

glm::vec2 kw
 Frequency scaling vector.
 
bool periodic
 Flag indicating whether the domain is periodic or not.
 

Detailed Description

Array (x, y) function class.

This class functions like an image sampler with normalized coordinates found on a GPU. It is based on a 2D array, allowing interpolation of any value at a given (x, y) coordinate. Specific boundary conditions, such as periodicity, can also be used.

Constructor & Destructor Documentation

◆ ArrayFunction()

hmap::ArrayFunction::ArrayFunction ( hmap::Array  array,
glm::vec2  kw,
bool  periodic = true 
)

Construct a new ArrayFunction object.

Parameters
arrayData array.
kwNoise wavenumbers {kx, ky} for each direction, with respect to a unit domain.
periodicWhether the domain is periodic or not.

Member Function Documentation

◆ set_array()

void hmap::ArrayFunction::set_array ( Array  new_array)
inline

Set the array object.

Parameters
new_arrayNew data array.

Member Data Documentation

◆ kw

glm::vec2 hmap::ArrayFunction::kw
protected

Frequency scaling vector.

◆ periodic

bool hmap::ArrayFunction::periodic
protected

Flag indicating whether the domain is periodic or not.


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