|
MayaFlux 0.5.0
Digital-First Multimedia Processing Framework
|
Reusable interpolation state for callers evaluating many curves. More...
#include <MotionCurves.hpp>
Collaboration diagram for MayaFlux::Kinesis::CurveEvaluator:Public Member Functions | |
| void | configure (InterpolationMode mode, double tension) |
| Re-resolve the kernel. | |
| CurveEvaluator (InterpolationMode mode=InterpolationMode::CATMULL_ROM, double tension=0.5) | |
| Construct and resolve the evaluation kernel. | |
| void | evaluate (const Eigen::MatrixXd &control_points, Eigen::Index num_samples, Eigen::MatrixXd &out) |
| Evaluate a curve into a caller-owned matrix. | |
| void | evaluate_planar (std::span< const double > control_points, size_t dim, Eigen::Index num_samples, std::vector< double > &out) |
| Evaluate a curve into a coordinate-major buffer. | |
| InterpolationMode | mode () const |
| Currently configured mode. | |
| void | reparameterize (const Eigen::MatrixXd &points, Eigen::Index num_samples, Eigen::MatrixXd &out) |
| Resample a polyline to uniform arc length into a caller-owned matrix. | |
| void | reparameterize_planar (std::span< const double > points, size_t dim, Eigen::Index point_count, Eigen::Index num_samples, std::vector< double > &out) |
| Resample a polyline to uniform arc length, coordinate-major. | |
| double | tension () const |
| Currently configured tension. | |
Private Member Functions | |
| void | build_chunks (Eigen::Index num_samples, Eigen::Index num_segments, Eigen::Index active_count) |
| const double * | extend (std::span< const double > control_points, size_t dim, Eigen::Index &count) |
| void | rebuild_kernel () |
Private Attributes | |
| std::vector< double > | m_arc |
| std::vector< double > | m_basis |
| std::vector< CurveChunk > | m_chunks |
| std::vector< double > | m_extended |
| std::vector< double > | m_folded |
| std::vector< double > | m_frac |
| std::vector< size_t > | m_lower |
| InterpolationMode | m_mode |
| Eigen::Index | m_overlap { 0 } |
| std::vector< double > | m_planar |
| std::vector< double > | m_planar_alt |
| Eigen::Index | m_points_per_segment { 0 } |
| std::vector< Eigen::Index > | m_seg_first |
| std::vector< Eigen::Index > | m_seg_total |
| bool | m_supports_multi { false } |
| std::vector< double > | m_tbuf |
| double | m_tension |
| bool | m_trigonometric { false } |
Reusable interpolation state for callers evaluating many curves.
The evaluation core operates on plain double buffers with no Eigen types and no allocation after the first call at given dimensions. Eigen appears only at the API boundary and in the basis matrix declarations.
Control points are point-major: the coordinate index varies fastest, so point q occupies control_points[q * dim .. q * dim + dim). This matches the memory of a column-major Eigen matrix whose columns are control points, so matrix.data() can be passed directly.
Planar output is coordinate-major: out[d * num_samples + i] is coordinate d of sample i. Consecutive samples of one coordinate are contiguous, which is what lets the sample axis occupy the SIMD lanes. Callers wanting an Eigen matrix pay one transpose in the boundary overloads.
Mode and tension resolve once to a single basis matrix, applied to the control block once per chunk rather than per sample. Each coordinate is then a Horner evaluation over the sample parameter, four samples per vector under AVX2 and two under NEON.
Not thread safe. One instance per thread, or one per node.
Definition at line 144 of file MotionCurves.hpp.