Ajout du squelette de Newton.
[GPU.git] / WCudaMSE / Student_Cuda_Image / src / cpp / core / 03_Newton / moo / device / math / NewtonMath.h
1 #ifndef NEWTON_MATH_H_
2 #define NEWTON_MATH_H_
3
4 #include <cmath>
5
6 #include "CalibreurF.h"
7 #include "ColorTools.h"
8
9 class NewtonMath
10 {
11 public:
12 __device__
13 NewtonMath()
14 : calibreur(IntervalF(1, 100), IntervalF(0, 1))
15 {
16 }
17
18 __device__
19 virtual ~NewtonMath() {}
20
21 public:
22 /**
23 * x=pixelI
24 * y=pixelJ
25 */
26 __device__
27 void colorXY(uchar4* ptrColor, float x, float y) const
28 {
29 ptrColor->x = 0;
30 ptrColor->y = 0;
31 ptrColor->z = 0;
32
33 int i = 0;
34 float s = static_cast<float>(i);
35 this->calibreur.calibrer(s);
36 ColorTools::HSB_TO_RVB(s, ptrColor);
37 }
38
39 private:
40
41 private:
42 CalibreurF calibreur;
43 };
44
45 #endif