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

◆ transform_matrix() [2/2]

template<OperationReadyData DataType>
DataType MayaFlux::Yantra::transform_matrix ( DataType &  input,
const Eigen::MatrixXd &  transformation_matrix,
std::vector< std::vector< double > > &  working_buffer 
)

Matrix transformation using existing infrastructure (OUT-OF-PLACE)

Template Parameters
DataTypeOperationReadyData type
Parameters
inputInput data - will NOT be modified
transformation_matrixMatrix to apply
working_bufferBuffer for operations (will be resized if needed)
Returns
Transformed data

Definition at line 441 of file MatrixHelper.hpp.

442{
443 auto [target_data, structure_info] = OperationHelper::setup_operation_buffer(input, working_buffer);
444
445 for (size_t channel_idx = 0; channel_idx < target_data.size(); ++channel_idx) {
446 auto& channel_span = target_data[channel_idx];
447 if (transformation_matrix.cols() == static_cast<long>(channel_span.size())) {
448 Eigen::Map<Eigen::VectorXd> data_vector(channel_span.data(), channel_span.size());
449 Eigen::VectorXd result = transformation_matrix * data_vector;
450
451 working_buffer[channel_idx].resize(result.size());
452 std::ranges::copy(result, working_buffer[channel_idx].begin());
453 }
454 }
455
456 return OperationHelper::reconstruct_from_double<DataType>(working_buffer, structure_info);
457}

References MayaFlux::Yantra::OperationHelper::setup_operation_buffer().

+ Here is the call graph for this function: