Implémentation du raytracing pour Global Memory/Shared Memory/Constant Memory
[GPU.git] / WCudaMSE / BilatTools_CPP / src / core / tools / cpp / namespace_cpu / IndiceTools_CPU.cpp
index b70c829..efc02fe 100755 (executable)
@@ -20,12 +20,19 @@ namespace cpu
        *ptrJ = s - w * (*ptrI);\r
        }\r
 \r
+    float2 IndiceTools::toPixelFloat(int s, int w)\r
+        {\r
+        const float y = (float)s / (float)w;\r
+        const float x = (float)s - (float)w * y;\r
+        return { x, y };\r
+        }\r
+\r
     /**\r
      * i[0,H[ j[0,W[ --> s[0,W*H[\r
      */\r
-    int IndiceTools::toS(int W, int i, int j)\r
+    int IndiceTools::toS(int w, int i, int j)\r
        {\r
-       return (i * W) + j;\r
+       return (i * w) + j;\r
        }\r
 \r
     }\r