Skip to content
Snippets Groups Projects
Commit dc566df7 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Respond to render intrinsics change

parent 6550fdaa
No related branches found
No related tags found
1 merge request!316Resolves #343 GUI and Frame Refactor
......@@ -31,6 +31,17 @@ ScreenRender::ScreenRender(ftl::render::Source *host, ftl::stream::Feed *feed)
);
intrinsics_ = ftl::create<ftl::Configurable>(host_, "intrinsics");
refresh_calibration_ = false;
intrinsics_->on("focal", [this](const ftl::config::Event &e) {
refresh_calibration_ = true;
});
intrinsics_->on("width", [this](const ftl::config::Event &e) {
refresh_calibration_ = true;
});
intrinsics_->on("height", [this](const ftl::config::Event &e) {
refresh_calibration_ = true;
});
filter_ = nullptr;
std::string source = host_->value("source", std::string(""));
......@@ -78,7 +89,8 @@ bool ScreenRender::retrieve(ftl::data::Frame &frame_out) {
if (sets.size() > 0) {
ftl::rgbd::Frame &rgbdframe = frame_out.cast<ftl::rgbd::Frame>();
if (!frame_out.has(Channel::Calibration)) {
if (!frame_out.has(Channel::Calibration) || refresh_calibration_) {
refresh_calibration_ = false;
rgbdframe.setLeft() = ftl::rgbd::Camera::from(intrinsics_);
if (!frame_out.has(Channel::Capabilities)) {
......
......@@ -34,6 +34,7 @@ class ScreenRender : public ftl::render::BaseSourceImpl {
ftl::Configurable *intrinsics_;
uint32_t my_id_;
ftl::operators::Graph *post_pipe_;
bool refresh_calibration_;
};
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment