static IBinaryImage iBinaryImageFromFunction(IIntIntPred f, int w, int h) { ret new IBinaryImage { public int getWidth() { ret w; } public int getHeight() { ret h; } public bool getBoolPixel(int x, int y) { ret f.get(x, y); } }; }