102 float strength = 1.f,
104 const Array *p_noise =
nullptr,
105 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
145 bool zero_padding =
false);
258 bool favor_boundary_center =
true,
259 bool favor_lower_elevation =
true,
260 bool favor_sinks =
true);
284 glm::vec4 border_values,
285 glm::ivec4 buffer_sizes);
300void set_borders(Array &array,
float border_values,
int buffer_sizes);
315void sym_borders(Array &array, glm::ivec4 buffer_sizes);
355 float profile_param = 0.f,
359 glm::vec2 center = {0.5f, 0.5f},
361 const Array *p_noise_r =
nullptr,
362 glm::vec4 bbox = {0.f, 1.f, 0.f, 1.f});
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Definition algebra.hpp:23
void fill_borders(Array &array)
Fills the border values of an array (e.g., i = 0, j = 0, etc.) based on the values of the first neigh...
Definition boundary.cpp:119
DistanceFunctionAxis
Axis used for the distance function.
Definition distance_functions.hpp:31
@ DFA_XY
X and Y.
Definition distance_functions.hpp:34
Array make_periodic_stitching(const Array &array, float overlap)
Creates a periodic array in both directions using a stitching operation that minimizes errors at the ...
Definition boundary.cpp:264
DomainBoundary
Describes which domain boundary.
Definition boundary.hpp:44
@ BOUNDARY_TOP
j = 0
Definition boundary.hpp:47
@ BOUNDARY_LEFT
i = 0
Definition boundary.hpp:45
@ BOUNDARY_BOTTOM
j = ny - 1
Definition boundary.hpp:48
@ BOUNDARY_RIGHT
i = nx - 1
Definition boundary.hpp:46
RadialProfile
Radial profile type.
Definition profiles.hpp:51
@ RP_SMOOTHSTEP
Definition profiles.hpp:55
void sym_borders(Array &array, glm::ivec4 buffer_sizes)
Fills the values at the domain borders using symmetry over a specified buffer depth.
Definition boundary.cpp:411
void make_periodic(Array &array, int nbuffer, const PeriodicityType &periodicity_type=PeriodicityType::PERIODICITY_XY)
Adjusts the input array to be periodic in both directions by transitioning smoothly at the boundaries...
Definition boundary.cpp:195
PeriodicityType
Describes the periodicity mode applied along map axes.
Definition boundary.hpp:31
@ PERIODICITY_XY
Periodic along both the X and Y axes.
Definition boundary.hpp:34
@ PERIODICITY_X
Periodic only along the X axis.
Definition boundary.hpp:32
@ PERIODICITY_Y
Periodic only along the Y axis.
Definition boundary.hpp:33
float distance(const Point &p1, const Point &p2)
Calculates the distance between two points.
Definition points.cpp:127
DistanceFunction
Distance function type.
Definition distance_functions.hpp:20
@ EUCLIDIAN
Euclidian.
Definition distance_functions.hpp:22
glm::ivec2 pick_boundary_cell(const Array &z, DomainBoundary boundary, std::uint32_t seed, bool favor_boundary_center=true, bool favor_lower_elevation=true, bool favor_sinks=true)
Picks a boundary cell using weighted random selection.
Definition pick_boundary_cell.cpp:16
void extrapolate_borders(Array &array, int nbuffer=1, float sigma=0.f)
Performs linear extrapolation of values at the borders of an array (e.g., i = 0, j = 0,...
Definition boundary.cpp:19
void zeroed_edges(Array &array, RadialProfile radial_profile=RadialProfile::RP_SMOOTHSTEP, float profile_param=0.f, float amount=1.f, DistanceFunction distance=DistanceFunction::EUCLIDIAN, DistanceFunctionAxis dfa=DistanceFunctionAxis::DFA_XY, glm::vec2 center={0.5f, 0.5f}, float radius=0.5f, const Array *p_noise_r=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Smoothly attenuates array values toward zero near the domain boundaries.
Definition zeroed_edges.cpp:17
Array generate_buffered_array(const Array &array, glm::ivec4 buffers, bool zero_padding=false)
Creates and returns a new array with additional buffer zones at the boundaries, where the buffer valu...
Definition boundary.cpp:157
void falloff(Array &array, float strength=1.f, DistanceFunction dist_fct=DistanceFunction::EUCLIDIAN, const Array *p_noise=nullptr, glm::vec4 bbox={0.f, 1.f, 0.f, 1.f})
Applies a falloff effect to the input array based on distance.
Definition boundary.cpp:80
Array make_periodic_tiling(const Array &array, float overlap, glm::ivec2 tiling)
Creates a tiled, periodic array by applying a transition with overlap in both directions.
Definition boundary.cpp:332
void zeroed_borders(Array &array)
Fills the border values (e.g., i = 0, j = 0, etc.) of the array with zeros.
Definition boundary.cpp:436
void set_borders(Array &array, glm::vec4 border_values, glm::ivec4 buffer_sizes)
Enforces specific values at the boundaries of the array.
Definition boundary.cpp:357