35 #ifndef VP_DISPLAY_FACTORY_H
36 #define VP_DISPLAY_FACTORY_H
38 #include <visp3/core/vpConfig.h>
39 #include <visp3/core/vpDisplay.h>
40 #include <visp3/gui/vpDisplayD3D.h>
41 #include <visp3/gui/vpDisplayGDI.h>
42 #include <visp3/gui/vpDisplayGTK.h>
43 #include <visp3/gui/vpDisplayOpenCV.h>
44 #include <visp3/gui/vpDisplayX.h>
46 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
65 #if defined(VISP_HAVE_DISPLAY)
67 return new vpDisplayX();
68 #elif defined(VISP_HAVE_D3D9)
70 #elif defined(VISP_HAVE_GDI)
72 #elif defined(VISP_HAVE_GTK)
74 #elif defined(HAVE_OPENCV_HIGHGUI)
107 #if defined(VISP_HAVE_DISPLAY)
109 return new vpDisplayX(I, winx, winy, title, scaleType);
110 #elif defined(VISP_HAVE_GDI)
111 return new vpDisplayGDI(I, winx, winy, title, scaleType);
112 #elif defined(HAVE_OPENCV_HIGHGUI)
114 #elif defined(VISP_HAVE_GTK)
115 return new vpDisplayGTK(I, winx, winy, title, scaleType);
116 #elif defined(VISP_HAVE_D3D9)
117 return new vpDisplayD3D(I, winx, winy, title, scaleType);
129 #if (VISP_CXX_STANDARD >= VISP_CXX_STANDARD_11)
139 #if defined(VISP_HAVE_DISPLAY)
141 return std::make_shared<vpDisplayX>();
142 #elif defined(VISP_HAVE_GDI)
143 return std::make_shared<vpDisplayGDI>();
144 #elif defined(HAVE_OPENCV_HIGHGUI)
145 return std::make_shared<vpDisplayOpenCV>();
146 #elif defined(VISP_HAVE_GTK)
147 return std::make_shared<vpDisplayGTK>();
148 #elif defined(VISP_HAVE_D3D9)
149 return std::make_shared<vpDisplayD3D>();
152 return std::shared_ptr<vpDisplay>(
nullptr);
178 const std::string &title =
"",
181 #if defined(VISP_HAVE_DISPLAY)
183 return std::make_shared<vpDisplayX>(I, winx, winy, title, scaleType);
184 #elif defined(VISP_HAVE_GDI)
185 return std::make_shared<vpDisplayGDI>(I, winx, winy, title, scaleType);
186 #elif defined(HAVE_OPENCV_HIGHGUI)
187 return std::make_shared<vpDisplayOpenCV>(I, winx, winy, title, scaleType);
188 #elif defined(VISP_HAVE_GTK)
189 return std::make_shared<vpDisplayGTK>(I, winx, winy, title, scaleType);
190 #elif defined(VISP_HAVE_D3D9)
191 return std::make_shared<vpDisplayD3D>(I, winx, winy, title, scaleType);
200 return std::shared_ptr<vpDisplay>(
nullptr);
217 unsigned int currRow,
unsigned int currCol,
218 unsigned int currentPixelX,
unsigned int currentPixelY,
219 unsigned int maxRowHeightPixel)
221 if (currRow != (settings.
rows - 1) && (currCol != settings.
cols - 1)) {
230 (void)maxRowHeightPixel;
233 template <
typename T,
typename... Args>
235 unsigned int currRow,
unsigned int currCol,
236 unsigned int currentPixelX,
unsigned int currentPixelY,
237 const unsigned int maxRowHeightPixel,
238 const std::string &name,
vpImage<T> &I, Args&... args)
240 if (currRow >= settings.
rows) {
243 if (currCol == settings.
cols) {
245 currentPixelY + maxRowHeightPixel + settings.
paddingY, 0, name, I, args...);
251 res.push_back(display);
253 currentPixelY, std::max(maxRowHeightPixel, I.
getHeight()), args...);
278 template <
typename... Args>
279 std::vector<std::shared_ptr<vpDisplay>>
makeDisplayGrid(
unsigned int rows,
unsigned int cols,
280 unsigned int startX,
unsigned int startY,
281 unsigned int paddingX,
unsigned int paddingY,
284 std::vector<std::shared_ptr<vpDisplay>> res;
286 settings.
rows = rows;
287 settings.
cols = cols;
292 makeDisplayGridHelper(res, settings, 0, 0, settings.
startX, settings.
startY, 0, args...);
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...
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.
unsigned int getWidth() const
unsigned int getHeight() const
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...