itom  3.0.0
typeDefs.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2016, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom and its software development toolkit (SDK).
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  In addition, as a special exception, the Institut fuer Technische
15  Optik (ITO) gives you certain additional rights.
16  These rights are described in the ITO LGPL Exception version 1.0,
17  which can be found in the file LGPL_EXCEPTION.txt in this package.
18 
19  itom is distributed in the hope that it will be useful, but
20  WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
22  General Public Licence for more details.
23 
24  You should have received a copy of the GNU Library General Public License
25  along with itom. If not, see <http://www.gnu.org/licenses/>.
26 *********************************************************************** */
27 
28 #ifndef TYPEDEFS_H
29 #define TYPEDEFS_H
30 
31 #include <stdint.h>
32 #include <complex>
33 #include <exception> // std::exception
34 #include <string.h>
35 #include <stdexcept>
36 #ifndef WIN32
37  #include <unistd.h> // neede for usleep
38 #endif
39 
40 #ifdef _MSC_VER
41  #if (_MSC_VER >= 1800)
42  #include <algorithm>
43  #endif
44 #endif
45 
46 // WARNING it is very EVIL to include ANY QT STUFF here!!!
47 
48 namespace ito
49 {
50  #define PLUGINWAIT 5000
51 
56  enum tRetValue
57  {
58  retOk = 0x0,
59  retWarning = 0x1,
60  retError = 0x2
61  };
62 
67  {
68  tCmpEqual,
69  tCmpCompatible,
70  tCmpFailed
71  };
72 
77  enum tDataType
78  {
79  tInt8 = 0,
80  tUInt8 = 1,
81  tInt16 = 2,
82  tUInt16 = 3,
83  tInt32 = 4,
84  tUInt32 = 5,
85  tFloat32 = 6,
86  tFloat64 = 7,
87  tComplex64 = 8,
89  tRGBA32 = 10
90  };
91 
97  {
98  pclInvalid = 0x0000,
99  pclXYZ = 0x0001,
100  pclXYZI = 0x0002,
101  pclXYZRGBA = 0x0004,
102  pclXYZNormal = 0x0008,
103  pclXYZINormal = 0x0010,
104  pclXYZRGBNormal = 0x0020
105  };
106 
107  // data types for images should always be the same size
108  // so define them to fixed byte sizes here
109 
110 
111  /*< \todo #define bool bool */
112  typedef int8_t int8;
113  typedef int16_t int16;
114  typedef int32_t int32;
115 
116 #ifdef _WIN64
117  //typedef int64_t int64;
118  //typedef uint64_t uint64;
119 #endif
120 
121  //#define int int32 //commented by M. Gronle, 10.10.2011, since this caused problems while compiling with gcc and qtCreator
122  //#define uint uint32 // impossible to define this, as in qglobal uint is also defined which causes problems
123 
124  typedef uint8_t uint8;
125  typedef uint16_t uint16;
126  typedef uint32_t uint32;
127 
128  typedef float float32;
129  typedef double float64;
130 
131  typedef std::complex<ito::float32> complex64;
132  typedef std::complex<ito::float64> complex128;
133 
135  {
136  public:
137  union
138  {
139  struct
140  {
141  ito::uint8 b;
142  ito::uint8 g;
143  ito::uint8 r;
144  ito::uint8 a;
145  };
146  ito::uint8 items[4];
147  ito::uint32 rgba;
148  };
149  };
150 
151 
152 #ifdef __GNUC__
153  #define DEPRECATED __attribute__((deprecated))
154 #elif defined(_MSC_VER)
155  #define DEPRECATED __declspec(deprecated)
156 #else
157  #pragma message("WARNING: You need to implement DEPRECATED for this compiler")
158  #define DEPRECATED
159 #endif
160 
161 
162 #ifndef WIN32
163  #define _strdup strdup
164  #define _itoa itoa
165  #define _snprintf snprintf
166  #define Sleep(TIME) usleep(TIME*1000.0)
167 #endif
168 
169 // this will be set on Visual Studio only, so this code is added for all other compilers
170 #ifndef _MSC_VER
171  //for the ##__VA_ARGS__ trick see http://stackoverflow.com/questions/5588855/standard-alternative-to-gccs-va-args-trick
172  #define vsprintf_s(b,l,f,...) vsprintf(b,f,##__VA_ARGS__);
173  #define sprintf_s(b,l,f,...) sprintf(b,f,##__VA_ARGS__);
174  #define strcat_s(dest,len,source) strcat(dest,source);
175  #define strcpy_s(dest,len,source) strcpy(dest,source);
176 #endif
177 
178 } // namespace ito
179 
180 #endif
Definition: typeDefs.h:89
Definition: typeDefs.h:100
Definition: typeDefs.h:104
Definition: typeDefs.h:81
Definition: typeDefs.h:60
Definition: typeDefs.h:86
Definition: typeDefs.h:88
Definition: typeDefs.h:87
Definition: typeDefs.h:101
tCompareResult
Definition: typeDefs.h:66
Definition: typeDefs.h:84
Definition: typeDefs.h:58
Definition: typeDefs.h:79
Definition: typeDefs.h:59
Definition: apiFunctionsGraph.cpp:39
Definition: typeDefs.h:102
Definition: typeDefs.h:83
tPCLPointType
Definition: typeDefs.h:96
Definition: typeDefs.h:85
Definition: typeDefs.h:98
Definition: typeDefs.h:103
Definition: typeDefs.h:82
tRetValue
Definition: typeDefs.h:56
Definition: typeDefs.h:99
tDataType
Definition: typeDefs.h:77
Definition: typeDefs.h:80
Definition: typeDefs.h:134