162
C H A P T E R 5
Scripting
Now we can start shooting. The current focal distance is kept in variable
f
which is set to the near limit (parameter
a
). The shooting distance is printed
on the screen to inform the user about the shooting progress. The focus is
set and the script is paused for a while to give the camera some time to
adjust the optics. The amount of time needed may depend on the camera
model. After this pause, the camera is fired.
Then we wait until the camera has processed the image ( subroutine
wait
). If the subject distance
f
was set to infinity or is larger than the hyper-
focal distance, we are done; a longer focus is not possible or does not result
in better sharpness. Otherwise, the DOF far limit of the current shot is de-
termined with the above formula. This value is used as the new focal
length:
rem DOF series
f = a
n = 0
do
if f < 0 then
print "dist: inf"
else
print "dist:",f
endif
set_focus f
sleep 3000
click "shoot_full"
n = n + 1
gosub "wait"
if f < 0 or f >= y then
goto "exit"
f = y*f / (y-f)
if f >= 65535 then f = -1
until f > c and c >= 0
After completing all shots, the camera is reset to its previous state. The
shutter button (which was still half-pressed) and the AF lock are released,
the camera is reset to its previous focal distance, and the flash is switched
back to its previous mode. Finally, we print a short summary and play a
timer sound to wake up the user. The
wait_click
allows the user 30 sec-
onds to read the screen:
:exit
set_aflock 0
release "shoot_half"
set_focus z
M = m
Содержание Camera
Страница 1: ......
Страница 2: ...The Canon Camera Hackers Manual ...
Страница 3: ......
Страница 4: ...Berthold Daum The Canon Camera Hackers Manual Teach Your Camera New Tricks ...
Страница 19: ...10 CH APTER 2 Cameras and Operating Systems ...
Страница 25: ...16 CH APTER 3 ...
Страница 85: ...76 CH APTER 4 Teach Your Camera New Tricks ...
Страница 213: ...204 CH APTER 6 ...
Страница 253: ...244 AP PENDIX ...