Computer Assited Medical Intervention Tool Kit  version 5.0
ScreenshotFormatInfo.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * $CAMITK_LICENCE_BEGIN$
3  *
4  * CamiTK - Computer Assisted Medical Intervention ToolKit
5  * (c) 2001-2021 Univ. Grenoble Alpes, CNRS, Grenoble INP, TIMC, 38000 Grenoble, France
6  *
7  * Visit http://camitk.imag.fr for more information
8  *
9  * This file is part of CamiTK.
10  *
11  * CamiTK is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * CamiTK is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Lesser General Public License version 3 for more details.
19  *
20  * You should have received a copy of the GNU Lesser General Public License
21  * version 3 along with CamiTK. If not, see <http://www.gnu.org/licenses/>.
22  *
23  * $CAMITK_LICENCE_END$
24  ****************************************************************************/
25 
26 #ifndef SCREENSHOTFORMATINFO_H
27 #define SCREENSHOTFORMATINFO_H
28 
29 #include <QMap>
30 
31 namespace camitk {
32 
35 class ScreenshotFormatInfo {
36 public:
38  enum ScreenshotFormat {
39  PNG = 0,
40  JPG,
41  BMP,
42  PS,
43  EPS,
44  PDF,
45  TEX,
46  SVG,
47  OBJ,
48  RIB,
49  VRML,
51  };
52 
55 
57  QString extension;
58 
60  QString description;
61 
63  ScreenshotFormatInfo(ScreenshotFormat t, QString e, QString d) : type(t), extension(std::move(e)), description(std::move(d)) {}
64 
66  ScreenshotFormatInfo() : extension(""), description("Not supported") {}
67 
69  static const QString fileFilters();
70 
71  // get the default format (PNG) information
72  static const ScreenshotFormatInfo* defaultFormat();
73 
76  static const ScreenshotFormatInfo* get(unsigned int);
77 
81 
83  static const ScreenshotFormatInfo* get(QString);
84 
86  static const QMap<ScreenshotFormat, ScreenshotFormatInfo*> getMap();
87 
88 private:
90  static QMap<ScreenshotFormat, ScreenshotFormatInfo*> initMap();
91 };
92 
93 
94 } // namespace
95 
96 #endif // SCREENSHOTFORMATINFO_H
camitk::ScreenshotFormatInfo::get
static const ScreenshotFormatInfo * get(unsigned int)
return the information concerning the supporting format using an index corresponding to the enum (che...
Definition: ScreenshotFormatInfo.cpp:83
camitk::ScreenshotFormatInfo::EPS
@ EPS
Encapsulated PostScript.
Definition: ScreenshotFormatInfo.h:89
camitk::ScreenshotFormatInfo::initMap
static QMap< ScreenshotFormat, ScreenshotFormatInfo * > initMap()
build the map
Definition: ScreenshotFormatInfo.cpp:62
camitk::ScreenshotFormatInfo::PS
@ PS
PostScript.
Definition: ScreenshotFormatInfo.h:88
camitk::ScreenshotFormatInfo::fileFilters
static const QString fileFilters()
return a list of supported format that can be used in a QFileDialog
Definition: ScreenshotFormatInfo.cpp:116
camitk::ScreenshotFormatInfo::TEX
@ TEX
LaTeX (only the text is exported)
Definition: ScreenshotFormatInfo.h:91
camitk::ScreenshotFormatInfo::defaultFormat
static const ScreenshotFormatInfo * defaultFormat()
Definition: ScreenshotFormatInfo.cpp:135
camitk::ScreenshotFormatInfo::extension
QString extension
file extension (suffix)
Definition: ScreenshotFormatInfo.h:103
camitk::ScreenshotFormatInfo::VRML
@ VRML
VRML 2.0.
Definition: ScreenshotFormatInfo.h:95
camitk::ScreenshotFormatInfo::description
QString description
file format description
Definition: ScreenshotFormatInfo.h:106
camitk::ScreenshotFormatInfo::type
ScreenshotFormat type
the corresponding type (key)
Definition: ScreenshotFormatInfo.h:100
camitk::ScreenshotFormatInfo
class containing all information concerning exporting images (screenshot) and the different supported...
Definition: ScreenshotFormatInfo.h:58
camitk::ScreenshotFormatInfo::JPG
@ JPG
JPEG.
Definition: ScreenshotFormatInfo.h:86
camitk::ScreenshotFormatInfo::getMap
static const QMap< ScreenshotFormat, ScreenshotFormatInfo * > getMap()
get the map
Definition: ScreenshotFormatInfo.cpp:54
camitk::ScreenshotFormatInfo::OBJ
@ OBJ
Alias Wavefront .OBJ.
Definition: ScreenshotFormatInfo.h:93
camitk::ScreenshotFormatInfo::NOT_SUPPORTED
@ NOT_SUPPORTED
Definition: ScreenshotFormatInfo.h:96
ScreenshotFormatInfo.h
camitk::ScreenshotFormatInfo::SVG
@ SVG
Scalable Vector Graphics.
Definition: ScreenshotFormatInfo.h:92
camitk::ScreenshotFormatInfo::PDF
@ PDF
Portable Document Format.
Definition: ScreenshotFormatInfo.h:90
camitk::ScreenshotFormatInfo::RIB
@ RIB
RenderMan/BMRT .RIB.
Definition: ScreenshotFormatInfo.h:94
camitk::ScreenshotFormatInfo::BMP
@ BMP
Bitmap.
Definition: ScreenshotFormatInfo.h:87
camitk::ScreenshotFormatInfo::ScreenshotFormatInfo
ScreenshotFormatInfo()
default constructor
Definition: ScreenshotFormatInfo.h:112
camitk::ScreenshotFormatInfo::ScreenshotFormat
ScreenshotFormat
Definition: ScreenshotFormatInfo.h:84
camitk::ScreenshotFormatInfo::PNG
@ PNG
Portable Network Graphics.
Definition: ScreenshotFormatInfo.h:85
camitk
Definition: Action.cpp:35