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

◆ reduce()

std::vector< double > MayaFlux::Yantra::SegmentedReductionContext::reduce ( std::span< const double > values,
const SegmentGeometry & geometry )
inlinenodiscard

Reduce every segment.

Parameters
valuesDoubles the segments index into.
geometrySegment length, stride, first offset and count. Every segment must lie inside values.
Returns
One double per segment, empty when there are no segments.

Definition at line 47 of file SegmentedReductionContext.hpp.

48 {
49 if (geometry.count == 0) {
50 return {};
51 }
52 stage(values, geometry);
53 execute(Datum<std::vector<Kakshya::DataVariant>> {}, ExecutionContext {});
54
55 const auto result = primary_values();
56 return { result.begin(), result.end() };
57 }
void stage(std::span< const double > values, const SegmentGeometry &geometry)
Stage values and geometry for the next dispatch without running it.
output_type execute(const input_type &input, const ExecutionContext &ctx) override
Injects multipass configuration into the context before dispatch when set_multipass() has been called...
std::span< const double > primary_values() const noexcept
The primary output of the last dispatch decoded to doubles.

References MayaFlux::Yantra::SegmentGeometry::count, MayaFlux::Yantra::ShaderExecutionContext< InputType, OutputType >::execute(), MayaFlux::Yantra::WordPairExecutionContext::primary_values(), and stage().

Here is the call graph for this function: