You may be right about set_extent, it's probably more useful to add a real ROI facility with proper error checking. Do you want me to remove this from the pull request?

Regarding the other changes: I'm looking for a way to tell Halide "this block of memory has coordinates ranging from (256,256) to (512,512), and I think that this is exactly what min and extent are for. Unfortunately, simple range checks inside the filter like

Halide::clamp(x, 0, in.width()-1)

don't work correctly in this context and have to be replaced with

Halide::clamp(x, in.xmin(), in.xmin() + in.width()-1)

Allowing this is the main purpose of the patch.