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

◆ scaled()

std::function< float(glm::vec2)> MayaFlux::Kinesis::scaled ( std::function< float(glm::vec2)>  norm,
float  lo,
float  hi 
)
inline

Rescale a normalized projection onto an arbitrary range.

Composes over any callable producing [0, 1], so a fader, knob, or stroke slider can drive a frequency, gain, or index without the call site repeating the remap.

Parameters
normProjection producing a value in [0, 1].
loValue corresponding to 0.
hiValue corresponding to 1.

Definition at line 195 of file Projection.hpp.

196{
197 return [norm = std::move(norm), lo, hi](glm::vec2 p) -> float {
198 return lo + norm(p) * (hi - lo);
199 };
200}
float lo
float hi

References hi, and lo.