Go to the documentation of this file.
9 #ifndef CDisplayWindow_H
10 #define CDisplayWindow_H
33 using Ptr = std::shared_ptr<CDisplayWindow>;
34 using ConstPtr = std::shared_ptr<const CDisplayWindow>;
47 unsigned int initWidth = 400,
unsigned int initHeight = 400);
51 const std::string& windowCaption,
unsigned int initWidth = 400,
52 unsigned int initHeight = 400);
74 const bool& showNumbers =
false);
78 const std::vector<float>&
y,
80 const bool& showNumbers =
false);
88 template <
class FEATURELIST>
92 const bool& showIDs =
false)
96 img.colorImage(imgColor);
97 imgColor.drawFeatures(list,
color, showIDs);
107 template <
class FEATURELIST>
115 img.colorImage(imgColor);
137 template <
class MATCHEDLIST>
140 const MATCHEDLIST& mList,
142 bool showNumbers =
false)
155 i != mList.end(); ++i, ++nf)
167 buf, 15,
"%d[%u]", nf, (
unsigned int)i->first->ID);
171 buf, 15,
"%d[%u]", nf, (
unsigned int)i->second->ID);
173 round(i->second->x +
w) + 10,
round(i->second->y), buf,
187 template <
class FEATURELIST>
190 const FEATURELIST& leftList,
const FEATURELIST& rightList,
198 ASSERT_(leftList.size() == rightList.size());
199 imgColor.joinImagesHorz(img1, img2);
204 iR = rightList.begin();
205 iL != leftList.end(); ++iL, ++iR)
size_t getWidth() const override
Returns the width of the image in pixels.
void showTiledImageAndPoints(const mrpt::img::CImage &img, const FEATURELIST &list, const mrpt::img::TColor &color=mrpt::img::TColor::red())
Show a given color or grayscale image on the window and print a set of points on it and a set of line...
static constexpr TColor red()
Predefined colors.
const Scalar * const_iterator
void resize(unsigned int width, unsigned int height) override
Resizes the window, stretching the image to fit into the display area.
std::shared_ptr< const CDisplayWindow > ConstPtr
Column vector, like Eigen::MatrixX*, but automatically initialized to zeros since construction.
virtual ~CDisplayWindow()
Destructor.
void showImageAndPoints(const mrpt::img::CImage &img, const FEATURELIST &list, const mrpt::img::TColor &color=mrpt::img::TColor::red(), const bool &showIDs=false)
Show a given color or grayscale image on the window and print a set of points on it.
void setPos(int x, int y) override
Changes the position of the window on the screen.
This is the global namespace for all Mobile Robot Programming Toolkit (MRPT) libraries.
GLubyte GLubyte GLubyte GLubyte w
#define ASSERT_(f)
Defines an assertion mechanism.
virtual void setCursorCross(bool cursorIsCross) override
Set cursor style to default (cursorIsCross=false) or to a cross (cursorIsCross=true)
static CDisplayWindow::Ptr Create(const std::string &windowCaption, unsigned int initWidth=400, unsigned int initHeight=400)
Class factory returning a smart pointer.
void showImage(const mrpt::img::CImage &img)
Show a given color or grayscale image on the window.
void plot(const mrpt::math::CVectorFloat &x, const mrpt::math::CVectorFloat &y)
Plots a graph in MATLAB-like style.
void showImagesAndMatchedPoints(const mrpt::img::CImage &img1, const mrpt::img::CImage &img2, const MATCHEDLIST &mList, const mrpt::img::TColor &color=mrpt::img::TColor::red(), bool showNumbers=false)
Show a pair of given color or grayscale images (put together) on the window and print a set of matche...
int sprintf(char *buf, size_t bufSize, const char *format,...) noexcept MRPT_printf_format_check(3
An OS-independent version of sprintf (Notice the bufSize param, which may be ignored in some compiler...
std::shared_ptr< CDisplayWindow > Ptr
The base class for GUI window classes.
int round(const T value)
Returns the closer integer (int) to x.
bool m_enableCursorCoordinates
Enables or disables the visualization of cursor coordinates on the window caption.
void line(int x0, int y0, int x1, int y1, const mrpt::img::TColor color, unsigned int width=1, TPenStyle penStyle=psSolid) override
Draws a line.
void joinImagesHorz(const CImage &im1, const CImage &im2)
Joins two images side-by-side horizontally.
This class creates a window as a graphical user interface (GUI) for displaying images to the user.
void showImageAndPoints(const mrpt::img::CImage &img, const mrpt::math::CVectorFloat &x, const mrpt::math::CVectorFloat &y, const mrpt::img::TColor &color=mrpt::img::TColor::red(), const bool &showNumbers=false)
Show a given color or grayscale image on the window and print a set of points on it.
GLenum GLsizei GLsizei height
A class for storing images as grayscale or RGB bitmaps.
size_t getHeight() const override
Returns the height of the image in pixels.
void showImagesAndMatchedPoints(const mrpt::img::CImage &img1, const mrpt::img::CImage &img2, const FEATURELIST &leftList, const FEATURELIST &rightList, const mrpt::img::TColor &color=mrpt::img::TColor::red())
Show a pair of given color or grayscale images (put together) on the window and print a set of matche...
void setWindowTitle(const std::string &str) override
Changes the window title text.
GLsizei const GLchar ** string
void enableCursorCoordinatesVisualization(bool enable)
Enables or disables the visualization of cursor coordinates on the window caption (default = enabled)...
virtual bool getLastMousePosition(int &x, int &y) const override
Gets the last x,y pixel coordinates of the mouse.
CDisplayWindow(const std::string &windowCaption=std::string(), unsigned int initWidth=400, unsigned int initHeight=400)
Constructor.
Page generated by Doxygen 1.8.17 for MRPT 1.9.9 Git: ad3a9d8ae Tue May 1 23:10:22 2018 -0700 at mié 12 jul 2023 10:03:34 CEST | |