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

◆ compute_mean_brightness()

float MayaFlux::Yantra::VisionAnalyzer::compute_mean_brightness ( const std::array< uint32_t, 256 > &  histogram)
private

Dispatch histogram_reduce.comp over an already-computed histogram.

Definition at line 369 of file VisionAnalyzer.cpp.

370{
372 m_brightness_reducer = std::make_shared<ShaderExecutionContext<>>(
374 .shader_path = "histogram_reduce.comp.spv",
375 .workgroup_size = { 256, 1, 1 },
376 .push_constant_size = 0 });
377 }
378
379 const std::vector<uint32_t> hist_vec(histogram.begin(), histogram.end());
381 .output(1, sizeof(float));
382
383 const auto output = m_brightness_reducer->execute(Datum<std::vector<Kakshya::DataVariant>> {}, ExecutionContext {});
384 const auto raw = ShaderExecutionContext<>::read_output<float>(output, 1);
385 return raw.empty() ? 0.0F : raw[0];
386}
std::shared_ptr< ShaderExecutionContext<> > m_brightness_reducer
Portal::Graphics::GpuComputeConfig GpuComputeConfig

References m_brightness_reducer, MayaFlux::Portal::Graphics::GpuComputeConfig::shader_path, and MayaFlux::Portal::Graphics::GpuBufferBinding::UINT32.

Referenced by measure_appearance().

+ Here is the caller graph for this function: