MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ ramp()

double MayaFlux::Kinesis::detail::ramp ( double  edge0,
double  edge1,
double  x 
)
inlinenoexcept

Hermite ramp from 0 at edge0 to 1 at edge1.

The same curve as glm::smoothstep, confirmed against ShaderCompat.hpp's re-export of it, kept as a local double-precision copy rather than calling through glm::smoothstep directly: that one is float-based, and every membership computation in this file works in double so that two extents differing only slightly near a boundary do not lose the difference to a float round-trip.

Definition at line 19 of file FeatureExtent.hpp.

20 {
21 if (edge1 <= edge0)
22 return x < edge0 ? 0.0 : 1.0;
23 const double t = std::clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);
24 return t * t * (3.0 - 2.0 * t);
25 }

Referenced by MayaFlux::Kinesis::membership(), and MayaFlux::Kinesis::membership().

+ Here is the caller graph for this function: