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

◆ to_history()

template<typename T >
Memory::HistoryBuffer< T > MayaFlux::Kinesis::to_history ( std::span< const T >  samples)
inlinenoexcept

Build a HistoryBuffer<T> from a newest-first span.

Template Parameters
TSample type
Parameters
samplesSpan with samples[0] newest, samples[N-1] oldest
Returns
HistoryBuffer<T> of capacity samples.size() with matching contents

Exposed directly since several call sites below only need this step once before calling a HistoryBuffer<T>& overload repeatedly, e.g. comparing several difference orders against the same window without rebuilding it per call.

Definition at line 578 of file Differential.hpp.

579{
580 Memory::HistoryBuffer<T> history(samples.size());
581 for (size_t i = samples.size(); i-- > 0;)
582 history.push(samples[i]);
583 return history;
584}
History buffer for difference equations and recursive relations.

References MayaFlux::Memory::HistoryBuffer< T >::push().

Referenced by acceleration(), angular_velocity(), backward_difference(), central_first_derivative(), central_second_derivative(), centroid(), crackle(), curvature_from_history(), direction_sign(), forward_difference(), heading_vector(), heading_vector(), jerk(), jounce(), moving_average(), net_displacement(), path_length(), pop(), smoothed_velocity(), speed(), speed(), speed(), spread_radius(), straightness(), total_turning(), and velocity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: