X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FBilatTools_Cuda%2Fsrc%2Fcore%2Fcudatools%2Fheader%2Fboth%2FCalibreurF_GPU.h;fp=WCudaMSE%2FBilatTools_Cuda%2Fsrc%2Fcore%2Fcudatools%2Fheader%2Fboth%2FCalibreurF_GPU.h;h=5d5183c18d0be57f4e1ba32b1f741558c543f8f6;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/BilatTools_Cuda/src/core/cudatools/header/both/CalibreurF_GPU.h b/WCudaMSE/BilatTools_Cuda/src/core/cudatools/header/both/CalibreurF_GPU.h new file mode 100755 index 0000000..5d5183c --- /dev/null +++ b/WCudaMSE/BilatTools_Cuda/src/core/cudatools/header/both/CalibreurF_GPU.h @@ -0,0 +1,78 @@ +#ifndef CALIBREUR_F_CUDA_H_ +#define CALIBREUR_F_CUDA_H_ + +#include "both_define.h" +#include "IntervalF_GPU.h" + +namespace gpu + { + + class CalibreurF + { + public: + + /*--------------------------------------*\ + |* Constructor *| + \*-------------------------------------*/ + + __BOTH__ + CalibreurF(const IntervalF& input, const IntervalF& output) + { + this->pente = (output.b - output.a) / (input.b - input.a); + this->translation = output.a - pente * input.a; + } + + // constructeur copie automatique car pas pointeur dans + // CalibreurF + // IntervalF + +// // TODO dangereux +// __device__ __host__ +// CalibreurF(const CalibreurF& source) +// { +// } + + + + /*--------------------------------------*\ + |* Methodes *| + \*-------------------------------------*/ + + public: + + __BOTH__ + void calibrer(float& value) + { + value = value * pente + translation; + } + + __BOTH__ + float getPente() + { + return this->pente; + } + + __BOTH__ + float getTranslation() + { + return this->translation; + } + + /*--------------------------------------*\ + |* Attributs *| + \*-------------------------------------*/ + + private: + + // Output + float pente; + float translation; + + }; + + } +#endif + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/