Visual Servoing Platform version 3.6.0
Loading...
Searching...
No Matches
tutorial-draw-cross.cpp
1
2#include <visp3/gui/vpDisplayGDI.h>
3#include <visp3/gui/vpDisplayX.h>
4
5int main()
6{
7 vpImage<unsigned char> I(2160, 3840, 128);
8
9 try {
10
11#if defined(VISP_HAVE_X11)
13#elif defined(VISP_HAVE_GDI)
15#endif
16
17 vpDisplay::setTitle(I, "My image");
20 vpDisplay::displayCross(I, I.getHeight() / 2, I.getWidth() / 2, I.getWidth() / 2, vpColor::red, 2);
23 std::cout << "A click to quit..." << std::endl;
25 } catch (const vpException &e) {
26 std::cout << "Catch an exception: " << e.getMessage() << std::endl;
27 }
28 std::cout << std::endl;
29}
static const vpColor red
Definition vpColor.h:211
Display for windows using GDI (available on any windows 32 platform).
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
Definition vpDisplayX.h:132
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
static void displayCross(const vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)
static void setTitle(const vpImage< unsigned char > &I, const std::string &windowtitle)
static void flush(const vpImage< unsigned char > &I)
error that can be emitted by ViSP classes.
Definition vpException.h:59
const char * getMessage() const
Definition of the vpImage class member functions.
Definition vpImage.h:135
unsigned int getWidth() const
Definition vpImage.h:242
unsigned int getHeight() const
Definition vpImage.h:184