Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
tutorial-image-display-scaled-auto.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);
// Initialize the display with the image I. Display and image are now linked together
#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
std::shared_ptr<vpDisplay> d = vpDisplayFactory::createDisplay(I, -1, -1, "Auto scaling display", vpDisplay::SCALE_AUTO);
#else
vpDisplay *d = vpDisplayFactory::allocateDisplay(I, -1, -1, "Auto scaling display", vpDisplay::SCALE_AUTO);
#endif
vpDisplay::displayCircle(I, I.getHeight() / 2, I.getWidth() / 2, 200, vpColor::red, true);
std::cout << "A click to quit..." << std::endl;
#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;
}
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 displayCircle(const vpImage< unsigned char > &I, const vpImageCircle &circle, const vpColor &color, bool fill=false, unsigned int thickness=1)
static void display(const vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
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.