Now we can start messing around to get cool effects. First, notice that the entire image is out of focus. I will now slide the focal distance slider to the left to move the focus from far to close. The next few images show the results, with objects closer to the camera becoming in focus, until finally we slide it too much, and everything goes out of focus again.
To implement this, I shift each image before interpolating (via bilinear or gaussian, Ive implemented both). The amount of shift is determined by the focal distance slider.