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

◆ lerp()

template<typename D >
Tendency< D, float > MayaFlux::Kinesis::lerp ( const Tendency< D, float > &  a,
const Tendency< D, float > &  b,
const Tendency< D, float > &  weight 
)

Interpolate between two tendencies controlled by a weight tendency.

Template Parameters
DShared domain type
Parameters
aFirst tendency (weight 0.0)
bSecond tendency (weight 1.0)
weightD -> float tendency producing interpolation factor
Returns
Blended tendency

Definition at line 184 of file Tendency.hpp.

185{
186 return { .fn = [a, b, weight](const D& d) -> float {
187 float w = weight(d);
188 return a(d) * (1.0F - w) + b(d) * w;
189 } };
190}
size_t a
double weight
size_t b

References a, b, MayaFlux::Kinesis::Tendency< D, R >::fn, and weight.