Mercurial > hg > ishara
view sinks/@sinkcat/construct.m @ 61:eff6bddf82e3 tip
Finally implemented perceptual brightness thing.
author | samer |
---|---|
date | Sun, 11 Oct 2015 10:20:42 +0100 |
parents | 672052bd81f8 |
children |
line wrap: on
line source
function s=construct(sig) sc=construct(sig.sinks{1}); sx=sig.sinks(2:end); s.start = @start; s.stop = @stop; s.dispose = @dispose; s.writer = @writer; function start, sc.start(); end function stop, sc.stop(); end function dispose, sc.dispose(); end function r=writer(n) rc=sc.writer(n); r = @next; function rem=next(x) rem=rc(x); while rem>0 && ~isempty(sx) % current signal exhausted, try next sc.dispose(); sc=construct(sx{1}); sx=sx(2:end); rem=sinkwriten(sc,n,x(end-rem+1:end)); rc=sc.writer(n); end end end end