Mercurial > hg > ishara
view arrows/@afirst/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) nin=nargin(s.base); u=construct(s.base,sizes_in(1:nin)); u.sizes_out = [u.sizes_out,sizes_in(nin+(1:s.extra))]; u.process = mkproc(u.process,nin,nargout(s.base),s.extra); end function f=mkproc(g,nin,nout,extra) f=@proc; if extra==1 if nin==1 && nout==1, f=@proc_111; elseif nin==1 && nout==0, f=@proc_101; elseif nin==0 && nout==1, f=@proc_011; else, x=1:extra; f=@proc_nnn; end else x=1:extra; f=@proc_nnn; end function [y1,x]=proc_111(x1,x), y1=g(x1); end function x=proc_101(x1,x), g(x1); end function [y1,x]=proc_011(x), y1=g(x1); end function varargout=proc_nnn(varargin) [varargout{1:nout}]=g(varargin{1:nin}); varargout(nout+x)=varargin(nin+x); end end