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

◆ interpolate_nddata()

MAYAFLUX_API Kakshya::DataVariant MayaFlux::Kinesis::interpolate_nddata ( const Kakshya::DataVariant &  control_points,
Eigen::Index  num_samples,
InterpolationMode  mode,
double  tension = 0.5 
)

Process DataVariant through interpolation.

Parameters
control_pointsInput data as control points
num_samplesNumber of output samples
modeInterpolation mode
tensionTension parameter
Returns
Interpolated data

Definition at line 1086 of file MotionCurves.cpp.

1091{
1092 Eigen::MatrixXd control_matrix = Kakshya::to_eigen_matrix(control_points);
1093
1094 Eigen::MatrixXd interpolated = generate_interpolated_points(
1095 control_matrix, num_samples, mode, tension);
1096
1097 Kakshya::EigenAccess input_access(control_points);
1098
1099 if (input_access.is_complex()) {
1100 return Kakshya::from_eigen_matrix(interpolated, Kakshya::MatrixInterpretation::COMPLEX);
1101 }
1102
1103 if (input_access.is_structured()) {
1104 switch (input_access.component_count()) {
1105 case 2:
1106 return Kakshya::from_eigen_matrix(interpolated, Kakshya::MatrixInterpretation::VEC2);
1107 case 3:
1108 return Kakshya::from_eigen_matrix(interpolated, Kakshya::MatrixInterpretation::VEC3);
1109 case 4:
1110 return Kakshya::from_eigen_matrix(interpolated, Kakshya::MatrixInterpretation::VEC4);
1111 default:
1112 return Kakshya::from_eigen_matrix(interpolated, Kakshya::MatrixInterpretation::SCALAR);
1113 }
1114 } else {
1115 return Kakshya::from_eigen_matrix(interpolated, Kakshya::MatrixInterpretation::SCALAR);
1116 }
1117}
uint32_t mode
Type-erased accessor for converting DataVariant to Eigen types.
Eigen::MatrixXd generate_interpolated_points(const Eigen::MatrixXd &control_points, Eigen::Index num_samples, InterpolationMode mode, double tension)
Generate interpolated points from control points.

References MayaFlux::Kakshya::COMPLEX, MayaFlux::Kakshya::EigenAccess::component_count(), MayaFlux::Kakshya::from_eigen_matrix(), generate_interpolated_points(), interpolate_nddata(), MayaFlux::Kakshya::EigenAccess::is_complex(), MayaFlux::Kakshya::EigenAccess::is_structured(), mode, MayaFlux::Kakshya::SCALAR, MayaFlux::Kakshya::to_eigen_matrix(), MayaFlux::Kakshya::VEC2, MayaFlux::Kakshya::VEC3, and MayaFlux::Kakshya::VEC4.

Referenced by interpolate_nddata().

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