annotate arrows/@estates/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
|
samer@0
|
3 u=construct(s.base,sizes_in);
|
samer@0
|
4 s0=u.get_state();
|
samer@0
|
5 u.sizes_out = [u.sizes_out,size(s0)];
|
samer@0
|
6 u.process = mkproc(u.process, nargout(s.base), ...
|
samer@0
|
7 u.get_state,s.period);
|
samer@0
|
8 end
|
samer@0
|
9
|
samer@0
|
10 function f=mkproc(g,nout,getst,period)
|
samer@0
|
11 k=1;
|
samer@0
|
12 f=@proc_nnn;
|
samer@0
|
13
|
samer@0
|
14 function varargout=proc_nnn(varargin)
|
samer@0
|
15 varargout=cell(1,nout+1);
|
samer@0
|
16 [varargout{1:nout}]=g(varargin{:});
|
samer@0
|
17 if k==1,
|
samer@0
|
18 k=period;
|
samer@0
|
19 varargout{nout+1}={getst()};
|
samer@0
|
20 else
|
samer@0
|
21 k=k-1;
|
samer@0
|
22 varargout{nout+1}={};
|
samer@0
|
23 end
|
samer@0
|
24 end
|
samer@0
|
25 end
|
samer@0
|
26
|