annotate 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
rev   line source
samer@0 1 function u=construct(s,sizes_in)
samer@0 2 figure(fig(s));
samer@0 3
samer@0 4 xl=s.opts.xlim;
samer@0 5 yl=s.opts.ylim;
samer@0 6 X=zeros(sizes_in{1});
samer@0 7
samer@0 8 if isempty(xl) && isempty(yl)
samer@0 9 h=image(X,s.opts.args{:});
samer@0 10 else
samer@0 11 if isempty(xl) xl=[1,size(X,2)]; end
samer@0 12 if isempty(yl) yl=[1,size(X,1)]; end
samer@0 13 h=image(xl,yl,X,s.opts.args{:});
samer@0 14 end
samer@0 15 if isfield(s.opts,'ylabel'), ylabel(s.opts.ylabel); end
samer@0 16 if isfield(s.opts,'xlabel'), xlabel(s.opts.xlabel); end
samer@0 17
samer@0 18 u=mkunit(s);
samer@0 19 if autoflush(s), u.process =@proc_flush;
samer@0 20 else u.process=@proc_noflush; end
samer@0 21
samer@0 22 u.sizes_out = {};
samer@0 23 u.dispose = @()delete(h);
samer@0 24
samer@0 25 function proc_flush(x), set(h,'CData',x); drawnow; end
samer@0 26 function proc_noflush(x), set(h,'CData',x); end
samer@0 27 end