X-Git-Url: http://git.euphorik.ch/?p=GPU.git;a=blobdiff_plain;f=WCudaMSE%2FBilatTools_CPP%2Fsrc%2Fcore%2Ftools%2Fcpp%2Fnamespace_cpu%2FIndiceTools_CPU.cpp;h=efc02fee76d3e4aab89106d07b63924e59584ec4;hp=b70c829a2de260f22bc3448ec5cc2886f4d3e093;hb=f8259dce248a4411c3bc64cecb9fc268c4fd81d6;hpb=d720146850389c8bbe75cb86e69d7e26629ff97f diff --git a/WCudaMSE/BilatTools_CPP/src/core/tools/cpp/namespace_cpu/IndiceTools_CPU.cpp b/WCudaMSE/BilatTools_CPP/src/core/tools/cpp/namespace_cpu/IndiceTools_CPU.cpp index b70c829..efc02fe 100755 --- a/WCudaMSE/BilatTools_CPP/src/core/tools/cpp/namespace_cpu/IndiceTools_CPU.cpp +++ b/WCudaMSE/BilatTools_CPP/src/core/tools/cpp/namespace_cpu/IndiceTools_CPU.cpp @@ -20,12 +20,19 @@ namespace cpu *ptrJ = s - w * (*ptrI); } + float2 IndiceTools::toPixelFloat(int s, int w) + { + const float y = (float)s / (float)w; + const float x = (float)s - (float)w * y; + return { x, y }; + } + /** * i[0,H[ j[0,W[ --> s[0,W*H[ */ - int IndiceTools::toS(int W, int i, int j) + int IndiceTools::toS(int w, int i, int j) { - return (i * W) + j; + return (i * w) + j; } }