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

SCM Repository

[diderot] Annotation of /branches/vis12-cl/rtest/tests/convo2d0-rgb/convo2d0-rgb.diderot
ViewVC logotype

Annotation of /branches/vis12-cl/rtest/tests/convo2d0-rgb/convo2d0-rgb.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3160 - (view) (download)

1 : jhr 1809 /*! \file convo2d0-rgb.diderot
2 :     *
3 :     * \author Gordon Kindlmann
4 :     */
5 : glk 1168
6 : jhr 1809 /*
7 :     * COPYRIGHT (c) 2012 The Diderot Project (http://diderot-language.cs.uchicago.edu)
8 :     * All rights reserved.
9 :     */
10 : glk 1168
11 :     int outSize = 200;
12 :    
13 : jhr 3160 input image(2)[3] img = image("../../data/ddro-115-rgb.nrrd");
14 :     field#0(2)[3] F = tent ⊛ img;
15 :     //field#0(2)[3] F = tent ⊛ image("../../data/ddro-115-rgb.nrrd");
16 : glk 1168
17 :     strand sample (int ui, int vi) {
18 :     real uu = lerp(0.0, 1.0, -0.5, real(ui), real(outSize)-0.5);
19 :     real vv = lerp(0.0, 1.0, -0.5, real(vi), real(outSize)-0.5);
20 :     vec2 pos = [uu, vv];
21 : jhr 3050 output vec3 out = nan[3];
22 : glk 1168
23 :     update {
24 : jhr 1975 out = F(pos) if (inside(pos,F)) else [0, 1, 0];
25 : glk 1168 stabilize;
26 :     }
27 :     }
28 :    
29 :     initially [ sample(ui, vi) | vi in 0..(outSize-1), ui in 0..(outSize-1) ];

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