Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / Student_OMP_Image / src / cpp / core / 01_Rippling / b_moo / RipplingMOO.cpp
diff --git a/WCudaMSE/Student_OMP_Image/src/cpp/core/01_Rippling/b_moo/RipplingMOO.cpp b/WCudaMSE/Student_OMP_Image/src/cpp/core/01_Rippling/b_moo/RipplingMOO.cpp
new file mode 100755 (executable)
index 0000000..94d1656
--- /dev/null
@@ -0,0 +1,100 @@
+#include <iostream>\r
+#include <omp.h>\r
+\r
+#include "RipplingMOO.h"\r
+#include "OmpTools.h"\r
+\r
+#include "RipplingMath.h"\r
+\r
+using std::cout;\r
+using std::endl;\r
+using std::string;\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    Declaration                                     *|\r
+ \*---------------------------------------------------------------------*/\r
+\r
+/*--------------------------------------*\\r
+ |*            Public                  *|\r
+ \*-------------------------------------*/\r
+\r
+/*--------------------------------------*\\r
+ |*            Private                 *|\r
+ \*-------------------------------------*/\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    Implementation                                  *|\r
+ \*---------------------------------------------------------------------*/\r
+\r
+/*--------------------------------------*\\r
+ |*            Public                  *|\r
+ \*-------------------------------------*/\r
+\r
+RipplingMOO::RipplingMOO(unsigned int w, unsigned int h, float dt)\r
+    {\r
+    this->t=0;\r
+    this->dt=dt;\r
+    }\r
+\r
+RipplingMOO::~RipplingMOO(void)\r
+    {\r
+    // rien\r
+    }\r
+\r
+\r
+/*--------------------------------------*\\r
+ |*            Public                  *|\r
+ \*-------------------------------------*/\r
+\r
+void RipplingMOO::process(uchar4* ptrTabPixels, int w, int h)\r
+    {\r
+    if (isEntrelacement)\r
+       {\r
+       entrelacementOMP(ptrTabPixels); // Plus lent\r
+       }\r
+    else\r
+       {\r
+       forAutoOMP(ptrTabPixels);  // Plus rapide\r
+       }\r
+\r
+    isEntrelacement=!isEntrelacement;// Pour tester que les deux implementations fonctionnent\r
+    }\r
+\r
+\r
+void RipplingMOO::animationStep()\r
+    {\r
+    t+=dt;\r
+    }\r
+\r
+/*--------------*\\r
+ |*    get     *|\r
+ \*-------------*/\r
+\r
+float RipplingMOO::getT()\r
+    {\r
+    return t;\r
+    }\r
+\r
+/*--------------------------------------*\\r
+ |*            Private                 *|\r
+ \*-------------------------------------*/\r
+\r
+/**\r
+ * Code entrainement Cuda\r
+ */\r
+void RipplingMOO::entrelacementOMP(uchar4* ptrTabPixels)\r
+    {\r
+    // TODO\r
+    }\r
+\r
+/**\r
+ * Code naturel et direct OMP\r
+ */\r
+void RipplingMOO::forAutoOMP(uchar4* ptrTabPixels)\r
+    {\r
+    // TODO\r
+    }\r
+\r
+/*----------------------------------------------------------------------*\\r
+ |*                    End                                             *|\r
+ \*---------------------------------------------------------------------*/\r