forked from MrKepzie/Natron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Natron-namespace.patch
306 lines (263 loc) · 9.04 KB
/
Natron-namespace.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
diff --cc Engine/ExistenceCheckThread.h
index 83fcc7a,ac9aee5..0000000
--- a/Engine/ExistenceCheckThread.h
+++ b/Engine/ExistenceCheckThread.h
@@@ -28,11 -36,9 +28,12 @@@
#include <boost/scoped_ptr.hpp>
#endif
-
+#include <QThread>
#include "Engine/EngineFwd.h"
++NATRON_NAMESPACE_ENTER;
++
struct ExistenceCheckerThreadPrivate;
class ExistenceCheckerThread : public QThread
{
@@@ -65,6 -71,6 +66,8 @@@ private
boost::scoped_ptr<ExistenceCheckerThreadPrivate> _imp;
};
++NATRON_NAMESPACE_EXIT;
++
#endif // NATRON_USE_BREAKPAD
diff --cc Engine/RotoPaint.cpp
index 8d1ecee,6911199..0000000
--- a/Engine/RotoPaint.cpp
+++ b/Engine/RotoPaint.cpp
@@@ -381,20 -382,8 +381,18 @@@ RotoPaint::render(const RenderActionArg
plane != args.outputPlanes.end(); ++plane) {
if (bgImg) {
-
-
- plane->second->pasteFrom(*bgImg, args.roi, false);
+ if (bgImg->getComponents() != plane->second->getComponents()) {
+
+ bgImg->convertToFormat(args.roi,
+ getApp()->getDefaultColorSpaceForBitDepth(bgImg->getBitDepth()),
+ getApp()->getDefaultColorSpaceForBitDepth(plane->second->getBitDepth()), 3
+ , false, false, plane->second.get());
+ } else {
+ plane->second->pasteFrom(*bgImg, args.roi, false);
+ }
+
+
- if (premultiply && plane->second->getComponents() == Natron::ImageComponents::getRGBAComponents()) {
+ if (premultiply && plane->second->getComponents() == ImageComponents::getRGBAComponents()) {
plane->second->premultImage(args.roi);
}
} else {
diff --git a/Engine/AppManager.cpp b/Engine/AppManager.cpp
index 3ef7279..ead339a 100644
--- a/Engine/AppManager.cpp
+++ b/Engine/AppManager.cpp
@@ -2772,7 +2772,7 @@ AppManager::getOFXHost() const
return _imp->ofxHost.get();
}
-NATRON_NAMESPACE_ENTER;
+static
void
errorDialog(const std::string & title,
const std::string & message,
@@ -2787,6 +2787,7 @@ errorDialog(const std::string & title,
}
}
+static
void
errorDialog(const std::string & title,
const std::string & message,
@@ -2802,6 +2803,7 @@ errorDialog(const std::string & title,
}
}
+static
void
warningDialog(const std::string & title,
const std::string & message,
@@ -2815,6 +2817,8 @@ warningDialog(const std::string & title,
std::cerr << "WARNING: " << title << ": " << message << std::endl;
}
}
+
+static
void
warningDialog(const std::string & title,
const std::string & message,
@@ -2830,7 +2834,7 @@ warningDialog(const std::string & title,
}
}
-
+static
void
informationDialog(const std::string & title,
const std::string & message,
@@ -2845,6 +2849,7 @@ informationDialog(const std::string & title,
}
}
+static
void
informationDialog(const std::string & title,
const std::string & message,
@@ -2860,7 +2865,7 @@ informationDialog(const std::string & title,
}
}
-
+static
StandardButtonEnum
questionDialog(const std::string & title,
const std::string & message,
@@ -2880,6 +2885,7 @@ questionDialog(const std::string & title,
}
}
+static
StandardButtonEnum
questionDialog(const std::string & title,
const std::string & message,
@@ -2900,7 +2906,7 @@ questionDialog(const std::string & title,
}
}
-std::size_t findNewLineStartAfterImports(std::string& script)
+std::size_t NATRON_NAMESPACE::findNewLineStartAfterImports(std::string& script)
{
///Find position of the last import
size_t foundImport = script.find("import ");
@@ -2933,19 +2939,19 @@ std::size_t findNewLineStartAfterImports(std::string& script)
}
-PyObject* getMainModule()
+PyObject* NATRON_NAMESPACE::getMainModule()
{
return appPTR->getMainModule();
}
-std::size_t ensureScriptHasModuleImport(const std::string& moduleName,std::string& script)
+std::size_t NATRON_NAMESPACE::ensureScriptHasModuleImport(const std::string& moduleName,std::string& script)
{
/// import module
script = "from " + moduleName + " import * \n" + script;
return findNewLineStartAfterImports(script);
}
-bool interpretPythonScript(const std::string& script,std::string* error,std::string* output)
+bool NATRON_NAMESPACE::interpretPythonScript(const std::string& script,std::string* error,std::string* output)
{
#ifdef NATRON_RUN_WITHOUT_PYTHON
return true;
@@ -3014,7 +3020,7 @@ bool interpretPythonScript(const std::string& script,std::string* error,std::str
}
-void compilePyScript(const std::string& script,PyObject** code)
+void NATRON_NAMESPACE::compilePyScript(const std::string& script,PyObject** code)
{
///Must be locked
assert(PyThreadState_Get());
@@ -3031,7 +3037,7 @@ void compilePyScript(const std::string& script,PyObject** code)
std::string
-makeNameScriptFriendly(const std::string& str)
+NATRON_NAMESPACE::makeNameScriptFriendly(const std::string& str)
{
if (str == "from") {
return "pFrom";
@@ -3233,7 +3239,7 @@ static bool getGroupInfosInternal(const std::string& modulePath,
bool
-getGroupInfosFromQtResourceFile(const std::string& resourceFileName,
+NATRON_NAMESPACE::getGroupInfosFromQtResourceFile(const std::string& resourceFileName,
const std::string& modulePath,
const std::string& pythonModule,
std::string* pluginID,
@@ -3267,7 +3273,7 @@ getGroupInfosFromQtResourceFile(const std::string& resourceFileName,
}
bool
-getGroupInfos(const std::string& modulePath,
+NATRON_NAMESPACE::getGroupInfos(const std::string& modulePath,
const std::string& pythonModule,
std::string* pluginID,
std::string* pluginLabel,
@@ -3294,7 +3300,7 @@ getGroupInfos(const std::string& modulePath,
-void getFunctionArguments(const std::string& pyFunc,std::string* error,std::vector<std::string>* args)
+void NATRON_NAMESPACE::getFunctionArguments(const std::string& pyFunc,std::string* error,std::vector<std::string>* args)
{
#ifdef NATRON_RUN_WITHOUT_PYTHON
return;
@@ -3349,7 +3355,7 @@ void getFunctionArguments(const std::string& pyFunc,std::string* error,std::vect
* If app1 or Group1 does not exist at this point, this is a failure.
**/
PyObject*
-getAttrRecursive(const std::string& fullyQualifiedName,PyObject* parentObj,bool* isDefined)
+NATRON_NAMESPACE::getAttrRecursive(const std::string& fullyQualifiedName,PyObject* parentObj,bool* isDefined)
{
#ifdef NATRON_RUN_WITHOUT_PYTHON
return 0;
@@ -3382,7 +3388,4 @@ getAttrRecursive(const std::string& fullyQualifiedName,PyObject* parentObj,bool*
}
-
-} //Namespace Natron
-
#include "moc_AppManager.cpp"
diff --git a/Engine/Image.h b/Engine/Image.h
index 3109d51..0594497 100644
--- a/Engine/Image.h
+++ b/Engine/Image.h
@@ -1003,7 +1003,7 @@ NATRON_NAMESPACE_ENTER;
typedef boost::shared_ptr<Natron::Image> ImagePtr;
typedef std::list<ImagePtr> ImageList;
-} //namespace Natron
+NATRON_NAMESPACE_EXIT;
#endif // NATRON_ENGINE_IMAGE_H
diff --git a/Engine/Log.cpp b/Engine/Log.cpp
index 9a32382..88ac548 100644
--- a/Engine/Log.cpp
+++ b/Engine/Log.cpp
@@ -221,5 +221,7 @@ Log::endFunction(const std::string & callerName,
{
Log::instance()->_imp->endFunction(callerName,function);
}
-} //namespace Natron
+
+NATRON_NAMESPACE_EXIT;
+
#endif // ifdef NATRON_LOG
diff --git a/Engine/Lut.h b/Engine/Lut.h
index 120035f..23904a8 100644
--- a/Engine/Lut.h
+++ b/Engine/Lut.h
@@ -574,7 +574,7 @@ charToUint8xx(unsigned char quantum)
return (unsigned short) (quantum << 8);
}
} //namespace Color
-} //namespace Natron
+NATRON_NAMESPACE_EXIT;
#endif //NATRON_ENGINE_LUT_H
diff --git a/Engine/Node.h b/Engine/Node.h
index 2ac9bf5..9d5dbc1 100644
--- a/Engine/Node.h
+++ b/Engine/Node.h
@@ -1370,6 +1370,6 @@ public:
}
};
-} //namespace Natron
+NATRON_NAMESPACE_EXIT;
#endif // NATRON_ENGINE_NODE_H
diff --git a/Global/ProcInfo.h b/Global/ProcInfo.h
index 7ba7fef..fa6ce83 100644
--- a/Global/ProcInfo.h
+++ b/Global/ProcInfo.h
@@ -38,8 +38,7 @@
#include <sys/stat.h>
#endif
-namespace Natron
-{
+NATRON_NAMESPACE_ENTER;
/**
* @brief Returns the application's executable absolute file path.
@@ -61,5 +60,6 @@ QString applicationDirPath(const char* argv0Param);
**/
bool checkIfProcessIsRunning(const char* processAbsoluteFilePath, Q_PID pid);
-} //Natron
+NATRON_NAMESPACE_EXIT;
+
#endif // NATRON_GLOBAL_PROCINFO_H
diff --git a/Tests/Lut_Test.cpp b/Tests/Lut_Test.cpp
index 7b16d5f..ed8e6a2 100644
--- a/Tests/Lut_Test.cpp
+++ b/Tests/Lut_Test.cpp
@@ -26,7 +26,7 @@
#include <gtest/gtest.h>
#include "Engine/Lut.h"
-using namespace Natron::Color;
+using namespace NATRON_NAMESPACE::Color;
TEST(Lut,IntConversions) {
for (int i = 0; i < 0x10000; ++i) {