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

SCM Repository

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

View of /branches/vis12-cl/rtest/tests/convo2d0-rgb/convo2d0-rgb.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3050 - (download) (annotate)
Thu Mar 12 13:40:58 2015 UTC (4 years, 5 months ago) by jhr
File size: 651 byte(s)
  updates to OpenCL branch from vis12 branch
/*! \file convo2d0-rgb.diderot
 *
 * \author Gordon Kindlmann
 */

/*
 * COPYRIGHT (c) 2012 The Diderot Project (http://diderot-language.cs.uchicago.edu)
 * All rights reserved.
 */

int outSize = 200;

field#0(2)[3] F = tent ⊛ image("../../data/ddro-115-rgb.nrrd");

strand sample (int ui, int vi) {
   real uu = lerp(0.0, 1.0, -0.5, real(ui), real(outSize)-0.5);
   real vv = lerp(0.0, 1.0, -0.5, real(vi), real(outSize)-0.5);
   vec2 pos = [uu, vv];
   output vec3 out = nan[3];

   update {
      out = F(pos) if (inside(pos,F)) else [0, 1, 0];
      stabilize;
   }
}

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