From 8bd375fe0b3ccfa1f304a33406e310ce68047c3b Mon Sep 17 00:00:00 2001 From: Nicolas Pope <nwpope@utu.fi> Date: Mon, 27 Jan 2020 13:43:33 +0200 Subject: [PATCH] Allow live depth BL param change --- components/operators/src/depth.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/components/operators/src/depth.cpp b/components/operators/src/depth.cpp index 0fdbd60b6..ac84f668a 100644 --- a/components/operators/src/depth.cpp +++ b/components/operators/src/depth.cpp @@ -57,6 +57,13 @@ DepthBilateralFilter::DepthBilateralFilter(ftl::Configurable* cfg) : edge_disc_ = cfg->value("edge_discontinuity", 0.04f); max_disc_ = cfg->value("max_discontinuity", 0.1f); channel_ = Channel::Depth; + + cfg->on("edge_discontinuity", [this](const ftl::config::Event &e) { + edge_disc_ = config()->value("edge_discontinuity", 0.04f); + }); + cfg->on("max_discontinuity", [this](const ftl::config::Event &e) { + max_disc_ = config()->value("max_discontinuity", 0.1f); + }); calc_color_weighted_table(table_color_, sigma_range_, 255); @@ -73,6 +80,13 @@ DepthBilateralFilter::DepthBilateralFilter(ftl::Configurable* cfg, const std::tu edge_disc_ = cfg->value("edge_discontinuity", 0.04f); max_disc_ = cfg->value("max_discontinuity", 0.1f); channel_ = std::get<0>(p); + + cfg->on("edge_discontinuity", [this](const ftl::config::Event &e) { + edge_disc_ = config()->value("edge_discontinuity", 0.04f); + }); + cfg->on("max_discontinuity", [this](const ftl::config::Event &e) { + max_disc_ = config()->value("max_discontinuity", 0.1f); + }); calc_color_weighted_table(table_color_, sigma_range_, 255); -- GitLab