X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fcore%2F03_Newton%2Fmoo%2Fdevice%2Fmath%2FNewtonMath.h;fp=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fcore%2F03_Newton%2Fmoo%2Fdevice%2Fmath%2FNewtonMath.h;h=5edf6ee56c9671932ce96e06df12cac2c9bf336e;hb=7b1db14e9df63c577384e1722d2028438a51944e;hp=0000000000000000000000000000000000000000;hpb=bd178531f80f8bc41c998d1c4588f9e18cc29389;p=GPU.git diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/03_Newton/moo/device/math/NewtonMath.h b/WCudaMSE/Student_Cuda_Image/src/cpp/core/03_Newton/moo/device/math/NewtonMath.h new file mode 100755 index 0000000..5edf6ee --- /dev/null +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/03_Newton/moo/device/math/NewtonMath.h @@ -0,0 +1,45 @@ +#ifndef NEWTON_MATH_H_ +#define NEWTON_MATH_H_ + +#include + +#include "CalibreurF.h" +#include "ColorTools.h" + +class NewtonMath + { + public: + __device__ + NewtonMath() + : calibreur(IntervalF(1, 100), IntervalF(0, 1)) + { + } + + __device__ + virtual ~NewtonMath() {} + + public: + /** + * x=pixelI + * y=pixelJ + */ + __device__ + void colorXY(uchar4* ptrColor, float x, float y) const + { + ptrColor->x = 0; + ptrColor->y = 0; + ptrColor->z = 0; + + int i = 0; + float s = static_cast(i); + this->calibreur.calibrer(s); + ColorTools::HSB_TO_RVB(s, ptrColor); + } + + private: + + private: + CalibreurF calibreur; + }; + +#endif