b70c829a2de260f22bc3448ec5cc2886f4d3e093
[GPU.git] / WCudaMSE / BilatTools_CPP / src / core / tools / cpp / namespace_cpu / IndiceTools_CPU.cpp
1 #include "IndiceTools_CPU.h"
2
3 /*----------------------------------------------------------------------*\
4 |* Implementation *|
5 \*---------------------------------------------------------------------*/
6
7 /*--------------------------------------*\
8 |* Public *|
9 \*-------------------------------------*/
10
11 namespace cpu
12 {
13
14 /**
15 * s[0,W*H[ --> i[0,H[ j[0,W[
16 */
17 void IndiceTools::toIJ( int s, int w, int* ptrI, int* ptrJ)
18 {
19 *ptrI = s / w;
20 *ptrJ = s - w * (*ptrI);
21 }
22
23 /**
24 * i[0,H[ j[0,W[ --> s[0,W*H[
25 */
26 int IndiceTools::toS(int W, int i, int j)
27 {
28 return (i * W) + j;
29 }
30
31 }
32 /*----------------------------------------------------------------------*\
33 |* End *|
34 \*---------------------------------------------------------------------*/
35