Visual Servoing Platform
version 3.7.0
Toggle main menu visibility
Loading...
Searching...
No Matches
tutorial-draw-cross.cpp
#include <visp3/core/vpConfig.h>
#include <visp3/gui/vpDisplayFactory.h>
#ifdef ENABLE_VISP_NAMESPACE
using namespace
VISP_NAMESPACE_NAME
;
#endif
int
main()
{
#if defined(VISP_HAVE_DISPLAY)
vpImage<unsigned char>
I(2160, 3840, 128);
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
std::shared_ptr<vpDisplay> d =
vpDisplayFactory::createDisplay
(I, -1, -1,
"Cross drawing"
,
vpDisplay::SCALE_AUTO
);
#else
vpDisplay
*d =
vpDisplayFactory::allocateDisplay
(I, -1, -1,
"Cross drawing"
,
vpDisplay::SCALE_AUTO
);
#endif
vpDisplay::display
(I);
vpDisplay::displayCross
(I, I.getHeight() / 2, I.getWidth() / 2, I.getWidth() / 2,
vpColor::red
, 2);
vpDisplay::flush
(I);
std::cout <<
"A click to quit..."
<< std::endl;
vpDisplay::getClick
(I);
#if (VISP_CXX_STANDARD < VISP_CXX_STANDARD_11)
delete
d;
#endif
#else
std::cout <<
"No gui available to display an image..."
<< std::endl;
#endif
return
EXIT_SUCCESS;
}
vpColor::red
static const vpColor red
Definition
vpColor.h:198
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::displayCross
static void displayCross(const vpImage< unsigned char > &I, const vpImagePoint &ip, unsigned int size, const vpColor &color, unsigned int thickness=1)
Definition
vpDisplay_uchar.cpp:205
vpDisplay::flush
static void flush(const vpImage< unsigned char > &I)
Definition
vpDisplay_uchar.cpp:845
vpDisplay::SCALE_AUTO
@ SCALE_AUTO
Definition
vpDisplay.h:177
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
Generated by
1.17.0