35 #include <visp3/core/vpDisplay.h>
37 #include "vpDisplay_impl.h"
58 const vpColor &color,
unsigned int w,
unsigned int h,
unsigned int thickness)
60 vp_display_display_arrow(I, ip1, ip2, color, w, h, thickness);
74 unsigned int w,
unsigned int h,
unsigned int thickness)
76 vp_display_display_arrow(I, i1, j1, i2, j2, color, w, h, thickness);
95 vp_display_display_camera(I, cMo, cam, size, color, thickness);
98 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
115 vp_display_display_text(I, ip,
string, color);
134 vp_display_display_text(I, i, j,
string, color);
150 const vpColor &color,
bool fill,
unsigned int thickness)
152 vp_display_display_circle(I, circle.
getCenter(),
static_cast<unsigned int>(circle.
getRadius()), color, fill, thickness);
168 const vpColor &color,
bool fill,
unsigned int thickness)
170 vp_display_display_circle(I, center, radius, color, fill, thickness);
186 bool fill,
unsigned int thickness)
188 vp_display_display_circle(I, i, j, radius, color, fill, thickness);
200 const vpColor &color,
unsigned int thickness)
202 vp_display_display_cross(I, ip, size, color, thickness);
214 unsigned int thickness)
216 vp_display_display_cross(I, i, j, size, color, thickness);
227 const vpColor &color,
unsigned int thickness)
229 vp_display_display_dot_line(I, ip1, ip2, color, thickness);
241 unsigned int thickness)
243 vp_display_display_dot_line(I, i1, j1, i2, j2, color, thickness);
256 bool closeTheShape,
const vpColor &color,
unsigned int thickness)
258 if (ips.size() <= 1) {
262 size_t ips_size = ips.size();
263 for (
size_t i = 0; i < (ips_size - 1); ++i) {
264 vp_display_display_dot_line(I, ips[i], ips[i + 1], color, thickness);
268 vp_display_display_dot_line(I, ips.front(), ips.back(), color, thickness);
282 const vpColor &color,
unsigned int thickness)
284 if (ips.size() <= 1) {
288 std::list<vpImagePoint>::const_iterator it = ips.begin();
289 std::list<vpImagePoint>::const_iterator it_end = ips.end();
292 for (; it != it_end; ++it) {
294 vp_display_display_dot_line(I, ip_prev, *it, color, thickness);
300 vp_display_display_dot_line(I, ips.front(), ips.back(), color, thickness);
341 const double &coef2,
const double &coef3,
bool use_normalized_centered_moments,
342 const vpColor &color,
unsigned int thickness,
bool display_center,
bool display_arc)
345 thickness, display_center, display_arc);
388 const double &coef2,
const double &coef3,
const double &smallalpha,
389 const double &highalpha,
bool use_normalized_centered_moments,
const vpColor &color,
390 unsigned int thickness,
bool display_center,
bool display_arc)
392 vp_display_display_ellipse(I, center, coef1, coef2, coef3, smallalpha, highalpha, use_normalized_centered_moments,
393 color, thickness, display_center, display_arc);
417 vp_display_display_frame(I, cMo, cam, size, color, thickness, offset, frameName, textColor, textOffset);
430 const vpColor &color,
unsigned int thickness,
bool segment)
433 static_cast<int>(ip2.
get_j()), color, thickness, segment);
447 unsigned int thickness,
bool segment)
450 vp_display_display_line(I, i1, j1, i2, j2, color, thickness);
454 double delta_j =
static_cast<double>(j2) -
static_cast<double>(j1);
455 double delta_i =
static_cast<double>(i2) -
static_cast<double>(i1);
457 if (std::fabs(delta_i) <= std::numeric_limits<double>::epsilon()) {
458 vp_display_display_line(I, i1, 0, i1, (I.
getWidth() - 1), color, thickness);
461 else if (std::fabs(delta_j) <= std::numeric_limits<double>::epsilon()) {
462 vp_display_display_line(I, 0, j1, (I.
getHeight() - 1), j1, color, thickness);
465 double a = delta_i / delta_j;
466 double b =
static_cast<double>(i1) - (a *
static_cast<double>(j1));
467 std::vector<vpImagePoint> vip;
471 vip.push_back(ip_left);
476 vip.push_back(ip_right);
478 if (vip.size() == 2) {
479 vp_display_display_line(I, vip[0], vip[1], color, thickness);
485 vip.push_back(ip_top);
487 if (vip.size() == 2) {
488 vp_display_display_line(I, vip[0], vip[1], color, thickness);
494 vip.push_back(ip_bottom);
496 if (vip.size() == 2) {
497 vp_display_display_line(I, vip[0], vip[1], color, thickness);
513 const vpColor &color,
unsigned int thickness)
515 if (ips.size() <= 1) {
519 size_t ips_size = ips.size();
520 for (
size_t i = 0; i < (ips_size - 1); ++i) {
521 vp_display_display_line(I, ips[i], ips[i + 1], color, thickness);
525 vp_display_display_line(I, ips.front(), ips.back(), color, thickness);
538 const vpColor &color,
unsigned int thickness)
540 if (ips.size() <= 1) {
544 std::list<vpImagePoint>::const_iterator it = ips.begin();
545 std::list<vpImagePoint>::const_iterator it_end = ips.end();
548 for (; it != it_end; ++it) {
550 vp_display_display_line(I, ip_prev, *it, color, thickness);
556 vp_display_display_line(I, ips.front(), ips.back(), color, thickness);
568 unsigned int thickness)
570 vp_display_display_point(I, ip, color, thickness);
581 unsigned int thickness)
583 vp_display_display_point(I, i, j, color, thickness);
595 const vpColor &color,
unsigned int thickness,
bool closed)
597 vp_display_display_polygon(I, vip, color, thickness, closed);
609 unsigned int thickness,
bool closed)
611 vp_display_display_polygon(I, polygon, color, thickness, closed);
631 unsigned int height,
const vpColor &color,
bool fill,
unsigned int thickness)
633 vp_display_display_rectangle(I, topLeft, width, height, color, fill, thickness);
651 const vpColor &color,
bool fill,
unsigned int thickness)
653 vp_display_display_rectangle(I, i, j, width, height, color, fill, thickness);
672 bool fill,
unsigned int thickness)
674 vp_display_display_rectangle(I, rectangle, color, fill, thickness);
691 unsigned int width,
unsigned int height,
const vpColor &color,
unsigned int thickness)
693 vp_display_display_rectangle(I, center, angle, width, height, color, thickness);
714 unsigned int thickness)
716 vp_display_display_rectangle(I, topLeft, bottomRight, color, fill, thickness);
733 unsigned int width,
unsigned int height,
const vpColor &color,
unsigned int thickness)
735 vp_display_display_rectangle(I, i, j, angle, width, height, color, thickness);
753 vp_display_display_text(I, ip, s, color);
770 vp_display_display_text(I, i, j, s, color);
877 return vp_display_get_click(I, ip, blocking);
903 return vp_display_get_click(I, ip, button, blocking);
951 return vp_display_get_click_up(I, ip, button, blocking);
1065 return vp_display_get_keyboard_event(I, blocking);
1160 return vp_display_get_keyboard_event(I, key, blocking);
1255 return vp_display_get_keyboard_event(I, key, blocking);
1269 return vp_display_get_pointer_motion_event(I, ip);
1283 return vp_display_get_pointer_position(I, ip);
1297 vp_display_set_background(I, color);
1315 vp_display_set_font(I, fontname);
1327 vp_display_set_title(I, windowtitle);
1342 vp_display_set_window_position(I, winx, winy);
1354 return vp_display_get_down_scaling_factor(I);
Generic class defining intrinsic camera parameters.
Class to define RGB colors available for display functionalities.
static void setBackground(const vpImage< unsigned char > &I, const vpColor &color)
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void displayCircle(const vpImage< unsigned char > &I, const vpImageCircle &circle, const vpColor &color, bool fill=false, unsigned int thickness=1)
static bool getKeyboardEvent(const vpImage< unsigned char > &I, bool blocking=true)
static void displayROI(const vpImage< unsigned char > &I, const vpRect &roi)
static void display(const vpImage< unsigned char > &I)
static void displayLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1, bool segment=true)
static void displayEllipse(const vpImage< unsigned char > &I, const vpImagePoint ¢er, const double &coef1, const double &coef2, const double &coef3, bool use_normalized_centered_moments, const vpColor &color, unsigned int thickness=1, bool display_center=false, bool display_arc=false)
static void displayFrame(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color=vpColor::none, unsigned int thickness=1, const vpImagePoint &offset=vpImagePoint(0, 0), const std::string &frameName="", const vpColor &textColor=vpColor::black, const vpImagePoint &textOffset=vpImagePoint(15, 15))
static void flushROI(const vpImage< unsigned char > &I, const vpRect &roi)
static bool getClickUp(const vpImage< unsigned char > &I, vpImagePoint &ip, vpMouseButton::vpMouseButtonType &button, bool blocking=true)
static void displayCross(const vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)
static void close(vpImage< unsigned char > &I)
static void setTitle(const vpImage< unsigned char > &I, const std::string &windowtitle)
static void flush(const vpImage< unsigned char > &I)
static void displayArrow(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color=vpColor::white, unsigned int w=4, unsigned int h=2, unsigned int thickness=1)
static void displayPoint(const vpImage< unsigned char > &I, const vpImagePoint &ip, const vpColor &color, unsigned int thickness=1)
static void setFont(const vpImage< unsigned char > &I, const std::string &font)
static void displayDotLine(const vpImage< unsigned char > &I, const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)
static bool getPointerPosition(const vpImage< unsigned char > &I, vpImagePoint &ip)
static bool getPointerMotionEvent(const vpImage< unsigned char > &I, vpImagePoint &ip)
static void displayCamera(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color, unsigned int thickness)
unsigned int getDownScalingFactor()
static void displayRectangle(const vpImage< unsigned char > &I, const vpImagePoint &topLeft, unsigned int width, unsigned int height, const vpColor &color, bool fill=false, unsigned int thickness=1)
static void setWindowPosition(const vpImage< unsigned char > &I, int winx, int winy)
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
static void displayPolygon(const vpImage< unsigned char > &I, const std::vector< vpImagePoint > &vip, const vpColor &color, unsigned int thickness=1, bool closed=true)
Implementation of an homogeneous matrix and operations on such kind of matrices.
Class that defines a 2D circle in an image.
vpImagePoint getCenter() const
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
static double distance(const vpImagePoint &iP1, const vpImagePoint &iP2)
unsigned int getWidth() const
unsigned int getHeight() const
Defines a generic 2D polygon.
Defines a rectangle in the plane.