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

◆ piecewise_linear()

TimeMap MayaFlux::Kinesis::TimeMaps::piecewise_linear ( std::vector< double >  points,
double  duration 
)
inline

Piecewise linear path through evenly spaced positions.

Parameters
pointsPositions spread across [0, duration], for example a sampled Kinesis curve. Empty gives zero, one gives a constant.
durationSeconds from the first point to the last, last point kept after

Definition at line 140 of file TimeMap.hpp.

141{
142 return { .fn = [points = std::move(points), duration](const double& t) -> double {
143 if (points.empty()) {
144 return 0.0;
145 }
146 if (points.size() == 1 || duration <= 0.0) {
147 return points.back();
148 }
149
150 return sample_table(points, t / duration);
151 } };
152}
std::vector< glm::vec2 > * points

References MayaFlux::Kinesis::Tendency< D, R >::fn, points, and MayaFlux::Kinesis::sample_table().

+ Here is the call graph for this function: