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 3349 - (view) (download)

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