3 #include "ColorMap.inl" 11 const size_t max_depth = 0x10000;
12 static size_t histogram[max_depth];
13 memset(histogram, 0,
sizeof(histogram));
18 for (
auto i = 0;
i <
w*
h; ++
i) ++histogram[depth_data[
i]];
19 for (
auto i = 2;
i < max_depth; ++
i) histogram[
i] += histogram[
i - 1];
21 const auto scale = 1.0f / (float)histogram[0xFFFF];
23 for (
auto i = 0;
i <
w*
h; ++
i)
25 const auto d = depth_data[
i];
29 const auto f = histogram[
d] *
scale;
30 const auto c = cm.get(
f);
52 const auto scale = 1.0f / (depth_max - depth_min);
56 for (
auto i = 0;
i <
w*
h; ++
i)
58 const auto d = depth_data[
i];
62 const auto f = (
d * depth_units - depth_min) *
scale;
63 const auto c = cm.get(
f);
83 auto& cm = *colormap_presets[colormap_id];
GLenum GLenum GLenum GLenum GLenum scale
GLint GLint GLsizei GLsizei GLsizei depth
const void * get_data() const
GLdouble GLdouble GLdouble w
GLfloat GLfloat GLfloat GLfloat h
void make_equalized_histogram(depth_pixel *dst, const rs2::video_frame &depth, const color_map &cm)
void colorize_depth(depth_pixel *dst, const rs2::video_frame &depth, int colormap_id, float depth_min, float depth_max, float depth_units, bool equalize)
void make_value_cropped_frame(depth_pixel *dst, const rs2::video_frame &depth, const color_map &cm, float depth_min, float depth_max, float depth_units)