X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FAPI_Bilat_Image_GL%2FINC%2Fcpu%2FImageFonctionelMOOs_A_CPU.h;fp=WCudaMSE%2FAPI_Bilat_Image_GL%2FINC%2Fcpu%2FImageFonctionelMOOs_A_CPU.h;h=7c95de9ac32401074121b3d067131c3ace3c3143;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/API_Bilat_Image_GL/INC/cpu/ImageFonctionelMOOs_A_CPU.h b/WCudaMSE/API_Bilat_Image_GL/INC/cpu/ImageFonctionelMOOs_A_CPU.h new file mode 100755 index 0000000..7c95de9 --- /dev/null +++ b/WCudaMSE/API_Bilat_Image_GL/INC/cpu/ImageFonctionelMOOs_A_CPU.h @@ -0,0 +1,131 @@ +#ifndef IMAGE_FONCTIONEL_MOOS_A_CPU_H +#define IMAGE_FONCTIONEL_MOOS_A_CPU_H + +#include "ImageMOOs_A_CPU.h" +#include "DomaineMath_CPU.h" + +#include +using std::stack; + +/*----------------------------------------------------------------------*\ + |* Declaration *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +/** + * ImageMOO with a Mathematical Domaine. This domaine can be modified. + * An history of modification is maintained for undo. + */ +namespace cpu + { + class CBI_GLIMAGE ImageFonctionelMOOs_A: public cpu::ImageMOOs_A + { + + /*--------------------------------------*\ + |* Constructor *| + \*-------------------------------------*/ + + public: + + ImageFonctionelMOOs_A(unsigned int m, unsigned int n, cpu::DomaineMath domaine); + + ImageFonctionelMOOs_A(const cpu::ImageFonctionelMOOs_A &imageSource); + + /*--------------------------------------*\ + |* Destructor *| + \*-------------------------------------*/ + + virtual ~ImageFonctionelMOOs_A(); + + /*--------------------------------------*\ + |* Methodes *| + \*-------------------------------------*/ + + public: + + virtual void fillImageGL(cpu::uchar4* ptrTabPixel, int w, int h, const cpu::DomaineMath& domaineNew)=0; + + /** + * Last Domaine push in History + */ + void restoreFromDomaineHistory(); + + /** + * First Domaine of History + */ + void headOfDomaineHistory(); + + /** + * Override + */ + virtual void print(ostream& stream) const; + + /** + * Override + */ + virtual void paintPrimitivesAPI(Graphic2Ds& ptrGraphic2D); + + /** + * Override + */ + virtual void fillImageGL(cpu::uchar4* ptrDevImageGL, int w, int h); + + protected: + + /** + * Override + * New mathematical domaine for this image. + * Previous domaine will be put in history and current domaine is domaineNew + */ + virtual void onDomaineChangePerformed(const cpu::DomaineMath& domaineNew); + + + /*--------------------------------------*\ + |* Get *| + \*-------------------------------------*/ + + public: + /** + * Domaine currently used + */ + cpu::DomaineMath getCurrentDomaine() const; + + /*--------------------------------------*\ + |* Set *| + \*-------------------------------------*/ + + public: + + void setCurrentDomaine(cpu::DomaineMath domaineNew); + + void setEnableDomaineOverlay(bool isEnable); + + /*--------------------------------------*\ + |* Is *| + \*-------------------------------------*/ + + public: + + inline bool isEnableDomaineOverlay() + { + return enableDomaineOverlay; + } + + /*---------------------------------------*\ + |* Attributs *| + \*---------------------------------------*/ + private: + + // Inputs + cpu::DomaineMath homeDomaine; + + // Tools + stack stackHistoryDomaine; + bool enableDomaineOverlay; + }; + } + +#endif