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

1 : jhr 1809 /*! \file convo2d0-rgb.diderot
2 :     *
3 :     * \author Gordon Kindlmann
4 :     */
5 : glk 1168
6 : jhr 1809 /*
7 : jhr 3291 * 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 1928 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 3038 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