annotate arrows/@abuffer/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 u=construct(s.base,sizes_in);
|
samer@0
|
3
|
samer@0
|
4 u.sizes_out = {[u.sizes_out{1}(1),s.width]};
|
samer@0
|
5 subproc = u.process;
|
samer@0
|
6 width = s.width;
|
samer@0
|
7
|
samer@0
|
8 if nargin(s.base)==0 && nargout(s.base)==1
|
samer@0
|
9 u.process = @proc01;
|
samer@0
|
10 elseif nargin(s.base)==1 && nargout(s.base)==0
|
samer@0
|
11 u.process = @proc10;
|
samer@0
|
12 else
|
samer@0
|
13 u.process = @proc11;
|
samer@0
|
14 end
|
samer@0
|
15
|
samer@0
|
16 function proc10(X)
|
samer@0
|
17 for i=1:width, subproc(X(:,i)); end
|
samer@0
|
18 end
|
samer@0
|
19
|
samer@0
|
20 function Y=proc11(X)
|
samer@0
|
21 y=subproc(X(:,1));
|
samer@0
|
22 Y=repmat(y,1,width);
|
samer@0
|
23 for i=2:width
|
samer@0
|
24 Y(:,i)=subproc(X(:,i));
|
samer@0
|
25 end
|
samer@0
|
26 end
|
samer@0
|
27
|
samer@0
|
28 function Y=proc01
|
samer@0
|
29 y=subproc();
|
samer@0
|
30 Y=repmat(y,1,width);
|
samer@0
|
31 for i=2:width
|
samer@0
|
32 Y(:,i)=subproc();
|
samer@0
|
33 end
|
samer@0
|
34 end
|
samer@0
|
35 end
|
samer@0
|
36
|