65 std::vector<int> &js);
107 bool from_east =
true,
108 bool from_west =
true,
109 bool from_north =
true,
110 bool from_south =
true);
133 float depth_min = std::numeric_limits<float>::max());
153 const std::vector<int> &i,
154 const std::vector<int> &j,
155 float depth_min = std::numeric_limits<float>::max());
189 int iterations = 500,
190 float epsilon = 1e-3f,
191 float surface_threshold = 0);
322 const Vec2<int> ij_start,
323 const float elevation_ratio = 0.5f,
324 const float distance_exponent = 2.f,
325 const float upward_penalization = 100.f);
375 Vec4<float> bbox = {0.f, 1.f, 0.f, 1.f},
376 bool bezier_smoothing =
false,
377 float depth_start = 0.01f,
378 float depth_end = 1.f,
379 float slope_start = 64.f,
380 float slope_end = 32.f,
381 float shape_exponent_start = 1.f,
382 float shape_exponent_end = 10.f,
383 float k_smoothing = 0.5f,
384 int post_filter_ir = 0,
385 Array *p_noise_x =
nullptr,
386 Array *p_noise_y =
nullptr,
387 Array *p_noise_r =
nullptr);
401 float k_smooth = 0.f);
443 float mask_threshold = 0.f,
444 int iterations_max = 10000,
445 float tolerance = 1e-2f,
473 float dry_out_ratio = 0.5f,
474 const Array *p_mask =
nullptr,
475 float depth_max = std::numeric_limits<float>::max());
500 float additional_depth);
544 float additional_depth);
557 Vec4<float> bbox = {0.f, 1.f, 0.f, 1.f},
558 bool bezier_smoothing =
false,
559 float depth_start = 0.01f,
560 float depth_end = 1.f,
561 float slope_start = 64.f,
562 float slope_end = 32.f,
563 float shape_exponent_start = 1.f,
564 float shape_exponent_end = 10.f,
565 float k_smoothing = 0.5f,
566 int post_filter_ir = 0,
567 Array *p_noise_x =
nullptr,
568 Array *p_noise_y =
nullptr,
569 Array *p_noise_r =
nullptr);
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Definition blending.hpp:186
Array generate_riverbed(const Path &path, Vec2< int > shape, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}, bool bezier_smoothing=false, float depth_start=0.01f, float depth_end=1.f, float slope_start=64.f, float slope_end=32.f, float shape_exponent_start=1.f, float shape_exponent_end=10.f, float k_smoothing=0.5f, int post_filter_ir=0, Array *p_noise_x=nullptr, Array *p_noise_y=nullptr, Array *p_noise_r=nullptr)
See hmap::generate_riverbed.
Definition generate_riverbed_gpu.cpp:16
Array flow_direction_d8(const Array &z)
See hmap::flow_direction_d8.
Definition flow_accumulation_d8_gpu.cpp:10
Definition algebra.hpp:28
Array water_depth_from_mask(const Array &z, const Array &mask, float mask_threshold=0.f, int iterations_max=10000, float tolerance=1e-2f, float omega=1.8f)
Compute water depth over a masked terrain using harmonic interpolation.
Definition flooding.cpp:236
Array water_depth_increase(const Array &water_depth, const Array &z, float additional_depth)
Simulates the increase in water depth over a terrain.
Definition flooding.cpp:260
Array flooding_lake_system(const Array &z, int iterations=500, float epsilon=1e-3f, float surface_threshold=0)
Estimate lake water depths on a terrain by filling depressions.
Definition flooding.cpp:165
Array flooding_uniform_level(const Array &z, float zref)
Compute water depth for a uniform flooding level.
Definition flooding.cpp:19
Array flow_accumulation_d8(const Array &z)
Computes the flow accumulation for each cell using the D8 flow direction model.
Definition flow_accumulation_d8.cpp:49
Array flooding_from_boundaries(const Array &z, float zref, bool from_east=true, bool from_west=true, bool from_north=true, bool from_south=true)
Compute flooding starting from the lowest boundary points.
Definition flooding.cpp:29
Array d8_compute_ndip(const Array &d8)
Computes the number of drainage paths for each cell based on the D8 flow direction model.
Definition flow_accumulation_d8.cpp:27
void water_depth_dry_out(Array &water_depth, float dry_out_ratio=0.5f, const Array *p_mask=nullptr, float depth_max=std::numeric_limits< float >::max())
Apply a drying factor to a water depth field.
Definition flooding.cpp:208
Array flow_accumulation_dinf(const Array &z, float talus_ref)
Computes the flow accumulation for each cell using the Multiple Flow Direction (MFD) model.
Definition flow_accumulation_dinf.cpp:36
Path flow_stream(const Array &z, const Vec2< int > ij_start, const float elevation_ratio=0.5f, const float distance_exponent=2.f, const float upward_penalization=100.f)
Computes the optimal flow path from a starting point to the boundary of a given elevation array.
Definition flow_stream.cpp:46
Array merge_water_depths(const Array &depth1, const Array &depth2, float k_smooth=0.f)
Merge two water depth fields.
Definition flooding.cpp:192
std::vector< Array > flow_direction_dinf(const Array &z, float talus_ref)
Computes the flow direction and weights for each direction using the Multiple Flow Direction (MFD) mo...
Definition flow_accumulation_dinf.cpp:107
Array generate_riverbed(const Path &path, Vec2< int > shape, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f}, bool bezier_smoothing=false, float depth_start=0.01f, float depth_end=1.f, float slope_start=64.f, float slope_end=32.f, float shape_exponent_start=1.f, float shape_exponent_end=10.f, float k_smoothing=0.5f, int post_filter_ir=0, Array *p_noise_x=nullptr, Array *p_noise_y=nullptr, Array *p_noise_r=nullptr)
Generates a 2D array representing a riverbed based on a specified path.
Definition generate_riverbed.cpp:16
Array flow_direction_dinf_angle(const Array &z, float talus_ref)
Computes the flow direction using the Multiple Flow Direction (MFD) model.
Definition flow_accumulation_dinf.cpp:149
Array water_mask(const Array &water_depth)
Generates a binary mask representing water presence.
Definition flooding.cpp:385
Array flooding_from_point(const Array &z, int i, int j, float depth_min=std::numeric_limits< float >::max())
Flood terrain starting from a single seed point.
Definition flooding.cpp:111
void find_flow_sinks(const Array &z, std::vector< int > &is, std::vector< int > &js)
Identifies the indices of flow sinks within the heightmap.
Definition find_flow_sinks.cpp:10
Array flow_direction_d8(const Array &z)
Computes the flow direction from each cell to its downslope neighbor using the D8 model.
Definition flow_accumulation_d8.cpp:100
Path class for manipulating and analyzing paths in 2D space.