MayaFlux 0.3.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 443 of file MatrixHelper.hpp.

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

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

+ Here is the call graph for this function: