HighMap library (C++)
Loading...
Searching...
No Matches
selector.hpp
Go to the documentation of this file.
1/* Copyright (c) 2023 Otto Link. Distributed under the terms of the GNU General
2 Public License. The full license is in the file LICENSE, distributed with
3 this software. */
4
13#pragma once
14
15#include "highmap/array.hpp"
16
17namespace hmap
18{
19
36Array scan_mask(const Array &array,
37 float contrast = 0.5f,
38 float brightness = 0.5f);
39
55Array select_angle(const Array &array, float angle, float sigma, int ir = 0);
56
71Array select_blob_log(const Array &array, int ir);
72
89Array select_cavities(const Array &array, int ir, bool concave = true);
90
104Array select_elevation_slope(const Array &array, float gradient_scale);
105Array select_elevation_slope(const Array &array,
106 float gradient_scale,
107 float vmax);
108
127Array select_eq(const Array &array, float value);
128
137Array select_gradient_angle(const Array &array, float angle);
138
147Array select_gradient_binary(const Array &array, float talus_center);
148
158Array select_gradient_exp(const Array &array,
159 float talus_center,
160 float talus_sigma);
161
171Array select_gradient_inv(const Array &array,
172 float talus_center,
173 float talus_sigma);
174
193Array select_gt(const Array &array, float value);
194
214Array select_interval(const Array &array, float value1, float value2);
215
230Array select_inward_outward_slope(const Array &array,
231 Vec2<float> center = {0.5f, 0.5f},
232 Vec4<float> bbox = {0.f, 1.f, 0.f, 1.f});
233
252Array select_lt(const Array &array, float value);
253
270Array select_midrange(const Array &array, float gain, float vmin, float vmax);
271
288Array select_midrange(const Array &array, float gain);
289
320void select_multiband3(const Array &array,
321 Array &band_low,
322 Array &band_mid,
323 Array &band_high,
324 float ratio1,
325 float ratio2,
326 float overlap,
327 float vmin,
328 float vmax);
329
355void select_multiband3(const Array &array,
356 Array &band_low,
357 Array &band_mid,
358 Array &band_high,
359 float ratio1,
360 float ratio2,
361 float overlap);
362
379Array select_pulse(const Array &array, float value, float sigma);
380
397Array select_rivers(const Array &array, float talus_ref, float clipping_ratio);
398
416Array select_transitions(const Array &array1,
417 const Array &array2,
418 const Array &array_blend);
419
420Array select_valley(const Array &z,
421 int ir,
422 bool zero_at_borders = true,
423 bool ridge_select = false);
424
425} // namespace hmap
426
427namespace hmap::gpu
428{
429
431Array select_valley(const Array &z,
432 int ir,
433 bool zero_at_borders = true,
434 bool ridge_select = false);
435
436} // namespace hmap::gpu
Declaration of the Array class for 2D floating-point arrays with various mathematical operations and ...
Definition blending.hpp:151
Array select_valley(const Array &z, int ir, bool zero_at_borders=true, bool ridge_select=false)
See hmap::select_valley.
Definition selector_gpu.cpp:12
Definition algebra.hpp:28
Array select_lt(const Array &array, float value)
Return an array with elements equal to 1 where input elements are smaller than value.
Definition selector.cpp:200
Array select_elevation_slope(const Array &array, float gradient_scale)
Definition selector.cpp:89
Array select_angle(const Array &array, float angle, float sigma, int ir=0)
Return angle selection for a given angle and a tolerance half-width on this value.
Definition selector.cpp:45
Array select_pulse(const Array &array, float value, float sigma)
Return an array filled with non-zero values where the input is in the interval [value - sigma,...
Definition selector.cpp:296
Array select_rivers(const Array &array, float talus_ref, float clipping_ratio)
Return an array filled with a criterion based on the occurence of a river bed.
Definition selector.cpp:311
Array select_inward_outward_slope(const Array &array, Vec2< float > center={0.5f, 0.5f}, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f})
Return an array with positive values if the slope is pointing to the center (slope is inward),...
Definition selector.cpp:166
Array select_gradient_exp(const Array &array, float talus_center, float talus_sigma)
Return an array weighted (exponantial decay) by the gradient norm of the input array.
Definition selector.cpp:132
Array select_gt(const Array &array, float value)
Return an array with elements equal to 1 where input elements are larger than value.
Definition selector.cpp:103
Array select_gradient_inv(const Array &array, float talus_center, float talus_sigma)
Return an array weighted (square inverse) by the gradient norm of the input array.
Definition selector.cpp:142
Array scan_mask(const Array &array, float contrast=0.5f, float brightness=0.5f)
Mask adjustement using a 'scanning' method.
Definition selector.cpp:23
void select_multiband3(const Array &array, Array &band_low, Array &band_mid, Array &band_high, float ratio1, float ratio2, float overlap, float vmin, float vmax)
Splits the input array into three bands (low, mid, and high) based on given ratios and overlap.
Definition selector.cpp:230
Array select_valley(const Array &z, int ir, bool zero_at_borders=true, bool ridge_select=false)
Definition selector.cpp:381
Array select_midrange(const Array &array, float gain, float vmin, float vmax)
Selects the midrange values of the input array within a specified range.
Definition selector.cpp:209
Array select_interval(const Array &array, float value1, float value2)
Return an array with elements equal to 1 where input elements are within the bounds provided.
Definition selector.cpp:152
Array select_gradient_angle(const Array &array, float angle)
Return an array weighted by the gap between the gradient angle and a given angle.
Definition selector.cpp:112
float angle(const Point &p1, const Point &p2)
Computes the angle between two points relative to the x-axis.
Definition points.cpp:42
void gain(Array &array, float factor, const Array *p_mask)
Apply a gain correction to the array elements.
Definition filters.cpp:347
Array select_cavities(const Array &array, int ir, bool concave=true)
Return holes or bumps detection based on the mean curvature of the heightmap.
Definition selector.cpp:67
Array select_transitions(const Array &array1, const Array &array2, const Array &array_blend)
Return an array filled with 1 at the blending transition between two arrays, and 0 elsewhere.
Definition selector.cpp:320
Array select_gradient_binary(const Array &array, float talus_center)
Return an array filled with 1 where the gradient is larger than a given value and 0 elsewhere.
Definition selector.cpp:123
Array select_eq(const Array &array, float value)
Return an array with elements equal to 1 where input elements are equal to value.
Definition selector.cpp:94
Array select_blob_log(const Array &array, int ir)
Return blob detection using the Laplacian of Gaussian (LoG) approach.
Definition selector.cpp:58