Support resampling of arbitrary box size