Visual Servoing Platform  version 3.6.1 under development (2024-11-15)
tutorial-draw-point.cpp
1 #include <visp3/core/vpConfig.h>
3 #include <visp3/gui/vpDisplayGDI.h>
4 #include <visp3/gui/vpDisplayX.h>
5 
6 int main()
7 {
8 #ifdef ENABLE_VISP_NAMESPACE
9  using namespace VISP_NAMESPACE_NAME;
10 #endif
11  vpImage<unsigned char> I(2160, 3840, 128);
12 
13  try {
14 
15 #if defined(VISP_HAVE_X11)
16  vpDisplayX d(I, vpDisplay::SCALE_AUTO);
17 #elif defined(VISP_HAVE_GDI)
19 #endif
20 
21  vpDisplay::setTitle(I, "My image");
24  vpDisplay::displayPoint(I, I.getHeight() / 2, I.getWidth() / 2, vpColor::red, 2);
27  std::cout << "A click to quit..." << std::endl;
29  }
30  catch (const vpException &e) {
31  std::cout << "Catch an exception: " << e.getMessage() << std::endl;
32  }
33 }
static const vpColor red
Definition: vpColor.h:217
Display for windows using GDI (available on any windows 32 platform).
Definition: vpDisplayGDI.h:130
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const 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 displayPoint(const vpImage< unsigned char > &I, const vpImagePoint &ip, const vpColor &color, unsigned int thickness=1)
@ SCALE_AUTO
Definition: vpDisplay.h:184
error that can be emitted by ViSP classes.
Definition: vpException.h:60
const char * getMessage() const
Definition: vpException.cpp:65
unsigned int getWidth() const
Definition: vpImage.h:242
unsigned int getHeight() const
Definition: vpImage.h:181