X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FTuto_Image%2Fsrc%2Fcpp%2Fcore%2F02_Damier_Zoomable%2Fa_image%2FDamierImage.cpp;fp=WCudaMSE%2FTuto_Image%2Fsrc%2Fcpp%2Fcore%2F02_Damier_Zoomable%2Fa_image%2FDamierImage.cpp;h=a3373d9637ef0f20db0a4d0d9d09872f8dd98f7f;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/Tuto_Image/src/cpp/core/02_Damier_Zoomable/a_image/DamierImage.cpp b/WCudaMSE/Tuto_Image/src/cpp/core/02_Damier_Zoomable/a_image/DamierImage.cpp new file mode 100755 index 0000000..a3373d9 --- /dev/null +++ b/WCudaMSE/Tuto_Image/src/cpp/core/02_Damier_Zoomable/a_image/DamierImage.cpp @@ -0,0 +1,110 @@ +#include +#include + +#include "DamierImage.h" +#include "StringTools.h" +#include "OmpTools.h" +#include "MathTools.h" +#include "IndiceTools.h" +#include "ColorTools.h" + +using std::cout; +using std::endl; +using std::string; + +/*----------------------------------------------------------------------*\ + |* Declaration *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + +/*----------------------------------------------------------------------*\ + |* Implementation *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +/** + * DomaineMaths(0, 0, 2 * PI, 2 * PI) : par exemple, why not celui là! + */ +DamierImage::DamierImage(unsigned int w, unsigned int h, float dt, int n) : + ImageFonctionelMOOs_A(w, h, DomaineMath(0, 0, 2 * PI, 2 * PI)) + { + //Tools + this->ptrDamierMOO=new DamierMOO(w,h,dt,n); + + setEnableDomaineOverlay(true); + } + +DamierImage::~DamierImage(void) + { + delete ptrDamierMOO; + } + +/*--------------------------------------*\ + |* Override *| + \*-------------------------------------*/ + +/** + * Override + * Called automatically by the API + */ +void DamierImage::fillImageGL(uchar4* ptrTabPixels, int w, int h, const DomaineMath& domaineMath) + { + ptrDamierMOO->process(ptrTabPixels, w, h,domaineMath); + } + +/** + * Override + * call periodicly by the api + */ +void DamierImage::animationStep(bool& isNeedUpdateView) + { + ptrDamierMOO->animationStep(); + } + +/** + * Override + * call periodicly by the api + */ +void DamierImage::paintPrimitives(Graphic2Ds& graphic2D) + { + const Font_A* ptrFont = graphic2D.getFont(TIMES_ROMAN_24); + + float r = 0; + float g = 0; + float b = 0; + graphic2D.setColorRGB(r, g, b); + + // Top + { + float t=ptrDamierMOO->getT(); + int n=ptrDamierMOO->getN(); + + string message = "t = " + StringTools::toString(t) + " n = " + StringTools::toString(n); + graphic2D.drawTitleTop(message, ptrFont); + } + + // Bottom + { + graphic2D.drawTitleBottom("[API Image Fonctionelle] : Damier zoomable OMP", ptrFont); + } + } + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/ +