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 2965 - (download) (annotate)
Thu Mar 5 18:25:43 2015 UTC (4 years, 5 months ago) by jhr
Original Path: branches/vis12/test/border-test.diderot
File size: 792 byte(s)
  change test to work on RGB images
/* 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/mandril.nrrd");

//field#0(2)[3] T = tent ⊛ Img;
field#0(2)[3] Tb = tent ⊛ border(Img, 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);
int{2} sz = size(Img);

strand Sample (vec2 pos)
{
    output vec3 txtb = nan;
    output vec3 txtc = nan;
    output vec3 txtm = nan;
    output vec3 txtw = nan;

    update {
	txtb = Tb(pos);
	txtc = Tc(pos);
	txtm = Tm(pos);
	txtw = Tw(pos);
	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