Visual Servoing Platform version 3.7.0
Loading...
Searching...
No Matches
drawingHelpers.cpp
1#include "drawingHelpers.h"
2
3#include <visp3/core/vpImageConvert.h>
4
5#ifndef DOXYGEN_SHOULD_SKIP_THIS
6
7#ifdef ENABLE_VISP_NAMESPACE
8using namespace VISP_NAMESPACE_NAME;
9#endif
10
11bool drawingHelpers::display(vpImage< vpRGBa> &I, const std::string &title, const bool &blockingMode)
12{
14 vpDisplay::setTitle(I, title);
15 vpDisplay::displayText(I, 15, 15, "Left click to continue...", vpColor::red);
16 vpDisplay::displayText(I, 35, 15, "Right click to stop...", vpColor::red);
19 vpDisplay::getClick(I, button, blockingMode);
20 bool hasToContinue = true;
21 if (button == vpMouseButton::button3) {
22 // Right click => stop the program
23 hasToContinue = false;
24 }
25
26 return hasToContinue;
27}
28
29bool drawingHelpers::display(vpImage<unsigned char> &D, vpImage<vpRGBa> &Idisp, const std::string &title, const bool &blockingMode)
30{
32 return display(Idisp, title, blockingMode);
33}
34
35bool drawingHelpers::display(vpImage<double> &D, vpImage<vpRGBa> &Idisp, const std::string &title, const bool &blockingMode)
36{
37 vpImage<unsigned char> I; // Image to display
40 return display(Idisp, title, blockingMode);
41}
42
43#endif
static const vpColor red
Definition vpColor.h:198
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 displayText(const vpImage< unsigned char > &I, const vpImagePoint &ip, const std::string &s, const vpColor &color)
static void convert(const vpImage< unsigned char > &src, vpImage< vpRGBa > &dest)
Definition of the vpImage class member functions.
Definition vpImage.h:131