From 1988dd171c01f73650fbb9bfefded03347263131 Mon Sep 17 00:00:00 2001 From: Nicolas Pope <nicolas.pope@utu.fi> Date: Tue, 15 Oct 2019 19:06:20 +0300 Subject: [PATCH] Implements #207 showing aligned input as virtual view --- components/renderers/cpp/src/splat_render.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/renderers/cpp/src/splat_render.cpp b/components/renderers/cpp/src/splat_render.cpp index 7cba3d7b8..9ea54526d 100644 --- a/components/renderers/cpp/src/splat_render.cpp +++ b/components/renderers/cpp/src/splat_render.cpp @@ -311,7 +311,16 @@ bool Splatter::render(ftl::rgbd::VirtualSource *src, ftl::rgbd::Frame &out) { out.create<GpuMat>(Channel::Depth, Format<float>(camera.width, camera.height)); out.create<GpuMat>(Channel::Colour, Format<uchar4>(camera.width, camera.height)); + if (scene_->frames.size() == 0) return false; + + int aligned_source = value("aligned_source",-1); + if (aligned_source >= 0 && aligned_source < scene_->frames.size()) { + // FIXME: Output may not be same resolution as source! + scene_->frames[aligned_source].swapTo(Channel::Depth + Channel::Colour, out); + return true; + } + auto &g = scene_->frames[0].get<GpuMat>(Channel::Colour); temp_.create<GpuMat>(Channel::Colour, Format<float4>(camera.width, camera.height)); -- GitLab