static void forEachWithPosition(Matrix m, IVF3 f) { if (m == null || f == null) ret; int w = m.getWidth(), h = m.getHeight(); for y to h: for x to w: f.get(x, y, m.get(x, y)); }