// Limitation: img must be square with w/h a power of 2 svoid storeIntegralImageProgressively(IntegralImage img, IVF1 store) { assertSquare(img); int w = img.getWidth(); assertPowerOfTwo(w); int exponent = 0, size = 1; new Set seen; while (size <= w) { 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(pt(x, y), img.get(x, y)); exponent++; size <<= 1; } }