Image Component Library (ICL)
CompatMacros.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLUtils/src/ICLUtils/CompatMacros.h **
10 ** Module : ICLUtils **
11 ** Authors: Christof Elbrechter, Sergius Gaulik **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLUtils/ICLConfig.h>
34 
35 #ifdef WIN32
36 #define ICL_SYSTEMCALL_RM "del "
37 #else
38 #define ICL_SYSTEMCALL_RM "rm -rf "
39 #endif
40 
41 #ifdef WIN32
42  // disable warning: 'class' : multiple assignment operators specified
43 #pragma warning(disable: 4522; disable: 4996)
44  #define NOMINMAX
45  #define _USE_MATH_DEFINES
46 #ifndef M_PI
47  #define M_PI 3.14159265358979323846
48 #endif
49  // TODOWW: test with _MSC_VER == 1700
50  #if (defined _MSC_VER && _MSC_VER < 1800)
51  #include <cmath>
52  inline double round(double a)
53  {
54  return floor(a + 0.5f);
55  }
56  inline double log2(double a)
57  {
58  return log(a) / 0.69314718055994530943;
59  }
60  inline float pow(int a, int b)
61  {
62  return pow((float)a, b);
63  }
64  inline double pow(float a, double b)
65  {
66  return pow((double)a, b);
67  }
68  inline int rint(double a)
69  {
70  // this is not really what it should do
71  return (int)round(a);
72  }
73  inline float log(int a)
74  {
75  return log((float)a);
76  }
77  inline float exp(int a)
78  {
79  return exp((float)a);
80  }
81  inline float sqrt(int a)
82  {
83  return sqrt((float)a);
84  }
85  #endif
86  // in windows use this instead of #warning
87  #define WARNING(msg) message(__FILE__ "(" STRINGSIZE(__LINE__) ") : warning: " #msg)
88 #endif
89 
90 
91 #ifdef ICL_SYSTEM_WINDOWS
92 # define IPP_DECL __stdcall
93 #else
94 # define IPP_DECL
95 #endif
96 
97 
99 
100 #ifdef WIN32
101 
102 #ifdef ICLUtils_EXPORTS
103 #define ICLUtils_API __declspec(dllexport)
104 #else
105 #define ICLUtils_API __declspec(dllimport)
106 #endif
107 
108 #ifdef ICLMath_EXPORTS
109 #define ICLMath_IMP
110 #define ICLMath_API __declspec(dllexport)
111 #else
112 #define ICLMath_IMP __declspec(dllimport)
113 #define ICLMath_API __declspec(dllimport)
114 #endif
115 
116 #ifdef ICLCore_EXPORTS
117 #define ICLCore_API __declspec(dllexport)
118 #else
119 #define ICLCore_API __declspec(dllimport)
120 #endif
121 
122 #ifdef ICLFilter_EXPORTS
123 #define ICLFilter_API __declspec(dllexport)
124 #else
125 #define ICLFilter_API __declspec(dllimport)
126 #endif
127 
128 #ifdef ICLIO_EXPORTS
129 #define ICLIO_API __declspec(dllexport)
130 #else
131 #define ICLIO_API __declspec(dllimport)
132 #endif
133 
134 #ifdef ICLIO_EXPORTS
135 #define ICLIO_API __declspec(dllexport)
136 #else
137 #define ICLIO_API __declspec(dllimport)
138 #endif
139 
140 #ifdef ICLCV_EXPORTS
141 #define ICLCV_API __declspec(dllexport)
142 #else
143 #define ICLCV_API __declspec(dllimport)
144 #endif
145 
146 #ifdef ICLQt_EXPORTS
147 #define ICLQt_API __declspec(dllexport)
148 #else
149 #define ICLQt_API __declspec(dllimport)
150 #endif
151 
152 #ifdef ICLGeom_EXPORTS
153 #define ICLGeom_API __declspec(dllexport)
154 #else
155 #define ICLGeom_API __declspec(dllimport)
156 #endif
157 
158 #ifdef ICLMarkers_EXPORTS
159 #define ICLMarkers_API __declspec(dllexport)
160 #else
161 #define ICLMarkers_API __declspec(dllimport)
162 #endif
163 
164 #ifdef ICLPhysics_EXPORTS
165 #define ICLPhysics_API __declspec(dllexport)
166 #else
167 #define ICLPhysics_API __declspec(dllimport)
168 #endif
169 
170 #else
171 #define ICLUtils_API
172 #define ICLMath_IMP
173 #define ICLMath_API
174 #define ICLCore_API
175 #define ICLFilter_API
176 #define ICLIO_API
177 #define ICLCV_API
178 #define ICLQt_API
179 #define ICLGeom_API
180 #define ICLMarkers_API
181 #define ICLPhysics_API
182 #endif
183 
184 #ifdef ICL_HAVE_OPENGL
185  #ifdef ICL_SYSTEM_APPLE
186  #include <GL/glew.h>
187  #include <gl.h>
188  #include <glu.h>
189  #elif ICL_SYSTEM_WINDOWS
190  #include <Windows.h>
191  #include <GL/glew.h>
192  #include <GL/gl.h>
193  #include <GL/glu.h>
194  #else
195  #include <GL/glew.h>
196  #include <GL/gl.h>
197  #include <GL/glu.h>
198  #endif
199 #endif
ICLQt_API ImgQ sqrt(const ImgQ &image)
calls sqrt( each pixel)
ICLQt_API ImgQ exp(const ImgQ &image)
calls exp( each pixel )