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

SCM Repository

[diderot] Diff of /branches/fem/test/border-test.diderot
ViewVC logotype

Diff of /branches/fem/test/border-test.diderot

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2965, Thu Mar 5 18:25:43 2015 UTC revision 3076, Mon Mar 16 15:32:40 2015 UTC
# Line 4  Line 4 
4   * All rights reserved.   * All rights reserved.
5   *   *
6   * Test the border control features.   * Test the border control features.
7     *
8     * To convert output to PNG:
9     *
10     *      for i in c m w x ; do ; unu quantize -b 8 -i txt$i.nrrd -o txt$i.png; done
11     *
12     * or
13     *
14     *      unu quantize -b 8 -i txtc.nrrd -o txtc.png
15     *      unu quantize -b 8 -i txtm.nrrd -o txtm.png
16     *      unu quantize -b 8 -i txtw.nrrd -o txtw.png
17     *      unu quantize -b 8 -i txtx.nrrd -o txtx.png
18   */   */
19    
20  input image(2)[3] Img = image("../data/mandril.nrrd");  input image(2)[3] Img = image("../data/mandrill.nrrd");
21    
22  //field#0(2)[3] T = tent ⊛ Img;  //field#0(2)[3] T = tent ⊛ Img;
23  field#0(2)[3] Tb = tent ⊛ border(Img, 0.0);  //field#0(2)[3] Tb = tent ⊛ border(Img, [0.0, 0.0, 0.0]);
24  field#0(2)[3] Tc = tent ⊛ clamp(Img);  field#0(2)[3] Tc = tent ⊛ clamp(Img);
25  field#0(2)[3] Tm = tent ⊛ mirror(Img);  field#0(2)[3] Tm = tent ⊛ mirror(Img);
26  field#0(2)[3] Tw = tent ⊛ wrap(Img);  field#0(2)[3] Tw = tent ⊛ wrap(Img);
27    field#0(2)[3] Tww = tent ⊛ wrap(wrap(Img));  // should be the sams as Tw
28  int{2} sz = size(Img);  int{2} sz = size(Img);
29    
30  strand Sample (vec2 pos)  strand Sample (vec2 pos)
31  {  {
32      output vec3 txtb = nan;      //output vec3 txtb = nan[3];
33      output vec3 txtc = nan;      output vec3 txtc = nan[3];
34      output vec3 txtm = nan;      output vec3 txtm = nan[3];
35      output vec3 txtw = nan;      output vec3 txtw = nan[3];
36        output vec3 txtx = nan[3];
37    
38      update {      update {
39          txtb = Tb(pos);          //txtb = Tb(pos);
40          txtc = Tc(pos);          txtc = Tc(pos);
41          txtm = Tm(pos);          txtm = Tm(pos);
42          txtw = Tw(pos);          txtw = Tw(pos);
43            if (inside(pos, Tww)) {
44                txtx = Tww(pos);
45            } else {
46                txtx = [0.0, 0.0, 1.0];
47            }
48          stabilize;          stabilize;
49      }      }
50  }  }

Legend:
Removed from v.2965  
changed lines
  Added in v.3076

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