Skip to content

Commit

Permalink
Colorizer: check depth stream format supported or not before process
Browse files Browse the repository at this point in the history
  • Loading branch information
Arun-Prasad-V committed Mar 25, 2024
1 parent 9e8b5ec commit 97be414
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 97be414

Please sign in to comment.