TP fractalTP fractal..
[GPU.git] / WCudaMSE / BilatTools_CPP / src / core / tools / header / namespace_cpu / CalibreurF_CPU.h
1 #ifndef CALIBREUR_F_CPU_H_
2 #define CALIBREUR_F_CPU_H_
3
4 #include "IntervalF_CPU.h"
5
6 namespace cpu
7 {
8
9 class CalibreurF
10 {
11 public:
12
13 /*--------------------------------------*\
14 |* Constructor *|
15 \*-------------------------------------*/
16
17 CalibreurF(const IntervalF& input, const IntervalF& output)
18 {
19 this->pente = (output.b - output.a) / (float) (input.b - input.a);
20 this->translation = output.a - pente * input.a;
21 }
22
23 /*--------------------------------------*\
24 |* Methodes *|
25 \*-------------------------------------*/
26
27 public:
28
29 void calibrer(float& value) const
30 {
31 value = value * pente + translation;
32 }
33
34 float getPente() const
35 {
36 return this->pente;
37 }
38
39 float getTranslation() const
40 {
41 return this->translation;
42 }
43
44 /*--------------------------------------*\
45 |* Attributs *|
46 \*-------------------------------------*/
47
48 private:
49
50 // Output
51 float pente;
52 float translation;
53
54 };
55
56 }
57 #endif
58
59 /*----------------------------------------------------------------------*\
60 |* End *|
61 \*---------------------------------------------------------------------*/