Mercurial > hg > ishara
view arrows/@rgbimager/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 u=construct(s,sizes_in) figure(fig(s)); xl=s.opts.xlim; yl=s.opts.ylim; X=zeros(sizes_in{1}); if isempty(xl) && isempty(yl) h=image(X,s.opts.args{:}); else if isempty(xl) xl=[1,size(X,2)]; end if isempty(yl) yl=[1,size(X,1)]; end h=image(xl,yl,X,s.opts.args{:}); end if isfield(s.opts,'ylabel'), ylabel(s.opts.ylabel); end if isfield(s.opts,'xlabel'), xlabel(s.opts.xlabel); end u=mkunit(s); if autoflush(s), u.process =@proc_flush; else u.process=@proc_noflush; end u.sizes_out = {}; u.dispose = @()delete(h); function proc_flush(x), set(h,'CData',x); drawnow; end function proc_noflush(x), set(h,'CData',x); end end