Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
tutorial-draw-point.cpp
1
2#include <visp3/core/vpConfig.h>
3#include <visp3/gui/vpDisplayFactory.h>
4
5#ifdef ENABLE_VISP_NAMESPACE
6using namespace VISP_NAMESPACE_NAME;
7#endif
8
9int main()
10{
11#if defined(VISP_HAVE_DISPLAY)
12 vpImage<unsigned char> I(2160, 3840, 128);
13
14#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
15 std::shared_ptr<vpDisplay> d = vpDisplayFactory::createDisplay(I, -1, -1, "Point drawing", vpDisplay::SCALE_AUTO);
16#else
18#endif
19
22 vpDisplay::displayPoint(I, I.getHeight() / 2, I.getWidth() / 2, vpColor::red, 2);
25 std::cout << "A click to quit..." << std::endl;
27
28#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
29 delete d;
30#endif
31
32#else
33 std::cout << "No gui available to display an image..." << std::endl;
34#endif
35
36 return EXIT_SUCCESS;
37}
static const vpColor red
Definition vpColor.h:198
Class that defines generic functionalities for display.
Definition vpDisplay.h:171
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
static void display(const vpImage< unsigned char > &I)
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)
Definition of the vpImage class member functions.
Definition vpImage.h:131
std::shared_ptr< vpDisplay > createDisplay()
Return a smart pointer vpDisplay specialization if a GUI library is available or nullptr otherwise.
vpDisplay * allocateDisplay()
Return a newly allocated vpDisplay specialization if a GUI library is available or nullptr otherwise.