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); } }; } static IBinaryImage iBinaryImageFromFunction(int w, int h, IIntIntPred f) { ret iBinaryImageFromFunction(f, w, h); }