Originally posted by Digitalis The A-DEP mode on canon DSLRS are as close to it as this comes, and it requires a bit of user input through the AF system for measuring distances....and if the user makes demands outside the hardware's capabilities the camera just stops the lens all the way down and hopes the resulting diffraction blurred mess is the result the user wanted.
Interesting... That makes sense. The user needs to focus the camera on the farthest subject, click to store that value, then point the camera at the the closest subject, click to store that value, then let the camera figure out the correct aperture and focus setting, then recompose and hit the shutter button.
For most simple lenses (e.g, ye olde helicoid), any given number of ticks or revolutions of the AF motor corresponds to a specific aperture for DoF purposes. The math is quite easy and the tick-to-aperture equation is constant across the full range of distances (for simple lenses). Thus, the camera can count the ticks between near and far focus, compute the aperture, move the lens to the tick-count mid-point, and be ready to fire off the shot.
Unfortunately, it would be super easy for the user to try to get a nearby face and a distant mountain in focus that requires a diffraction-blurred and impossible to set f/128.