Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/pure-cfg/test/fields.diderot
ViewVC logotype

Annotation of /branches/pure-cfg/test/fields.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1109 - (view) (download)

1 : glk 1020 // fields
2 :     //
3 :     // documents bugs in field expressions
4 :     // process output with:
5 :     // unu reshape -i mip.txt -s 2 300 200 | unu pad -min 0 0 0 -max 2 M M -b wrap | unu quantize -b 8 -o fields.png
6 : glk 933
7 :    
8 :     int imgSizeX = 300;
9 :     int imgSizeY = 200;
10 :    
11 :     image(2)[2] Vimg = load("../data/vorttest.nrrd");
12 :    
13 : jhr 1031 field#1(2)[2] Vpos = Vimg ⊛ ctmr;
14 :     field#1(2)[2] V1 = -Vpos;
15 : jhr 1033
16 : jhr 1031 field#1(2)[2] V2 = 1.0*(Vimg ⊛ ctmr);
17 : glk 933
18 : jhr 1109 field#1(2)[2] V3 = Vpos;
19 : glk 933
20 : jhr 1031 field#1(2)[2] V4 = Vpos + Vpos;
21 : glk 933
22 : jhr 1031 //image(2)[] Rimg = load("../data/vorttest-rand.nrrd");
23 :     field#0(2)[] R = load("../data/vorttest-rand.nrrd") ⊛ tent;
24 : glk 933
25 :     strand LIC (int xi, int yi) {
26 :     real xx = lerp(0.0, 3.0, -0.5, real(xi), real(imgSizeX)-0.5);
27 :     real yy = lerp(0.0, 2.0, -0.5, real(yi), real(imgSizeY)-0.5);
28 :     vec2 pos = [xx,yy];
29 :     output vec2 v = [0.0,0.0];
30 :    
31 :     update {
32 : jhr 1109 v = (V1(pos) + V2(pos) + V3(pos) + V4(pos)) * R(pos);
33 : jhr 1045 v = -V1(pos);
34 : glk 933 stabilize;
35 :     }
36 :     }
37 :    
38 :     initially [ LIC(xi, yi) | yi in 0..(imgSizeY-1), xi in 0..(imgSizeX-1) ];

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0