#define INDEX(_X,_Y,_W) (_X+_Y*_W)
#define X(_INDEX,_W) (_INDEX%_W)
#define Y(_INDEX,_W) (_INDEX/_W)
#define NOTTOP(_INDEX,_W,_H) (_INDEX >= _W)
#define NOTBOTTOM(_INDEX,_W,_H) (_INDEX < _W*(_H-1))
#define NOTEDGELF(_INDEX,_W,_H) (_INDEX%_W > 0)
#define NOTEDGERG(_INDEX,_W,_H) (_INDEX%_W < _W-1)
