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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1975 - (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 1928 field#0(2)[3] F = tent ⊛ image("../../data/ddro-115-rgb.nrrd");
14 : glk 1168
15 :     strand sample (int ui, int vi) {
16 :     real uu = lerp(0.0, 1.0, -0.5, real(ui), real(outSize)-0.5);
17 :     real vv = lerp(0.0, 1.0, -0.5, real(vi), real(outSize)-0.5);
18 :     vec2 pos = [uu, vv];
19 : jhr 1809 output vec3 out = [nan,nan,nan];
20 : glk 1168
21 :     update {
22 : jhr 1975 out = F(pos) if (inside(pos,F)) else [0, 1, 0];
23 : glk 1168 stabilize;
24 :     }
25 :     }
26 :    
27 :     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