43 #include <visp/vpDisplay.h>
44 #include <visp/vpDisplayException.h>
46 #include <visp/vpPoint.h>
47 #include <visp/vpMeterPixelConversion.h>
48 #include <visp/vpMath.h>
80 const char *fontname )
103 const char *windowtitle )
208 double top = floor(roi.
getTop());
209 double left = floor(roi.
getLeft());
210 double roiheight = floor(roi.
getHeight());
211 double roiwidth = floor(roi.
getWidth());
212 double iheight = (double)(I.
getHeight());
213 double iwidth = (double)(I.
getWidth());
215 if (top < 0 || top > iheight || left < 0 || left > iwidth || top+roiheight > iheight || left+roiwidth > iwidth)
217 vpERROR_TRACE (
"Region of interest outside of the image" ) ;
314 "Display not initialized" ) ) ;
350 const vpColor &color,
unsigned int thickness)
419 double size,
const vpColor &color,
420 unsigned int thickness )
489 double halfSize = size/2.0;
497 for (
int i = 0; i < 5; i++)
498 pt[i].track ( cMo ) ;
503 for (
int i = 0; i < 4; i++)
535 double size,
const vpColor &color)
538 double halfSize = size/2.0;
546 for (
int i = 0; i < 5; i++)
547 pt[i].track ( cMo ) ;
552 for (
int i = 0; i < 4; i++)
573 unsigned int w,
unsigned int h,
574 unsigned int thickness )
603 unsigned int w,
unsigned int h,
604 unsigned int thickness )
632 int i1,
int j1,
int i2,
int j2,
634 unsigned int w,
unsigned int h,
635 unsigned int thickness)
670 int i1,
int j1,
int i2,
int j2,
672 unsigned int w,
unsigned int h,
673 unsigned int thickness)
777 int i,
int j,
const char *
string,
814 int i,
int j,
const char *
string,
849 unsigned int thickness)
879 unsigned int thickness )
908 int i,
int j,
unsigned int radius,
911 unsigned int thickness)
946 int i,
int j,
unsigned int radius,
949 unsigned int thickness)
979 unsigned int thickness )
1006 unsigned int thickness )
1031 unsigned int size,
const vpColor &color,
1032 unsigned int thickness )
1062 unsigned int size,
const vpColor &color,
1063 unsigned int thickness )
1093 unsigned int thickness )
1120 unsigned int thickness )
1145 int i1,
int j1,
int i2,
int j2,
1147 unsigned int thickness )
1180 unsigned int thickness )
1212 unsigned int thickness )
1239 int i1,
int j1,
int i2,
int j2,
1241 unsigned int thickness )
1277 unsigned int thickness )
1310 unsigned int thickness )
1446 unsigned int width,
unsigned int height,
1447 const vpColor &color,
bool fill,
1448 unsigned int thickness)
1484 const vpColor &color,
bool fill,
1485 unsigned int thickness)
1518 const vpColor &color,
bool fill,
1519 unsigned int thickness )
1555 unsigned int width,
unsigned int height,
1557 unsigned int thickness)
1563 double i = center.
get_i();
1564 double j = center.
get_j();
1568 double cosinus = cos(angle);
1569 double sinus = sin(angle);
1570 ipa.
set_u(j + 0.5*width*cosinus + 0.5*height*sinus);
1571 ipa.
set_v(i + 0.5*width*sinus - 0.5*height*cosinus);
1572 ipb.
set_u(j + 0.5*width*cosinus - 0.5*height*sinus);
1573 ipb.
set_v(i + 0.5*width*sinus + 0.5*height*cosinus);
1574 ipc.
set_u(j - 0.5*width*cosinus - 0.5*height*sinus);
1575 ipc.
set_v(i - 0.5*width*sinus + 0.5*height*cosinus);
1576 ipd.
set_u(j - 0.5*width*cosinus + 0.5*height*sinus);
1577 ipd.
set_v(i - 0.5*width*sinus - 0.5*height*cosinus);
1609 unsigned int width,
unsigned int height,
1610 const vpColor &color,
bool fill,
1611 unsigned int thickness)
1645 const vpColor &color,
bool fill,
1646 unsigned int thickness)
1679 const vpColor &color,
bool fill,
1680 unsigned int thickness )
1716 unsigned int width,
unsigned int height,
1718 unsigned int thickness)
1724 double i = center.
get_i();
1725 double j = center.
get_j();
1729 double cosinus = cos(angle);
1730 double sinus = sin(angle);
1731 ipa.
set_u(j + 0.5*width*cosinus + 0.5*height*sinus);
1732 ipa.
set_v(i + 0.5*width*sinus - 0.5*height*cosinus);
1733 ipb.
set_u(j + 0.5*width*cosinus - 0.5*height*sinus);
1734 ipb.
set_v(i + 0.5*width*sinus + 0.5*height*cosinus);
1735 ipc.
set_u(j - 0.5*width*cosinus - 0.5*height*sinus);
1736 ipc.
set_v(i - 0.5*width*sinus + 0.5*height*cosinus);
1737 ipd.
set_u(j - 0.5*width*cosinus + 0.5*height*sinus);
1738 ipd.
set_v(i - 0.5*width*sinus - 0.5*height*cosinus);
1772 unsigned int width,
unsigned int height,
1773 const vpColor &color,
bool fill,
1774 unsigned int thickness)
1785 color, fill, thickness ) ;
1811 unsigned int i,
unsigned int j,
float angle,
1812 unsigned int width,
unsigned int height,
1813 const vpColor &color,
unsigned int thickness)
1821 float cosinus = cos(angle);
1822 float sinus = sin(angle);
1823 ipa.
set_u(j + 0.5*width*cosinus + 0.5*height*sinus);
1824 ipa.
set_v(i + 0.5*width*sinus - 0.5*height*cosinus);
1825 ipb.
set_u(j + 0.5*width*cosinus - 0.5*height*sinus);
1826 ipb.
set_v(i + 0.5*width*sinus + 0.5*height*cosinus);
1827 ipc.
set_u(j - 0.5*width*cosinus - 0.5*height*sinus);
1828 ipc.
set_v(i - 0.5*width*sinus + 0.5*height*cosinus);
1829 ipd.
set_u(j - 0.5*width*cosinus + 0.5*height*sinus);
1830 ipd.
set_v(i - 0.5*width*sinus - 0.5*height*cosinus);
1864 unsigned int width,
unsigned int height,
1865 const vpColor &color,
bool fill,
1866 unsigned int thickness)
1877 color, fill, thickness ) ;
1902 unsigned int i,
unsigned int j,
float angle,
1903 unsigned int width,
unsigned int height,
1904 const vpColor &color,
unsigned int thickness)
1912 float cosinus = cos(angle);
1913 float sinus = sin(angle);
1914 ipa.
set_u(j + 0.5*width*cosinus + 0.5*height*sinus);
1915 ipa.
set_v(i + 0.5*width*sinus - 0.5*height*cosinus);
1916 ipb.
set_u(j + 0.5*width*cosinus - 0.5*height*sinus);
1917 ipb.
set_v(i + 0.5*width*sinus + 0.5*height*cosinus);
1918 ipc.
set_u(j - 0.5*width*cosinus - 0.5*height*sinus);
1919 ipc.
set_v(i - 0.5*width*sinus + 0.5*height*cosinus);
1920 ipd.
set_u(j - 0.5*width*cosinus + 0.5*height*sinus);
1921 ipd.
set_v(i - 0.5*width*sinus - 0.5*height*cosinus);
2151 "Display not initialized" ) ) ;
2165 double top = floor(roi.
getTop());
2166 double left = floor(roi.
getLeft());
2167 double roiheight = floor(roi.
getHeight());
2168 double roiwidth = floor(roi.
getWidth());
2169 double iheight = (double)(I.
getHeight());
2170 double iwidth = (double)(I.
getWidth());
2172 if (top < 0 || top >= iheight || left < 0 || left >= iwidth || top+roiheight >= iheight || left+roiwidth >= iwidth)
2174 vpERROR_TRACE (
"Region of interest outside of the image" ) ;
2176 "Region of interest outside of the image" ) ) ;
2270 "Display not initialized" ) ) ;
2386 return ( I.
display )->getClick(blocking) ;
2391 "Display not initialized" ) ) ;
2429 return ( I.
display )->getClick ( ip, blocking ) ;
2434 "Display not initialized" ) ) ;
2475 return ( I.
display )->getClick ( ip, button, blocking ) ;
2480 "Display not initialized" ) ) ;
2522 return ( I.
display )->getClickUp ( ip, button, blocking ) ;
2527 "Display not initialized" ) ) ;
2625 return ( I.
display )->getKeyboardEvent ( blocking ) ;
2723 char *
string,
bool blocking)
2729 return ( I.
display )->getKeyboardEvent (
string, blocking ) ;
2757 return ( I.
display )->getPointerMotionEvent ( ip ) ;
2786 return ( I.
display )->getPointerPosition ( ip ) ;
2816 return ( I.
display )->getClick(blocking) ;
2821 "Display not initialized" ) ) ;
2858 return ( I.
display )->getClick ( ip, blocking ) ;
2863 "Display not initialized" ) ) ;
2903 return ( I.
display )->getClick ( ip, button, blocking ) ;
2908 "Display not initialized" ) ) ;
2949 return ( I.
display )->getClickUp ( ip, button, blocking ) ;
2954 "Display not initialized" ) ) ;
3052 return ( I.
display )->getKeyboardEvent ( blocking ) ;
3150 char *
string,
bool blocking)
3156 return ( I.
display )->getKeyboardEvent (
string, blocking ) ;
3183 return ( I.
display )->getPointerMotionEvent ( ip ) ;
3210 return ( I.
display )->getPointerPosition ( ip ) ;
void set_j(const double j)
virtual void displayCircle(const vpImagePoint ¢er, unsigned int radius, const vpColor &color, bool fill=false, unsigned int thickness=1)=0
virtual void displayImage(const vpImage< unsigned char > &I)=0
virtual void displayArrow(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color=vpColor::white, unsigned int w=4, unsigned int h=2, unsigned int thickness=1)=0
unsigned int getWidth() const
The class provides a data structure for the homogeneous matrices as well as a set of operations on th...
static void convertPoint(const vpCameraParameters &cam, const double &x, const double &y, double &u, double &v)
Point coordinates conversion from normalized coordinates in meter to pixel coordinates ...
static void displayCamera(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color)
Class to define colors available for display functionnalities.
virtual void clearDisplay(const vpColor &color=vpColor::white)=0
void set_i(const double i)
static const vpColor none
virtual bool getClickUp(vpImagePoint &ip, vpMouseButton::vpMouseButtonType &button, bool blocking=true)=0
void track(const vpHomogeneousMatrix &cMo)
virtual bool getPointerMotionEvent(vpImagePoint &ip)=0
char * title
display title
bool displayHasBeenInitialized
display has been initialized
static const vpColor green
static void flush(const vpImage< unsigned char > &I)
vpImagePoint getTopLeft() const
Class that defines what is a point.
virtual void flushDisplay()=0
virtual bool getPointerPosition(vpImagePoint &ip)=0
virtual bool getKeyboardEvent(bool blocking=true)=0
void set_u(const double u)
virtual void setWindowPosition(int winx, int winy)=0
static void display(const vpImage< unsigned char > &I)
virtual void displayCross(const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)=0
void set_v(const double v)
Generic class defining intrinsic camera parameters.
virtual void displayImageROI(const vpImage< unsigned char > &I, const vpImagePoint &iP, const unsigned int width, const unsigned int height)=0
virtual void setTitle(const char *title)=0
virtual void setFont(const char *font)=0
virtual void displayRectangle(const vpImagePoint &topLeft, unsigned int width, unsigned int height, const vpColor &color, bool fill=false, unsigned int thickness=1)=0
static void displayFrame(const vpImage< unsigned char > &I, const vpHomogeneousMatrix &cMo, const vpCameraParameters &cam, double size, const vpColor &color, unsigned int thickness=1)
static void close(const vpImage< unsigned char > &I)
static void getImage(const vpImage< unsigned char > &Is, vpImage< vpRGBa > &Id)
virtual void displayDotLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)=0
Error that can be emited by the vpDisplay class and its derivates.
virtual void closeDisplay()=0
virtual void displayCharString(const vpImagePoint &ip, const char *text, const vpColor &color=vpColor::green)=0
static void setBackground(const vpImage< unsigned char > &I, const vpColor &color)
unsigned int getHeight() const
Defines a rectangle in the plane.
static void flushROI(const vpImage< unsigned char > &I, const vpRect &roi)
static void displayROI(const vpImage< unsigned char > &I, const vpRect &roi)
virtual bool getClick(bool blocking=true)=0
Class that defines a 2D point in an image. This class is useful for image processing and stores only ...
virtual void displayLine(const vpImagePoint &ip1, const vpImagePoint &ip2, const vpColor &color, unsigned int thickness=1)=0
virtual void flushDisplayROI(const vpImagePoint &iP, const unsigned int width, const unsigned int height)=0
virtual void displayPoint(const vpImagePoint &ip, const vpColor &color)=0
static const vpColor blue
void setWorldCoordinates(const double ox, const double oy, const double oz)
Set the point world coordinates. We mean here the coordinates of the point in the object frame...