// img must be square with width/height being a power of 2 static Pair bwImageContrastQuadtree(BWImage img) { int w = bw.getWidth(), h = bw.getHeight(); assertEquals("width/height", w, h); if (!isPowerOf2(w)) fail("image size not a power of 2: " + w); BWImage min = new(w, h); BWImage max = new(w, h); bwImageContrastQuadtree_make(img, min, max, 0, 0, w, h); } bwImageContrastQuadtree_make