Visual Servoing Platform  version 3.6.1 under development (2024-07-15)
vpDisplayFactory.h
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2024 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * See the file LICENSE.txt at the root directory of this source
11  * distribution for additional information about the GNU GPL.
12  *
13  * For using ViSP with software that can not be combined with the GNU
14  * GPL, please contact Inria about acquiring a ViSP Professional
15  * Edition License.
16  *
17  * See https://visp.inria.fr for more information.
18  *
19  * This software was developed at:
20  * Inria Rennes - Bretagne Atlantique
21  * Campus Universitaire de Beaulieu
22  * 35042 Rennes Cedex
23  * France
24  *
25  * If you have questions regarding the use of this file, please contact
26  * Inria at visp@inria.fr
27  *
28  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30  *
31  * Description:
32  * Display Factory
33  */
34 
35 #ifndef VP_DISPLAY_FACTORY_H
36 #define VP_DISPLAY_FACTORY_H
37 
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>
45 
51 {
60 {
61 #if defined(VISP_HAVE_DISPLAY)
62 #ifdef VISP_HAVE_X11
63  return new vpDisplayX();
64 #elif defined(VISP_HAVE_D3D9)
65  return new vpDisplayD3D();
66 #elif defined(VISP_HAVE_GDI)
67  return new vpDisplayGDI();
68 #elif defined(VISP_HAVE_GTK)
69  return new vpDisplayGTK();
70 #elif defined(HAVE_OPENCV_HIGHGUI)
71  return new vpDisplayOpenCV();
72 #endif
73 #else
74  return nullptr;
75 #endif
76 }
77 
88 template<typename T>
90 {
91 #if defined(VISP_HAVE_DISPLAY)
92 #ifdef VISP_HAVE_X11
93  return new vpDisplayX(I);
94 #elif defined(VISP_HAVE_GDI)
95  return new vpDisplayGDI(I);
96 #elif defined(HAVE_OPENCV_HIGHGUI)
97  return new vpDisplayOpenCV(I);
98 #elif defined(VISP_HAVE_GTK)
99  return new vpDisplayGTK(I);
100 #elif defined(VISP_HAVE_D3D9)
101  return new vpDisplayD3D(I);
102 #endif
103 #else
104  (void)I;
105  return nullptr;
106 #endif
107 }
108 
126 template<typename T>
128 {
129 #if defined(VISP_HAVE_DISPLAY)
130 #ifdef VISP_HAVE_X11
131  return new vpDisplayX(I, scale_type);
132 #elif defined(VISP_HAVE_GDI)
133  return new vpDisplayGDI(I, scale_type);
134 #elif defined(HAVE_OPENCV_HIGHGUI)
135  return new vpDisplayOpenCV(I, scale_type);
136 #elif defined(VISP_HAVE_GTK)
137  return new vpDisplayGTK(I, scale_type);
138 #elif defined(VISP_HAVE_D3D9)
139  return new vpDisplayD3D(I, scale_type);
140 #endif
141 #else
142  (void)I;
143  (void)scale_type;
144  return nullptr;
145 #endif
146 }
147 }
148 END_VISP_NAMESPACE
149 #endif
Display for windows using Direct3D 3rd party. Thus to enable this class Direct3D should be installed....
Definition: vpDisplayD3D.h:106
Display for windows using GDI (available on any windows 32 platform).
Definition: vpDisplayGDI.h:130
The vpDisplayGTK allows to display image using the GTK 3rd party library. Thus to enable this class G...
Definition: vpDisplayGTK.h:133
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...
Definition: vpDisplayX.h:135
Class that defines generic functionalities for display.
Definition: vpDisplay.h:178
Definition of the vpImage class member functions.
Definition: vpImage.h:131
vpDisplay * displayFactory()
Return a newly allocated vpDisplay specialization if a GUI library is available or nullptr otherwise.