These are the bits that might be of use for your application
Warning: SD1100 specific!!!
This function meters the brightness
-- read curent bv from scene
function read_bv96()
press("shoot_half")
while get_prop(115)==0 do
sleep(100)
end
bv=get_bv96()
release("shoot_half")
return bv
end
This is the function that actually does the shooting:
-- Fast TV shooting
-- Fast Tv mode is defined as a Tv mode where
-- we try to attain a VERY fast shutter time (like 1/5000")
-- by increasing ISO
-- There is anyway a maximum value for ISO
function fast_tv_shoot(bv, fast_tv, max_sv, offset)
-- bv is the brightness we suppose have in the scene
-- if bv=-1 this means we will have to meter ourselves
-- fast_tv is the shutter time we would like to attain
-- max_sv is the maximun sensibility we find acceptable
-- offset is a fine-tuning for very fast exposures
-- Possibile values for fast_tv
-- 1245 = 1/8000
-- 1149 = 1/4000
-- 1053 = 1/2000
-- 957 = 1/1000
-- 861 = 1/500
-- 765 = 1/250
-- Possible values of max_sv
-- 320 = ISO 50
-- 388 = ISO 80
-- 418 = ISO 100
-- 514 = ISO 200
-- 611 = ISO 400
-- 707 = ISO 800
-- 803 = ISO 1600
-- Ixus 80 has fixed aperture
av = 285 + offset
dbg("FAST TV")
dbg("bv " .. bv)
if bv==-1 then
bv=read_bv96()
dbg("metered bv " .. bv)
-- offset measured brightness
end
--if we shoot at fast_tv,
tv=fast_tv
-- resulting sv would be
sv = av + fast_tv - bv
dbg("tv " .. tv)
dbg("sv " .. sv)
-- let's check if it's not too high
if sv>max_sv then
-- how much must we reduce sv?
reduce = sv-max_sv
-- same reduction must be added to tv
tv=tv-reduce
sv=max_sv
dbg("Reduced: ")
dbg("tv " .. tv)
dbg("sv " .. sv)
end
-- it might also happen than sv goes too low
-- arbitrary limit of 322 sv (abt ISO 50)
if sv<322 then
reduce = sv-322
tv=tv-reduce
sv=322
dbg("INCREASED: ")
dbg("tv " .. tv)
dbg("sv " .. sv)
end
-- at last moment, set our parameters
-- set shutter time
set_tv96_direct(tv)
sleep(100)
-- set ISO
set_sv96(sv)
sleep(100)
shoot()
writelog("FTV", "Shoot " .. get_exp_count() .. " ".. bv .. " " .. tv .. " " .. sv .. " " .. av)
repeat
sleep(100)
until get_prop(206)==0
end
Auxiliary functions for debugging and logging:
(if unneeded, remove calls to these functions from fast_tv_shoot)
function timestamp()
h=get_time("h")
m=get_time("m")
s=get_time("s")
return ( h .. ":" .. m .. ":" .. s)
end
function dbg(msg)
-- uncomment for extra info il log file
--print(msg)
end
function writelog(prefix, msg)
ts=timestamp()
print('###' .. prefix .. ' ' .. ts .. ' ' .. ' ' .. msg)
end
The "offset" parameter is a way to try and calibrate for some errors in exposure (I guess the
Sd1100 is somehow not really linear in fast exposures)
I suggest you call the function like this:
-- min shutter 1/1000, max iso 100
fast_tv_shoot(-1, 957, 418, 24)
or
-- min shutter 1/2000, max iso 200
fast_tv_shoot(-1, 1053, 514, 32)
At faster speeds, a new "offset" value (the last parameter) should be re-calibrated by trial and error.
that's probably useless, as 1/2000 is anyway quite fast.