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

SCM Repository

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

Annotation of /branches/vis15/src/tests/rtest/tests/convo2d0-rgb/convo2d0-rgb.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4497 - (view) (download)

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