TP fractalTP fractal..
[GPU.git] / WCudaMSE / BilatTools_Cuda / src / core / cudatools / header / both / CalibreurF_GPU.h
1 #ifndef CALIBREUR_F_CUDA_H_
2 #define CALIBREUR_F_CUDA_H_
3
4 #include "both_define.h"
5 #include "IntervalF_GPU.h"
6
7 namespace gpu
8 {
9
10 class CalibreurF
11 {
12 public:
13
14 /*--------------------------------------*\
15 |* Constructor *|
16 \*-------------------------------------*/
17
18 __BOTH__
19 CalibreurF(const IntervalF& input, const IntervalF& output)
20 {
21 this->pente = (output.b - output.a) / (input.b - input.a);
22 this->translation = output.a - pente * input.a;
23 }
24
25 // constructeur copie automatique car pas pointeur dans
26 // CalibreurF
27 // IntervalF
28
29 // // TODO dangereux
30 // __device__ __host__
31 // CalibreurF(const CalibreurF& source)
32 // {
33 // }
34
35
36
37 /*--------------------------------------*\
38 |* Methodes *|
39 \*-------------------------------------*/
40
41 public:
42
43 __BOTH__
44 void calibrer(float& value) const
45 {
46 value = value * pente + translation;
47 }
48
49 __BOTH__
50 float getPente() const
51 {
52 return this->pente;
53 }
54
55 __BOTH__
56 float getTranslation() const
57 {
58 return this->translation;
59 }
60
61 /*--------------------------------------*\
62 |* Attributs *|
63 \*-------------------------------------*/
64
65 private:
66
67 // Output
68 float pente;
69 float translation;
70
71 };
72
73 }
74 #endif
75
76 /*----------------------------------------------------------------------*\
77 |* End *|
78 \*---------------------------------------------------------------------*/