34#ifndef VP_DISPLAY_FACTORY_H
35#define VP_DISPLAY_FACTORY_H
37#include <visp3/core/vpConfig.h>
38#include <visp3/core/vpDisplay.h>
39#include <visp3/gui/vpDisplayD3D.h>
40#include <visp3/gui/vpDisplayGDI.h>
41#include <visp3/gui/vpDisplayGTK.h>
42#include <visp3/gui/vpDisplayOpenCV.h>
43#include <visp3/gui/vpDisplayX.h>
45#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
51# pragma clang diagnostic push
52# pragma clang diagnostic ignored "-Wexit-time-destructors"
70#if defined(VISP_HAVE_DISPLAY)
73#elif defined(VISP_HAVE_D3D9)
75#elif defined(VISP_HAVE_GDI)
77#elif defined(VISP_HAVE_GTK)
79#elif defined(HAVE_OPENCV_HIGHGUI)
112#if defined(VISP_HAVE_DISPLAY)
114 return new vpDisplayX(I, winx, winy, title, scaleType);
115#elif defined(VISP_HAVE_GDI)
116 return new vpDisplayGDI(I, winx, winy, title, scaleType);
117#elif defined(HAVE_OPENCV_HIGHGUI)
119#elif defined(VISP_HAVE_GTK)
120 return new vpDisplayGTK(I, winx, winy, title, scaleType);
121#elif defined(VISP_HAVE_D3D9)
122 return new vpDisplayD3D(I, winx, winy, title, scaleType);
134#if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
144#if defined(VISP_HAVE_DISPLAY)
146 return std::make_shared<vpDisplayX>();
147#elif defined(VISP_HAVE_GDI)
148 return std::make_shared<vpDisplayGDI>();
149#elif defined(HAVE_OPENCV_HIGHGUI)
150 return std::make_shared<vpDisplayOpenCV>();
151#elif defined(VISP_HAVE_GTK)
152 return std::make_shared<vpDisplayGTK>();
153#elif defined(VISP_HAVE_D3D9)
154 return std::make_shared<vpDisplayD3D>();
157 return std::shared_ptr<vpDisplay>(
nullptr);
183 const std::string &title =
"",
186#if defined(VISP_HAVE_DISPLAY)
188 return std::make_shared<vpDisplayX>(I, winx, winy, title, scaleType);
189#elif defined(VISP_HAVE_GDI)
190 return std::make_shared<vpDisplayGDI>(I, winx, winy, title, scaleType);
191#elif defined(HAVE_OPENCV_HIGHGUI)
192 return std::make_shared<vpDisplayOpenCV>(I, winx, winy, title, scaleType);
193#elif defined(VISP_HAVE_GTK)
194 return std::make_shared<vpDisplayGTK>(I, winx, winy, title, scaleType);
195#elif defined(VISP_HAVE_D3D9)
196 return std::make_shared<vpDisplayD3D>(I, winx, winy, title, scaleType);
205 return std::shared_ptr<vpDisplay>(
nullptr);
222 unsigned int currRow,
unsigned int currCol,
223 unsigned int currentPixelX,
unsigned int currentPixelY,
224 unsigned int maxRowHeightPixel)
226 if (currRow != (settings.
rows - 1) && (currCol != settings.
cols - 1)) {
235 (void)maxRowHeightPixel;
238template <
typename T,
typename... Args>
240 unsigned int currRow,
unsigned int currCol,
241 unsigned int currentPixelX,
unsigned int currentPixelY,
242 const unsigned int maxRowHeightPixel,
243 const std::string &name,
vpImage<T> &I, Args&... args)
245 if (currRow >= settings.
rows) {
248 if (currCol == settings.
cols) {
250 currentPixelY + maxRowHeightPixel + settings.
paddingY, 0, name, I, args...);
256 res.push_back(display);
258 currentPixelY, std::max(maxRowHeightPixel, I.getHeight()), args...);
283template <
typename... Args>
284std::vector<std::shared_ptr<vpDisplay>>
makeDisplayGrid(
unsigned int rows,
unsigned int cols,
285 unsigned int startX,
unsigned int startY,
286 unsigned int paddingX,
unsigned int paddingY,
289 std::vector<std::shared_ptr<vpDisplay>> res;
291 settings.
rows = rows;
292 settings.
cols = cols;
297 makeDisplayGridHelper(res, settings, 0, 0, settings.
startX, settings.
startY, 0, args...);
305#if defined(__clang__)
306# pragma clang diagnostic pop
Display for windows using Direct3D 3rd party. Thus to enable this class Direct3D should be installed....
Display for windows using GDI (available on any windows 32 platform).
The vpDisplayGTK allows to display image using the GTK 3rd party library. Thus to enable this class G...
The vpDisplayOpenCV allows to display image using the OpenCV library. Thus to enable this class OpenC...
Use the X11 console to display images on unix-like OS. Thus to enable this class X11 should be instal...
Class that defines generic functionalities for display.
static void display(const vpImage< unsigned char > &I)
static void flush(const vpImage< unsigned char > &I)
error that can be emitted by ViSP classes.
@ dimensionError
Bad dimension.
Definition of the vpImage class member functions.
void makeDisplayGridHelper(std::vector< std::shared_ptr< vpDisplay > > &res, const GridSettings &settings, unsigned int currRow, unsigned int currCol, unsigned int currentPixelX, unsigned int currentPixelY, unsigned int maxRowHeightPixel)
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.
std::vector< std::shared_ptr< vpDisplay > > makeDisplayGrid(unsigned int rows, unsigned int cols, unsigned int startX, unsigned int startY, unsigned int paddingX, unsigned int paddingY, Args &... args)
Create a grid of displays, given a set of images. All the displays will be initialized in the correct...