Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
tutorial-draw-text.cpp
1
2
#include <visp3/core/vpConfig.h>
3
#include <visp3/gui/vpDisplayFactory.h>
4
5
#ifdef ENABLE_VISP_NAMESPACE
6
using namespace
VISP_NAMESPACE_NAME
;
7
#endif
8
9
int
main()
10
{
11
#if defined(VISP_HAVE_DISPLAY)
12
vpImage<unsigned char>
I(2160, 3840, 128);
13
14
// Initialize the display with the image I. Display and image are now linked together
15
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
16
std::shared_ptr<vpDisplay>
d
=
vpDisplayFactory::createDisplay
(I, -1, -1,
"Text drawing"
,
vpDisplay::SCALE_AUTO
);
17
#else
18
vpDisplay
*
d
=
vpDisplayFactory::allocateDisplay
(I, 10, 10,
"Text drawing"
,
vpDisplay::SCALE_AUTO
);
19
#endif
20
21
vpDisplay::display
(I);
22
vpDisplay::displayRectangle
(I, I.getHeight() / 4, I.getWidth() / 4, I.getWidth() / 2, I.getHeight() / 2,
23
vpColor::red
,
true
);
25
vpDisplay::displayText
(I, I.getHeight() / 2, I.getWidth() / 2,
"Hello World!"
,
vpColor::yellow
);
27
vpDisplay::flush
(I);
28
std::cout <<
"A click to quit..."
<< std::endl;
29
vpDisplay::getClick
(I);
30
31
#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
32
delete
d
;
33
#endif
34
35
#else
36
std::cout <<
"No gui available to display an image..."
<< std::endl;
37
#endif
38
39
return
EXIT_SUCCESS;
40
}
vpColor::red
static const vpColor red
Definition
vpColor.h:198
vpColor::yellow
static const vpColor yellow
Definition
vpColor.h:206
vpDisplay
Class that defines generic functionalities for display.
Definition
vpDisplay.h:171
vpDisplay::getClick
static bool getClick(const vpImage< unsigned char > &I, bool blocking=true)
Definition
vpDisplay_uchar.cpp:894
vpDisplay::display
static void display(const vpImage< unsigned char > &I)
Definition
vpDisplay_uchar.cpp:869
vpDisplay::flush
static void flush(const vpImage< unsigned char > &I)
Definition
vpDisplay_uchar.cpp:845
vpDisplay::SCALE_AUTO
@ SCALE_AUTO
Definition
vpDisplay.h:177
vpDisplay::displayRectangle
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)
Definition
vpDisplay_uchar.cpp:665
vpDisplay::displayText
static void displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
Definition
vpDisplay_uchar.cpp:788
vpImage
Definition of the vpImage class member functions.
Definition
vpImage.h:131
VISP_NAMESPACE_NAME
Definition
vpEigenConversion.h:44
vpDisplayFactory::createDisplay
std::shared_ptr< vpDisplay > createDisplay()
Return a smart pointer vpDisplay specialization if a GUI library is available or nullptr otherwise.
Definition
vpDisplayFactory.h:142
vpDisplayFactory::allocateDisplay
vpDisplay * allocateDisplay()
Return a newly allocated vpDisplay specialization if a GUI library is available or nullptr otherwise.
Definition
vpDisplayFactory.h:68
yolo-centering-task-afma6.d
d
Definition
yolo-centering-task-afma6.py:273
tutorial
image
tutorial-draw-text.cpp
Generated by
1.17.0