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/cmap/cmap.diderot
ViewVC logotype

Annotation of /branches/vis15/src/tests/rtest/tests/cmap/cmap.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4497 - (view) (download)

1 : jhr 4209 /* cmap.diderot
2 :     *
3 :     * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
4 :     *
5 :     * COPYRIGHT (c) 2016 The University of Chicago
6 :     * All rights reserved.
7 :     *
8 :     * Test the probing of a 1D vector field (i.e., color map).
9 :     */
10 :    
11 :     field#0(1)[3] cmap = image("../../data/isobow-cmap.nrrd") ⊛ tent;
12 :    
13 :     strand CMap (vec2 pos) {
14 :     output vec3 out = [0,0,0];
15 :    
16 :     update {
17 :     real x = 0.5 * (pos[0] + pos[1]);
18 :     // if (inside (x, cmap)) {
19 :     out = cmap(x);
20 :     // }
21 :     stabilize;
22 :     }
23 :     }
24 :    
25 : jhr 4497 //create_array { CMap([lerp(0, 1, 1, xi, 200), lerp(0, 1, 1, yi, 200)]) | xi in 1..200, yi in 1..200 }
26 : jhr 4209 initially [ CMap([lerp(0, 1, 1, xi, 200), lerp(0, 1, 1, yi, 200)]) | xi in 1..200, yi in 1..200 ];

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