Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / API_Bilat_Image_GL_Cuda / INC / gpu / ImageFonctionelMOOs_A_GPU.h
1 #ifndef IMAGE_FONCTIONEL_MOOS_A_GPU_H
2 #define IMAGE_FONCTIONEL_MOOS_A_GPU_H
3
4 #include "ImageMOOs_A_GPU.h"
5 #include "DomaineMath_GPU.h"
6
7 #include <stack>
8 using std::stack;
9
10 /*----------------------------------------------------------------------*\
11 |* Declaration *|
12 \*---------------------------------------------------------------------*/
13
14 /*--------------------------------------*\
15 |* Public *|
16 \*-------------------------------------*/
17
18 namespace gpu
19 {
20
21 class CBI_GLIMAGE_CUDA ImageFonctionelMOOs_A: public ImageMOOs_A
22 {
23
24 /*--------------------------------------*\
25 |* Constructor *|
26 \*-------------------------------------*/
27
28 public:
29
30 ImageFonctionelMOOs_A(unsigned int w, unsigned int h, gpu::DomaineMath domaineMath);
31
32 virtual ~ImageFonctionelMOOs_A();
33
34 /*--------------------------------------*\
35 |* Methodes *|
36 \*-------------------------------------*/
37
38 public:
39 /**
40 * fillImageGL avec le domaine courant
41 * w et h fixe, ne change pas au cours du temps !
42 */
43 virtual void fillImageGL(uchar4* ptrDevImageGL, int w, int h, const gpu::DomaineMath& domaineNew)=0; //ptrDevImageGL zone memoire commune OpenGL et Cuda
44
45 /**
46 * Call each time the domaine change
47 * 1) Domaines : new domaine of the image
48 */
49 virtual void onDomaineChangePerformed(const gpu::DomaineMath& domaineNew);
50
51 /**
52 * Override
53 */
54 virtual void paintPrimitivesAPI(Graphic2Ds& ptrGraphic2D);
55
56 /**
57 * Last Domaine push in History
58 */
59 void restoreFromDomaineHistory();
60
61 /**
62 * First Domaine of History
63 */
64 void headOfDomaineHistory();
65
66 /**
67 * Override
68 */
69 virtual void print(ostream& stream) const;
70
71 private:
72
73 /**
74 * Override
75 * call fillImageGL with current domaine
76 */
77 virtual void fillImageGL(uchar4* ptrDevImageGL, int w, int h);
78
79 /*--------------------------------------*\
80 |* Get *|
81 \*-------------------------------------*/
82
83 public:
84
85 /**
86 * Domaine currently used
87 */
88 gpu::DomaineMath getCurrentDomaine() const;
89
90 /*--------------------------------------*\
91 |* Set *|
92 \*-------------------------------------*/
93
94 public:
95
96 void setCurrentDomaine(gpu::DomaineMath domaineNew);
97
98 void setEnableDomaineOverlay(bool isEnable);
99
100 /*--------------------------------------*\
101 |* Is *|
102 \*-------------------------------------*/
103
104 public:
105
106 inline bool isEnableDomaineOverlay()
107 {
108 return enableDomaineOverlay;
109 }
110
111 /*--------------------------------------*\
112 |* Attributs *|
113 \*-------------------------------------*/
114
115 private:
116
117 //Input
118 gpu::DomaineMath homeDomaine;
119
120 //Tools
121 stack<gpu::DomaineMath> stackHistoryDomaine;
122 bool enableDomaineOverlay;
123
124 };
125 }
126
127 #endif
128
129 /*----------------------------------------------------------------------*\
130 |* End *|
131 \*---------------------------------------------------------------------*/