Skip to content

Commit 193eb0f

Browse files
authored
PR #12169 from Ohad's #12105: Draw cross in calibration ROI
2 parents 407a02a + 282b6dc commit 193eb0f

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

common/stream-model.cpp

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ namespace rs2
7878
glPopAttrib();
7979
}
8080

81-
void draw_rect(const rect& r, int line_width)
81+
void draw_rect( const rect & r, int line_width, bool draw_cross )
8282
{
8383
glPushAttrib(GL_ENABLE_BIT);
8484

@@ -96,6 +96,20 @@ namespace rs2
9696
glVertex2f(r.x, r.y);
9797
glEnd();
9898

99+
if( draw_cross )
100+
{
101+
glLineStipple( 1, 0x0808 );
102+
glEnable( GL_LINE_STIPPLE );
103+
glBegin( GL_LINES );
104+
glVertex2f( r.x, r.y + r.h / 2 );
105+
glVertex2f( r.x + r.w, r.y + r.h / 2 );
106+
glEnd();
107+
glBegin( GL_LINES );
108+
glVertex2f( r.x + r.w / 2, r.y );
109+
glVertex2f( r.x + r.w / 2, r.y + r.h );
110+
glEnd();
111+
}
112+
99113
glPopAttrib();
100114
}
101115

@@ -1541,7 +1555,7 @@ namespace rs2
15411555

15421556
r = r.normalize(_normalized_zoom.unnormalize(get_original_stream_bounds())).unnormalize(stream_rect).cut_by(stream_rect);
15431557
glColor3f(yellow.x, yellow.y, yellow.z);
1544-
draw_rect(r, 2);
1558+
draw_rect(r, 2, true);
15451559

15461560
std::string message = "Metrics Region of Interest";
15471561
auto msg_width = stb_easy_font_width((char*)message.c_str());

common/stream-model.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace rs2
1414
class subdevice_model;
1515
class viewer_model;
1616

17-
void draw_rect(const rect& r, int line_width = 1);
17+
void draw_rect(const rect& r, int line_width = 1, bool draw_cross = false);
1818

1919
struct frame_metadata
2020
{

0 commit comments

Comments
 (0)