Mercurial > hg > ishara
annotate general/algo/optpause.m @ 61:eff6bddf82e3 tip
Finally implemented perceptual brightness thing.
author | samer |
---|---|
date | Sun, 11 Oct 2015 10:20:42 +0100 |
parents | 03694e5c8365 |
children |
rev | line source |
---|---|
samer@4 | 1 function optpause(opt) |
samer@4 | 2 % optpause - Optionally pause and/or update graphics |
samer@4 | 3 % |
samer@4 | 4 % optpause :: struct { |
samer@13 | 5 % pause :: nonneg/0 ~'0-nopause, 1-pause, N-timed pause in ms'; |
samer@13 | 6 % drawnow :: bool/0 ~'flush graphics if not pausing' |
samer@4 | 7 % } => void. |
samer@4 | 8 |
samer@4 | 9 ps=getparam(opt,'pause',0); |
samer@4 | 10 dn=getparam(opt,'drawnow',1); |
samer@4 | 11 if ps, |
samer@4 | 12 if ps>=10, pause(ps/1000); else pause; end |
samer@4 | 13 elseif dn, drawnow; |
samer@4 | 14 end |