HighMap library (C++)
Loading...
Searching...
No Matches
operator.hpp File Reference

Go to the source code of this file.

Namespaces

namespace  hmap
 

Functions

void hmap::add_kernel (Array &array, const Array &kernel, int i, int j)
 Add a kernel to a specified position in an array.
 
void hmap::add_kernel_maximum_smooth (Array &array, const Array &kernel, float k_smooth, int i, int j)
 Adds a smoothed maximum value from a kernel to a specified position in a 2D array.
 
Array hmap::detrend_reg (const Array &array)
 Apply linear regression for detrending of a 2D array.
 
Array hmap::hstack (const Array &array1, const Array &array2)
 Horizontally stack two arrays side by side.
 
Array hmap::inpainting_diffusion (const Array &array, const Array &mask, int iterations)
 Perform diffusion-based inpainting to fill a specified region of an array.
 
std::vector< float > hmap::linspace (float start, float stop, int num, bool endpoint=true)
 Generate a vector of evenly spaced numbers over a specified interval.
 
std::vector< float > hmap::linspace_jitted (float start, float stop, int num, float ratio, int seed, bool endpoint=true)
 Generate a vector of jittered (noised) numbers over a specified interval.
 
std::vector< float > hmap::random_vector (float min, float max, int num, int seed)
 Generate a vector filled with random values within a specified range.
 
void hmap::fill_array_using_xy_function (Array &array, Vec4< float > bbox, const Array *p_ctrl_param, const Array *p_noise_x, const Array *p_noise_y, const Array *p_stretching, std::function< float(float, float, float)> fct_xy)
 Fill an array using a scalar function based on (x, y) coordinates.
 
void hmap::fill_array_using_xy_function (Array &array, Vec4< float > bbox, const Array *p_ctrl_param, const Array *p_noise_x, const Array *p_noise_y, const Array *p_stretching, std::function< float(float, float, float)> fct_xy, int subsampling)
 Fill an array using a scalar function based on (x, y) coordinates with subsampling.
 
void hmap::find_vertical_cut_path (const Array &error, std::vector< int > &path_i)
 Find the vertical cut path with the minimum cost using Dijkstra's algorithm.
 
Array hmap::generate_mask (hmap::Vec2< int > shape, std::vector< int > cut_path_i, int ir)
 Generate a smooth mask based on a cut path.
 
Array hmap::get_random_patch (const Array &array, hmap::Vec2< int > patch_shape, std::mt19937 &gen, bool patch_flip=false, bool patch_rotate=false, bool patch_transpose=false, std::vector< Array * > *p_secondary_arrays=nullptr, std::vector< Array > *p_secondary_patches=nullptr)
 Extracts a random sub-array (patch) from the input array, with optional transformations.
 
Array hmap::vstack (const Array &array1, const Array &array2)
 Vertically stack two arrays.