annotate general/algo/bracket_it.m @ 61:eff6bddf82e3 tip

Finally implemented perceptual brightness thing.
author samer
date Sun, 11 Oct 2015 10:20:42 +0100
parents f7fb679637ff
children
rev   line source
samer@10 1 % bracket_it - Bracket iterator with pre and post actions
samer@10 2 %
samer@10 3 % bracket_it ::
samer@10 4 % iterator(A) ~'an iterator',
samer@10 5 % (A=>void) ~'action to perform before calling iterator',
samer@10 6 % (A=>void) ~'action to perform after calling iterator'
samer@10 7 % -> iterator(A) ~'new iterator incorporating pre and post actions'.
samer@10 8 function it=bracket_it(it,pre,post)
samer@10 9 f=it{1}; it{1}=@bf;
samer@10 10 function x=bf(x), pre(x); x=f(x); post(x); end
samer@10 11 end