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

◆ extract_inputs()

template<ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = InputType>
virtual std::pair< std::vector< std::vector< double > >, DataStructureInfo > MayaFlux::Yantra::GpuExecutionContext< InputType, OutputType >::extract_inputs ( const input_type input)
inlineprotectedvirtual

Extract double channels and structure metadata from the input Datum.

Default replicates the previous inline behaviour: calls OperationHelper::extract_structured_double and copies spans into owned vectors.

Override to return ({}, {}) when the shader reads only from pre-staged image or passthrough bindings and channel extraction is meaningless for the input type.

Definition at line 90 of file GpuExecutionContext.hpp.

91 {
92 auto [spans, structure_info] = OperationHelper::extract_structured_double(
93 const_cast<input_type&>(input));
94
95 std::vector<std::vector<double>> channels(spans.size());
96 for (size_t c = 0; c < spans.size(); ++c)
97 channels[c].assign(spans[c].begin(), spans[c].end());
98
99 return { std::move(channels), std::move(structure_info) };
100 }
static std::tuple< std::vector< std::span< double > >, DataStructureInfo > extract_structured_double(T &compute_data)
Extract structured double data from Datum container or direct ComputeData with automatic container ha...