34#include <visp3/core/vpDisplay.h>
36#include "vpDisplay_impl.h"
59 const vpColor &color,
unsigned int w,
unsigned int h,
unsigned int thickness)
61 vp_display_display_arrow(I, ip1, ip2, color, w, h, thickness);
78 unsigned int w,
unsigned int h,
unsigned int thickness)
80 vp_display_display_arrow(I, i1, j1, i2, j2, color, w, h, thickness);
97 double size,
const vpColor &color,
unsigned int thickness)
99 vp_display_display_camera(I, cMo, cam, size, color, thickness);
102#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS)
119 vp_display_display_text(I, ip,
string, color);
138 vp_display_display_text(I, i, j,
string, color);
154 const vpColor &color,
bool fill,
unsigned int thickness)
156 vp_display_display_circle(I, circle.
getCenter(),
static_cast<unsigned int>(circle.
getRadius()), color, fill, thickness);
172 const vpColor &color,
bool fill,
unsigned int thickness)
174 vp_display_display_circle(I, center, radius, color, fill, thickness);
191 bool fill,
unsigned int thickness)
193 vp_display_display_circle(I, i, j, radius, color, fill, thickness);
205 unsigned int thickness)
207 vp_display_display_cross(I, ip, size, color, thickness);
220 unsigned int thickness)
222 vp_display_display_cross(I, i, j, size, color, thickness);
234 const vpColor &color,
unsigned int thickness)
236 vp_display_display_dot_line(I, ip1, ip2, color, thickness);
250 unsigned int thickness)
252 vp_display_display_dot_line(I, i1, j1, i2, j2, color, thickness);
265 const vpColor &color,
unsigned int thickness)
267 if (ips.size() <= 1) {
270 size_t ips_size = ips.size();
271 for (
size_t i = 0; i < (ips_size - 1); ++i) {
272 vp_display_display_dot_line(I, ips[i], ips[i + 1], color, thickness);
276 vp_display_display_dot_line(I, ips.front(), ips.back(), color, thickness);
290 const vpColor &color,
unsigned int thickness)
292 if (ips.size() <= 1) {
296 std::list<vpImagePoint>::const_iterator it = ips.begin();
299 std::list<vpImagePoint>::const_iterator ips_end = ips.end();
300 for (; it != ips_end; ++it) {
302 vp_display_display_dot_line(I, ip_prev, *it, color, thickness);
308 vp_display_display_dot_line(I, ips.front(), ips.back(), color, thickness);
358 const double &coef2,
const double &coef3,
bool use_normalized_centered_moments,
359 const vpColor &color,
unsigned int thickness,
bool display_center,
bool display_arc)
362 thickness, display_center, display_arc);
414 const double &coef2,
const double &coef3,
const double &smallalpha,
415 const double &highalpha,
bool use_normalized_centered_moments,
const vpColor &color,
416 unsigned int thickness,
bool display_center,
bool display_arc)
418 vp_display_display_ellipse(I, center, coef1, coef2, coef3, smallalpha, highalpha, use_normalized_centered_moments,
419 color, thickness, display_center, display_arc);
442 vp_display_display_frame(I, cMo, cam, size, color, thickness, offset, frameName, textColor, textOffset);
456 const vpColor &color,
unsigned int thickness,
bool segment)
459 static_cast<int>(ip2.
get_j()), color, thickness, segment);
475 unsigned int thickness,
bool segment)
478 vp_display_display_line(I, i1, j1, i2, j2, color, thickness);
482 double delta_j =
static_cast<double>(j2) -
static_cast<double>(j1);
483 double delta_i =
static_cast<double>(i2) -
static_cast<double>(i1);
484 int w =
static_cast<int>(I.getWidth());
485 int h =
static_cast<int>(I.getHeight());
487 if (std::fabs(delta_i) <= std::numeric_limits<double>::epsilon()) {
488 vp_display_display_line(I, i1, 0, i1, (w - 1), color, thickness);
491 else if (std::fabs(delta_j) <= std::numeric_limits<double>::epsilon()) {
492 vp_display_display_line(I, 0, j1, (h - 1), j1, color, thickness);
495 double a = delta_i / delta_j;
496 double b =
static_cast<double>(i1) - (a *
static_cast<double>(j1));
497 std::vector<vpImagePoint> vip;
500 if ((ip_left.
get_i() >= 0.) && (ip_left.
get_i() <= (h - 1.))) {
501 vip.push_back(ip_left);
505 if ((ip_right.
get_i() >= 0.) && (ip_right.
get_i() <= (h - 1.))) {
506 vip.push_back(ip_right);
508 if (vip.size() == 2) {
509 vp_display_display_line(I, vip[0], vip[1], color, thickness);
514 if ((ip_top.
get_j() >= 0.) && (ip_top.
get_j() <= (w - 1.))) {
515 vip.push_back(ip_top);
517 if (vip.size() == 2) {
518 vp_display_display_line(I, vip[0], vip[1], color, thickness);
523 if ((ip_bottom.
get_j() >= 0.) && (ip_bottom.
get_j() <= (w - 1.))) {
524 vip.push_back(ip_bottom);
526 if (vip.size() == 2) {
527 vp_display_display_line(I, vip[0], vip[1], color, thickness);
544 const vpColor &color,
unsigned int thickness)
546 if (ips.size() <= 1) {
550 size_t ips_size = ips.size();
551 for (
size_t i = 0; i < (ips_size - 1); ++i) {
552 vp_display_display_line(I, ips[i], ips[i + 1], color, thickness);
556 vp_display_display_line(I, ips.front(), ips.back(), color, thickness);
570 const vpColor &color,
unsigned int thickness)
572 if (ips.size() <= 1) {
576 std::list<vpImagePoint>::const_iterator it = ips.begin();
579 std::list<vpImagePoint>::const_iterator ips_end = ips.end();
580 for (; it != ips_end; ++it) {
582 vp_display_display_line(I, ip_prev, *it, color, thickness);
588 vp_display_display_line(I, ips.front(), ips.back(), color, thickness);
600 unsigned int thickness)
602 vp_display_display_point(I, ip, color, thickness);
615 vp_display_display_point(I, i, j, color, thickness);
627 unsigned int thickness,
bool closed)
629 vp_display_display_polygon(I, vip, color, thickness, closed);
641 unsigned int thickness,
bool closed)
643 vp_display_display_polygon(I, polygon, color, thickness, closed);
664 unsigned int height,
const vpColor &color,
bool fill,
unsigned int thickness)
666 vp_display_display_rectangle(I, topLeft, width, height, color, fill, thickness);
686 const vpColor &color,
bool fill,
unsigned int thickness)
688 vp_display_display_rectangle(I, i, j, width, height, color, fill, thickness);
707 unsigned int thickness)
709 vp_display_display_rectangle(I, rectangle, color, fill, thickness);
726 unsigned int height,
const vpColor &color,
unsigned int thickness)
728 vp_display_display_rectangle(I, center, angle, width, height, color, thickness);
748 const vpColor &color,
bool fill,
unsigned int thickness)
750 vp_display_display_rectangle(I, topLeft, bottomRight, color, fill, thickness);
768 unsigned int width,
unsigned int height,
const vpColor &color,
unsigned int thickness)
770 vp_display_display_rectangle(I, i, j, angle, width, height, color, thickness);
788 vp_display_display_text(I, ip, s, color);
806 vp_display_display_text(I, i, j, s, color);
913 return vp_display_get_click(I, ip, blocking);
939 return vp_display_get_click(I, ip, button, blocking);
987 return vp_display_get_click_up(I, ip, button, blocking);
1100 return vp_display_get_keyboard_event(I, blocking);
1195 return vp_display_get_keyboard_event(I, key, blocking);
1290 return vp_display_get_keyboard_event(I, key, blocking);
1304 return vp_display_get_pointer_motion_event(I, ip);
1318 return vp_display_get_pointer_position(I, ip);
1356 vp_display_set_title(I, windowtitle);
1372 vp_display_set_window_position(I, winx, winy);
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 VP_DEPRECATED void displayCharString(const vpImage< unsigned char > &I, const vpImagePoint &ip, const char *string, const vpColor &color)
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)
Definition of the vpImage class member functions.
Defines a generic 2D polygon.
Defines a rectangle in the plane.