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

SCM Repository

[diderot] View of /branches/fem/test/border-test.diderot
ViewVC logotype

View of /branches/fem/test/border-test.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2975 - (download) (annotate)
Fri Mar 6 16:31:31 2015 UTC (4 years, 5 months ago) by jhr
Original Path: branches/vis12/test/border-test.diderot
File size: 1055 byte(s)
  working on border controls
/* border-test.diderot
 *
 * COPYRIGHT (c) 2015 The Diderot Project (http://diderot-language.cs.uchicago.edu)
 * All rights reserved.
 *
 * Test the border control features.
 */

input image(2)[3] Img = image("../data/mandrill.nrrd");

//field#0(2)[3] T = tent ⊛ Img;
field#0(2)[3] Tb = tent ⊛ border(Img, [0.0, 0.0, 0.0]);
field#0(2)[3] Tc = tent ⊛ clamp(Img);
field#0(2)[3] Tm = tent ⊛ mirror(Img);
field#0(2)[3] Tw = tent ⊛ wrap(Img);
field#0(2)[3] Tww = tent ⊛ wrap(wrap(Img));  // should be the sams as Tw
int{2} sz = size(Img);

strand Sample (vec2 pos)
{
    output vec3 txtb = zeros[3]; // TODO: change to nan[3]
    output vec3 txtc = zeros[3];
    output vec3 txtm = zeros[3];
    output vec3 txtw = zeros[3];
    output vec3 txtx = zeros[3];

    update {
	txtb = Tb(pos);
	txtc = Tc(pos);
	txtm = Tm(pos);
	txtw = Tw(pos);
        if (inside(pos, Tww)) {
	    txtx = Tww(pos);
	} else {
	    txtx = [0.0, 0.0, 1.0];
	}
	stabilize;
    }
}

initially [ Sample([real(i), real(j)]) | i in -sz{0} .. 2*sz{0}, j in -sz{1} .. 2*sz{1} ];

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