Skip to content

Commit

Permalink
PR IntelRealSense#12765 from Arun-Prasad-V: [Colorizer] Check Depth s…
Browse files Browse the repository at this point in the history
…tream format supported or not before process
  • Loading branch information
Nir-Az authored Mar 25, 2024
2 parents 55239bd + 97be414 commit 9746e5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/proc/colorizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,11 @@ namespace librealsense
if (!frame || frame.is<rs2::frameset>())
return false;

if (frame.get_profile().stream_type() != RS2_STREAM_DEPTH)
return false;
if ((frame.get_profile().stream_type() == RS2_STREAM_DEPTH) &&
(_supported_formats.find(frame.get_profile().format()) != _supported_formats.end()))
return true;

return true;
return false;
}

rs2::frame colorizer::process_frame(const rs2::frame_source& source, const rs2::frame& f)
Expand Down
3 changes: 3 additions & 0 deletions src/proc/colorizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <map>
#include <vector>
#include <set>

namespace rs2
{
Expand Down Expand Up @@ -169,5 +170,7 @@ namespace librealsense {

float _depth_units = 0.f;
float _d2d_convert_factor = 0.f;

const std::set<rs2_format> _supported_formats = {RS2_FORMAT_Z16, RS2_FORMAT_DISPARITY32};
};
}

0 comments on commit 9746e5e

Please sign in to comment.