X-Git-Url: http://git.euphorik.ch/?p=GPU.git;a=blobdiff_plain;f=WCudaMSE%2FBilatTools_Cuda%2Fsrc%2Fcore%2Fcudatools%2Fheader%2Fdevice%2FIndiceTools_GPU.h;fp=WCudaMSE%2FBilatTools_Cuda%2Fsrc%2Fcore%2Fcudatools%2Fheader%2Fdevice%2FIndiceTools_GPU.h;h=f62ddf3723868b6824c88cc65a48d7aaec714c6f;hp=d230aef4f854ea10818b47b2bc41c8115a2e6f63;hb=f8259dce248a4411c3bc64cecb9fc268c4fd81d6;hpb=d720146850389c8bbe75cb86e69d7e26629ff97f diff --git a/WCudaMSE/BilatTools_Cuda/src/core/cudatools/header/device/IndiceTools_GPU.h b/WCudaMSE/BilatTools_Cuda/src/core/cudatools/header/device/IndiceTools_GPU.h index d230aef..f62ddf3 100755 --- a/WCudaMSE/BilatTools_Cuda/src/core/cudatools/header/device/IndiceTools_GPU.h +++ b/WCudaMSE/BilatTools_Cuda/src/core/cudatools/header/device/IndiceTools_GPU.h @@ -2,6 +2,7 @@ #define INDICES_TOOLS_GPU_H_ #include "both_define.h" +#include "cudaType_CPU.h" /*----------------------------------------------------------------------*\ |* Declaration *| @@ -34,12 +35,24 @@ namespace gpu * h = hauteur */ __BOTH__ - static void toIJ( int s, int w, int* ptrI, int* ptrJ) + static void toIJ( int s, int w, int* ptrI, int* ptrJ) { *ptrI = s / w; *ptrJ = s - w * (*ptrI); } + /** + * s[0,W*H[ --> x[0,W[ y[0,H[ + */ + __BOTH__ + static float2 toPixelFloat(int s, int w) + { + const int y = s / w; + const int x = s - w * y; + const float2 pixel = { (float)x, (float)y }; + return pixel; + } + /** * i[0,H[ j[0,W[ --> s[0,W*H[ * w = largeur @@ -60,7 +73,7 @@ namespace gpu }; } -#endif +#endif /*----------------------------------------------------------------------*\ |* End *|