Skip to content

Commit

Permalink
Fix HDR demo warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ev-mp committed Jan 19, 2021
1 parent a3d1151 commit e31962e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
24 changes: 12 additions & 12 deletions examples/example.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class hdr_slider : public slider {
bool is_changed =
ImGui::SliderFloat("", &_value, _min_value, _max_value, "%.3f", 5.0f, false); //5.0f for logarithmic scale
if (is_changed) {
_sensor.set_option(RS2_OPTION_SEQUENCE_ID, _seq_id);
_sensor.set_option(RS2_OPTION_SEQUENCE_ID, float(_seq_id));
_sensor.set_option(_option, _value);
}
ImGui::End();
Expand Down Expand Up @@ -268,9 +268,9 @@ class hdr_widgets {
const rs2::frame& hdr_frame, rs2_metadata_type hdr_seq_id, rs2_metadata_type hdr_seq_size) {

// frame index in frames_map are according to hdr_seq_id and hdr_seq_size
int infrared_index = hdr_seq_id;
int depth_index = hdr_seq_id + hdr_seq_size;
int hdr_index = hdr_seq_id + hdr_seq_size + 1;
int infrared_index = int(hdr_seq_id);
int depth_index = int(hdr_seq_id + hdr_seq_size);
int hdr_index = int(hdr_seq_id + hdr_seq_size + 1);

//work-around, 'get_frame_metadata' sometimes (after changing exposure or gain values) sets hdr_seq_size to 0 even though it 2 for few frames
//so we update the frames only if hdr_seq_size > 0. (hdr_seq_size==0 <-> frame is invalid)
Expand Down Expand Up @@ -751,10 +751,10 @@ class window
canvas_left_top_x < 0 || canvas_left_top_x > 1 || canvas_left_top_y < 0 || canvas_left_top_y > 1)
{
std::cout << "Invalid window's size parameter entered, setting to default values" << std::endl;
canvas_width = 0.8;
canvas_height = 0.6;
canvas_left_top_x = 0.15;
canvas_left_top_y = 0.075;
canvas_width = 0.8f;
canvas_height = 0.6f;
canvas_left_top_x = 0.15f;
canvas_left_top_y = 0.075f;
}

//user input verification for number of tiles in row and column
Expand All @@ -766,14 +766,14 @@ class window
}

//calculate canvas size
_canvas_width = _width * canvas_width;
_canvas_height = _height * canvas_height;
_canvas_width = int(_width * canvas_width);
_canvas_height = int(_height * canvas_height);
_canvas_left_top_x = _width * canvas_left_top_x;
_canvas_left_top_y = _height * canvas_left_top_y;

//calculate tile size
_tile_width_pixels = std::floor(_canvas_width / _tiles_in_row);
_tile_height_pixels = std::floor(_canvas_height / _tiles_in_col);
_tile_width_pixels = float(std::floor(_canvas_width / _tiles_in_row));
_tile_height_pixels = float(std::floor(_canvas_height / _tiles_in_col));

glfwInit();
// we don't want to enable resizing the window
Expand Down
4 changes: 2 additions & 2 deletions examples/post-processing/rs-post-processing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ int main(int argc, char * argv[]) try
if (colored_depth && original_points)
{
glViewport(0, int(h) / 2, int(w) / 2, int(h) / 2);
draw_pointcloud(int(w) / 2, int(h) / 2, original_view_orientation, original_points);
draw_pointcloud(int(w) / 2.f, int(h) / 2.f, original_view_orientation, original_points);
}
if (colored_filtered && filtered_points)
{
glViewport(int(w) / 2, int(h) / 2, int(w) / 2, int(h) / 2);
draw_pointcloud(int(w) / 2, int(h) / 2, filtered_view_orientation, filtered_points);
draw_pointcloud(int(w) / 2.f, int(h) / 2.f, filtered_view_orientation, filtered_points);
}
// Update time of current frame's arrival
auto curr = std::chrono::high_resolution_clock::now();
Expand Down

0 comments on commit e31962e

Please sign in to comment.