X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FStudent_OMP_Image%2Fsrc%2Fcpp%2Fcore%2F01_Rippling%2Fb_moo%2FRipplingMOO.cpp;fp=WCudaMSE%2FStudent_OMP_Image%2Fsrc%2Fcpp%2Fcore%2F01_Rippling%2Fb_moo%2FRipplingMOO.cpp;h=94d1656320997a567b135b14631cbcc41e5e572e;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git 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 index 0000000..94d1656 --- /dev/null +++ b/WCudaMSE/Student_OMP_Image/src/cpp/core/01_Rippling/b_moo/RipplingMOO.cpp @@ -0,0 +1,100 @@ +#include +#include + +#include "RipplingMOO.h" +#include "OmpTools.h" + +#include "RipplingMath.h" + +using std::cout; +using std::endl; +using std::string; + +/*----------------------------------------------------------------------*\ + |* Declaration *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + +/*----------------------------------------------------------------------*\ + |* Implementation *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +RipplingMOO::RipplingMOO(unsigned int w, unsigned int h, float dt) + { + this->t=0; + this->dt=dt; + } + +RipplingMOO::~RipplingMOO(void) + { + // rien + } + + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +void RipplingMOO::process(uchar4* ptrTabPixels, int w, int h) + { + if (isEntrelacement) + { + entrelacementOMP(ptrTabPixels); // Plus lent + } + else + { + forAutoOMP(ptrTabPixels); // Plus rapide + } + + isEntrelacement=!isEntrelacement;// Pour tester que les deux implementations fonctionnent + } + + +void RipplingMOO::animationStep() + { + t+=dt; + } + +/*--------------*\ + |* get *| + \*-------------*/ + +float RipplingMOO::getT() + { + return t; + } + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + +/** + * Code entrainement Cuda + */ +void RipplingMOO::entrelacementOMP(uchar4* ptrTabPixels) + { + // TODO + } + +/** + * Code naturel et direct OMP + */ +void RipplingMOO::forAutoOMP(uchar4* ptrTabPixels) + { + // TODO + } + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/