HighMap library (C++)
Loading...
Searching...
No Matches
filters.cpp File Reference

Namespaces

namespace  hmap
 

Functions

void hmap::equalize (Array &array)
 Apply histogram equalization to the array values.
 
void hmap::equalize (Array &array, const Array *p_mask)
 Apply histogram equalization to the array values with a mask.
 
void hmap::expand (Array &array, int ir, int iterations=1)
 Apply expansion to emphasize the bulk of the terrain using a filter radius.
 
void hmap::expand (Array &array, int ir, const Array *p_mask, int iterations=1)
 Apply expansion, or "inflation", to emphasize the bulk of the terrain.
 
void hmap::expand (Array &array, const Array &kernel, int iterations=1)
 Apply expansion using a custom kernel.
 
void hmap::expand (Array &array, const Array &kernel, const Array *p_mask, int iterations=1)
 Apply expansion using a custom kernel with an optional mask.
 
void hmap::expand_directional (Array &array, int ir, float angle, float aspect_ratio, float anisotropy=1.f, const Array *p_mask=nullptr)
 Apply expansion, or "inflation", to emphasize the bulk of the terrain, using a directional kernel.
 
void hmap::expand_talus (Array &z, const Array &mask, float talus, uint seed, float noise_ratio=0.2f)
 
void hmap::fill_talus (Array &z, float talus, uint seed, float noise_ratio=0.2f)
 Modifies a terrain array by filling it with talus slopes.
 
void hmap::fill_talus_fast (Array &z, Vec2< int > shape_coarse, float talus, uint seed, float noise_ratio=0.2f)
 Fill terrain values with a given downslope talus, optimized using a coarse mesh for faster computation.
 
void hmap::fold (Array &array, int iterations=3, float k=0.05f)
 Apply a "folding" filter with default reference values and parameters.
 
void hmap::fold (Array &array, float vmin, float vmax, int iterations=3, float k=0.05f)
 Apply a "folding" filter (successive absolute values) to the array elements.
 
void hmap::gain (Array &array, float factor)
 Apply a gain correction to the array elements without a mask.
 
void hmap::gain (Array &array, float factor, const Array *p_mask)
 Apply a gain correction to the array elements.
 
void hmap::gamma_correction (Array &array, float gamma)
 Apply gamma correction to the input array without a mask.
 
void hmap::gamma_correction (Array &array, float gamma, const Array *p_mask)
 Apply gamma correction to the input array.
 
void hmap::gamma_correction_local (Array &array, float gamma, int ir, float k=0.1f)
 Apply a "local" gamma correction to the input array.
 
void hmap::gamma_correction_local (Array &array, float gamma, int ir, const Array *p_mask, float k=0.1f)
 Apply a "local" gamma correction with a mask to the input array.
 
void hmap::kuwahara (Array &array, int ir, float mix_ratio=1.f)
 Applies the Kuwahara filter to an array with optional per-pixel masking.
 
void hmap::kuwahara (Array &array, int ir, const Array *p_mask, float mix_ratio=1.f)
 Applies the Kuwahara filter to an array with optional per-pixel masking.
 
void hmap::laplace (Array &array, float sigma=0.2f, int iterations=3)
 Apply a low-pass Laplace filter to the input array.
 
void hmap::laplace (Array &array, const Array *p_mask, float sigma=0.2f, int iterations=3)
 Apply a low-pass Laplace filter with a mask.
 
void hmap::laplace_edge_preserving (Array &array, float talus, float sigma=0.2f, int iterations=3)
 Apply a low-pass anisotropic Laplace filter to the input array.
 
void hmap::laplace_edge_preserving (Array &array, float talus, const Array *p_mask, float sigma=0.2f, int iterations=3)
 Apply a low-pass anisotropic Laplace filter with a mask.
 
void hmap::low_pass_high_order (Array &array, int order=9, float sigma=1.f)
 Apply a low-pass high-order filter to the input array.
 
void hmap::make_binary (Array &array, float threshold=0.f)
 Convert array values to binary using a threshold.
 
void hmap::match_histogram (Array &array, const Array &array_reference)
 Transform the input array elevation to match the histogram of a reference array.
 
Array hmap::mean_shift (const Array &array, int ir, float talus, int iterations=1, bool talus_weighted=true)
 Applies the mean shift algorithm to the input array.
 
Array hmap::mean_shift (const Array &array, int ir, float talus, const Array *p_mask, int iterations=1, bool talus_weighted=true)
 
void hmap::median_3x3 (Array &array)
 Apply a 3x3 median filter to the input array without a mask.
 
void hmap::median_3x3 (Array &array, const Array *p_mask)
 Apply a 3x3 median filter to the input array.
 
Array hmap::median_pseudo (const Array &array, int ir)
 Computes a fast pseudo-median approximation of a local neighborhood in an array.
 
void hmap::normal_displacement (Array &array, float amount=0.1f, int ir=0, bool reverse=false)
 Apply a displacement to the terrain along the normal direction.
 
void hmap::normal_displacement (Array &array, const Array *p_mask, float amount=0.1f, int ir=0, bool reverse=false)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::plateau (Array &array, int ir, float factor)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::plateau (Array &array, const Array *p_mask, int ir, float factor)
 Apply a plateau-shape filter to the input array.
 
void hmap::reverse_above_theshold (Array &array, const Array &threshold, float scaling=1.f, float transition_extent=0.f)
 Applies a smooth reversal of values above a given threshold.
 
void hmap::reverse_above_theshold (Array &array, float threshold, float scaling=1.f, float transition_extent=0.f)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::reverse_above_theshold (Array &array, const Array &threshold, const Array *p_mask, float scaling=1.f, float transition_extent=0.f)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::reverse_above_theshold (Array &array, float threshold, const Array *p_mask, float scaling=1.f, float transition_extent=0.f)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::sharpen (Array &array, float ratio=1.f)
 Apply a sharpening filter based on the Laplace operator.
 
void hmap::sharpen (Array &array, const Array *p_mask, float ratio=1.f)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::sharpen_cone (Array &array, int ir, float intensity=0.5f)
 Apply a sharpening filter based on a smooth cone filter.
 
void hmap::sharpen_cone (Array &array, const Array *p_mask, int ir, float scale=0.5f)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::shrink (Array &array, int ir, int iterations=1)
 Apply shrinking, or "deflating", to emphasize the ridges in the heightmap.
 
void hmap::shrink (Array &array, int ir, const Array *p_mask, int iterations=1)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::shrink (Array &array, const Array &kernel, int iterations=1)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::shrink (Array &array, const Array &kernel, const Array *p_mask, int iterations=1)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::shrink_directional (Array &array, int ir, float angle, float aspect_ratio, float anisotropy=1.f, const Array *p_mask=nullptr)
 Apply directional shrinking, or "deflating", to emphasize the ridges in the terrain.
 
void hmap::smooth_cone (Array &array, int ir)
 Apply a convolution filter with a cone kernel to smooth the array.
 
void hmap::smooth_cone (Array &array, int ir, const Array *p_mask)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::smooth_cpulse (Array &array, int ir)
 Apply filtering to the array using convolution with a cubic pulse kernel.
 
void hmap::smooth_cpulse (Array &array, int ir, const Array *p_mask)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::smooth_flat (Array &array, int ir)
 Applies a smoothing average filter to the given 2D array in both dimensions.
 
void hmap::smooth_gaussian (Array &array, int ir)
 Apply Gaussian filtering to the array.
 
void hmap::smooth_gaussian (Array &array, int ir, const Array *p_mask)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::smooth_fill (Array &array, int ir, float k=0.1f, Array *p_deposition_map=nullptr)
 Apply cubic pulse smoothing to fill lower flat regions while preserving some sharpness.
 
void hmap::smooth_fill (Array &array, int ir, const Array *p_mask, float k=0.1f, Array *p_deposition_map=nullptr)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::smooth_fill_holes (Array &array, int ir)
 Apply smoothing to fill holes (elliptic concave surfaces).
 
void hmap::smooth_fill_holes (Array &array, int ir, const Array *p_mask)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::smooth_fill_smear_peaks (Array &array, int ir)
 Apply smoothing to smear peaks (elliptic convex surfaces).
 
void hmap::smooth_fill_smear_peaks (Array &array, int ir, const Array *p_mask)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::smoothstep_local (Array &array, int ir)
 Applies a localized smoothstep operation to the provided array.
 
void hmap::smoothstep_local (Array &array, int ir, const Array *p_mask)
 Applies a localized smoothstep operation to the provided array with an optional mask.
 
void hmap::steepen (Array &array, float scale, int ir=8)
 Steepen (or flatten) the array map.
 
void hmap::steepen (Array &array, float scale, const Array *p_mask, int ir=8)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::steepen_convective (Array &array, float angle, int iterations=1, int ir=0, float dt=0.1f)
 Steepen array values by applying a nonlinear convection operator in a given direction.
 
void hmap::steepen_convective (Array &array, float angle, const Array *p_mask, int iterations=1, int ir=0, float dt=0.1f)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::terrace (Array &array, uint seed, int nlevels, float gain=0.9f, float noise_ratio=0.f, const Array *p_noise=nullptr, float vmin=0.f, float vmax=-1.f)
 Applies a terrace effect to the values in an array.
 
void hmap::terrace (Array &array, uint seed, int nlevels, const Array *p_mask, float gain=0.9f, float noise_ratio=0.f, const Array *p_noise=nullptr, float vmin=0.f, float vmax=-1.f)
 Applies a terrace effect to an array with optional masking.
 
void hmap::wrinkle (Array &array, float wrinkle_amplitude, float wrinkle_angle=0.f, float displacement_amplitude=1.f, int ir=0, float kw=2.f, uint seed=1, int octaves=8, float weight=0.7f, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f})
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
void hmap::wrinkle (Array &array, float wrinkle_amplitude, const Array *p_mask, float wrinkle_angle=0.f, float displacement_amplitude=1.f, int ir=0, float kw=2.f, uint seed=1, int octaves=8, float weight=0.7f, Vec4< float > bbox={0.f, 1.f, 0.f, 1.f})
 Apply wrinkle effect to the array, creating wrinkled or bumpy features.