// Limitation: img must be square with w/h a power of 2 svoid storeIntegralImageProgressively(IntegralImage img, IVF2 store) { assertSquare(img); int w = img.getWidth(); assertPowerOfTwo(w); int size = w; new Set seen; while ping (size > 0) { for (int y = 0; y < w; y += size) for (int x = 0; x < w; x += size) if (seen.add(pt(x, y))) // TODO: can't you calculate this?! store.get(pt(x, y), img.get(x, y)); size >>= 1; } }