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

◆ smoothstep()

ScalarField MayaFlux::Kinesis::smoothstep ( float  edge0,
float  edge1 
)
inline

Smoothstep: cubic Hermite interpolation between two edges.

Parameters
edge0Lower edge (output 0.0 at and below)
edge1Upper edge (output 1.0 at and above)
Returns
ScalarField: float -> float

Definition at line 114 of file TendencyFactories.hpp.

115{
116 return { .fn = [edge0, edge1](const float& x) -> float {
117 float t = std::clamp((x - edge0) / (edge1 - edge0), 0.0F, 1.0F);
118 return t * t * (3.0F - 2.0F * t);
119 } };
120}

References MayaFlux::Kinesis::Tendency< D, R >::fn.