Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / API_Bilat_Image_GL / INC / cpu / ImageFonctionelMOOs_A_CPU.h
1 #ifndef IMAGE_FONCTIONEL_MOOS_A_CPU_H
2 #define IMAGE_FONCTIONEL_MOOS_A_CPU_H
3
4 #include "ImageMOOs_A_CPU.h"
5 #include "DomaineMath_CPU.h"
6
7 #include <stack>
8 using std::stack;
9
10 /*----------------------------------------------------------------------*\
11 |* Declaration *|
12 \*---------------------------------------------------------------------*/
13
14 /*--------------------------------------*\
15 |* Public *|
16 \*-------------------------------------*/
17
18 /**
19 * ImageMOO with a Mathematical Domaine. This domaine can be modified.
20 * An history of modification is maintained for undo.
21 */
22 namespace cpu
23 {
24 class CBI_GLIMAGE ImageFonctionelMOOs_A: public cpu::ImageMOOs_A
25 {
26
27 /*--------------------------------------*\
28 |* Constructor *|
29 \*-------------------------------------*/
30
31 public:
32
33 ImageFonctionelMOOs_A(unsigned int m, unsigned int n, cpu::DomaineMath domaine);
34
35 ImageFonctionelMOOs_A(const cpu::ImageFonctionelMOOs_A &imageSource);
36
37 /*--------------------------------------*\
38 |* Destructor *|
39 \*-------------------------------------*/
40
41 virtual ~ImageFonctionelMOOs_A();
42
43 /*--------------------------------------*\
44 |* Methodes *|
45 \*-------------------------------------*/
46
47 public:
48
49 virtual void fillImageGL(cpu::uchar4* ptrTabPixel, int w, int h, const cpu::DomaineMath& domaineNew)=0;
50
51 /**
52 * Last Domaine push in History
53 */
54 void restoreFromDomaineHistory();
55
56 /**
57 * First Domaine of History
58 */
59 void headOfDomaineHistory();
60
61 /**
62 * Override
63 */
64 virtual void print(ostream& stream) const;
65
66 /**
67 * Override
68 */
69 virtual void paintPrimitivesAPI(Graphic2Ds& ptrGraphic2D);
70
71 /**
72 * Override
73 */
74 virtual void fillImageGL(cpu::uchar4* ptrDevImageGL, int w, int h);
75
76 protected:
77
78 /**
79 * Override
80 * New mathematical domaine for this image.
81 * Previous domaine will be put in history and current domaine is domaineNew
82 */
83 virtual void onDomaineChangePerformed(const cpu::DomaineMath& domaineNew);
84
85
86 /*--------------------------------------*\
87 |* Get *|
88 \*-------------------------------------*/
89
90 public:
91 /**
92 * Domaine currently used
93 */
94 cpu::DomaineMath getCurrentDomaine() const;
95
96 /*--------------------------------------*\
97 |* Set *|
98 \*-------------------------------------*/
99
100 public:
101
102 void setCurrentDomaine(cpu::DomaineMath domaineNew);
103
104 void setEnableDomaineOverlay(bool isEnable);
105
106 /*--------------------------------------*\
107 |* Is *|
108 \*-------------------------------------*/
109
110 public:
111
112 inline bool isEnableDomaineOverlay()
113 {
114 return enableDomaineOverlay;
115 }
116
117 /*---------------------------------------*\
118 |* Attributs *|
119 \*---------------------------------------*/
120 private:
121
122 // Inputs
123 cpu::DomaineMath homeDomaine;
124
125 // Tools
126 stack<cpu::DomaineMath> stackHistoryDomaine;
127 bool enableDomaineOverlay;
128 };
129 }
130
131 #endif