Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / Student_OMP_Image / src / cpp / core / 01_Rippling / b_moo / RipplingMOO.cpp
1 #include <iostream>
2 #include <omp.h>
3
4 #include "RipplingMOO.h"
5 #include "OmpTools.h"
6
7 #include "RipplingMath.h"
8
9 using std::cout;
10 using std::endl;
11 using std::string;
12
13 /*----------------------------------------------------------------------*\
14 |* Declaration *|
15 \*---------------------------------------------------------------------*/
16
17 /*--------------------------------------*\
18 |* Public *|
19 \*-------------------------------------*/
20
21 /*--------------------------------------*\
22 |* Private *|
23 \*-------------------------------------*/
24
25 /*----------------------------------------------------------------------*\
26 |* Implementation *|
27 \*---------------------------------------------------------------------*/
28
29 /*--------------------------------------*\
30 |* Public *|
31 \*-------------------------------------*/
32
33 RipplingMOO::RipplingMOO(unsigned int w, unsigned int h, float dt)
34 {
35 this->t=0;
36 this->dt=dt;
37 }
38
39 RipplingMOO::~RipplingMOO(void)
40 {
41 // rien
42 }
43
44
45 /*--------------------------------------*\
46 |* Public *|
47 \*-------------------------------------*/
48
49 void RipplingMOO::process(uchar4* ptrTabPixels, int w, int h)
50 {
51 if (isEntrelacement)
52 {
53 entrelacementOMP(ptrTabPixels); // Plus lent
54 }
55 else
56 {
57 forAutoOMP(ptrTabPixels); // Plus rapide
58 }
59
60 isEntrelacement=!isEntrelacement;// Pour tester que les deux implementations fonctionnent
61 }
62
63
64 void RipplingMOO::animationStep()
65 {
66 t+=dt;
67 }
68
69 /*--------------*\
70 |* get *|
71 \*-------------*/
72
73 float RipplingMOO::getT()
74 {
75 return t;
76 }
77
78 /*--------------------------------------*\
79 |* Private *|
80 \*-------------------------------------*/
81
82 /**
83 * Code entrainement Cuda
84 */
85 void RipplingMOO::entrelacementOMP(uchar4* ptrTabPixels)
86 {
87 // TODO
88 }
89
90 /**
91 * Code naturel et direct OMP
92 */
93 void RipplingMOO::forAutoOMP(uchar4* ptrTabPixels)
94 {
95 // TODO
96 }
97
98 /*----------------------------------------------------------------------*\
99 |* End *|
100 \*---------------------------------------------------------------------*/