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

Namespaces

namespace  hmap

Functions

void hmap::chop (Array &array, float vmin)
 Set to zero any value lower than vmin.
void hmap::chop_max_smooth (Array &array, float vmax)
 Set to zero any value lower than vmax and apply a linear decrease slope between vmax / 2 and vmax.
void hmap::clamp (Array &array, float vmin=0.f, float vmax=1.f)
 Clamp array elements to a target range.
void hmap::clamp (Array &array, float vmax, ClampMode mode)
 Clamps the values of an array according to the specified mode.
void hmap::clamp_max (Array &array, float vmax)
 Clamp array values larger than a given bound.
void hmap::clamp_max (Array &array, const Array &vmax)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void hmap::clamp_max_smooth (Array &array, float vmax, float k=0.2f)
 Clamp array values larger than a given bound with a smooth transition.
void hmap::clamp_max_smooth (Array &array, const Array &vmax, float k=0.2f)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void hmap::clamp_min (Array &array, float vmin)
 Clamp array values lower than a given bound.
void hmap::clamp_min (Array &array, const Array &vmin)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void hmap::clamp_min_smooth (Array &array, float vmin, float k=0.2f)
 Clamp array values lower than a given bound with a smooth transition.
void hmap::clamp_min_smooth (Array &array, const Array &vmin, float k=0.2f)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
float hmap::clamp_min_smooth (float x, float vmin, float k=0.2f)
 Clamp a single value lower than a given bound with a smooth transition.
void hmap::clamp_oblique_plane (Array &array, float vmax, float angle, float slope, bool use_max_operator=true, float k=0.f, glm::vec2 center={0.5f, 0.5f}, const BBox2D &bbox=BBox2D::unit())
 Clamps an array against an oblique plane.
void hmap::clamp_smooth (Array &array, float vmin, float vmax, float k=0.2f)
 Clamp array values within a given interval with a smooth transition.
Array hmap::maximum (const Array &array1, const Array &array2)
 Return the element-wise maximum of two arrays.
Array hmap::maximum (const Array &array1, const float value)
 Return the element-wise maximum of an array and a scalar value.
Array hmap::maximum_smooth (const Array &array1, const Array &array2, float k=0.2)
 Return the polynomial cubic smooth element-wise maximum of two arrays.
float hmap::maximum_smooth (const float a, const float b, float k=0.2)
 Return the polynomial cubic smooth maximum of two scalar values.
Array hmap::minimum (const Array &array1, const Array &array2)
 Return the element-wise minimum of two arrays.
Array hmap::minimum (const Array &array1, const float value)
 Return the element-wise minimum of an array and a scalar value.
Array hmap::minimum_smooth (const Array &array1, const Array &array2, float k=0.2)
 Return the polynomial cubic smooth element-wise minimum of two arrays.
float hmap::minimum_smooth (const float a, const float b, float k)
 Return the polynomial cubic smooth minimum of two scalar values.
void hmap::remap (Array &array, float vmin=0, float vmax=1, ICommunicator &comm=SingleArrayComm::instance())
 Remap array elements from a starting range to a target range (default range).
void hmap::remap (Array &array, float vmin, float vmax, float from_min, float from_max)
 Remap array elements from a starting range to a target range.
void hmap::rescale (Array &array, float scaling, float vref=0.f)
 Remap array elements from a starting range to a target range.
void hmap::normalize_and_clip (Array &array, float multiplier=2.5f, bool smooth_transition=true, bool range_01=false, ICommunicator &comm=SingleArrayComm::instance())
 Normalize an array around its mean and clip values.