X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=WCudaMSE%2FTuto_Image%2Fsrc%2Fcpp%2Fcore%2F01_Vague%2Fa_image%2FVagueImage.cpp;fp=WCudaMSE%2FTuto_Image%2Fsrc%2Fcpp%2Fcore%2F01_Vague%2Fa_image%2FVagueImage.cpp;h=e65e31fc57a0ab9b501e156ba0d9d9a488f2eb9d;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/Tuto_Image/src/cpp/core/01_Vague/a_image/VagueImage.cpp b/WCudaMSE/Tuto_Image/src/cpp/core/01_Vague/a_image/VagueImage.cpp new file mode 100755 index 0000000..e65e31f --- /dev/null +++ b/WCudaMSE/Tuto_Image/src/cpp/core/01_Vague/a_image/VagueImage.cpp @@ -0,0 +1,103 @@ +#include +#include +#include +#include + +#include "VagueImage.h" +#include "MathTools.h" +#include "StringTools.h" +#include "OmpTools.h" +#include "IndiceTools.h" + +using std::cout; +using std::endl; +using std::string; + +/*----------------------------------------------------------------------*\ + |* Declaration *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + +/*----------------------------------------------------------------------*\ + |* Implementation *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +VagueImage::VagueImage(unsigned int w, unsigned int h, float dt) : + ImageMOOs_A(w, h) + { + this->ptrVagueMOO=new VagueMOO(w,h,dt); + } + +VagueImage::~VagueImage(void) + { + delete ptrVagueMOO; + } + +/*--------------------------------------*\ + |* Override *| + \*-------------------------------------*/ + +/** + * Override : call periodicly by the api + */ +void VagueImage::fillImageGL(uchar4* ptrTabPixels, int w, int h) + { + ptrVagueMOO->process(ptrTabPixels,w,h); + } + +/** + * Override : call periodicly by the api + */ +void VagueImage::animationStep(bool& isNeedUpdateView) + { + ptrVagueMOO->animationStep(); + } + +/** + * Override call periodicly by the api + */ +void VagueImage::paintPrimitives(Graphic2Ds& graphic2D) + { + const Font_A* ptrFont = graphic2D.getFont(TIMES_ROMAN_24); + + float r = 1; + float g = 0; + float b = 0; + graphic2D.setColorRGB(r, g, b); + + // Top + { + float t=ptrVagueMOO->getT(); + float dt=ptrVagueMOO->getDT(); + + string message = "t= " + StringTools::toString(t) + " dt=" + StringTools::toString(dt); + graphic2D.drawTitleTop(message, ptrFont); + } + + // Bottom + { + graphic2D.drawTitleBottom("API Image : Vague OMP", ptrFont); + } + } + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + + + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/ +