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

SCM Repository

[diderot] View of /trunk/test/uninit.diderot
ViewVC logotype

View of /trunk/test/uninit.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2636 - (download) (annotate)
Tue May 27 16:18:36 2014 UTC (4 years, 9 months ago) by jhr
File size: 1227 byte(s)
  Merging changes from vis12 branch (via staging).  The main change is the new
  syntax for inputs (especially image inputs).

int imgSizeX = 300;
int imgSizeY = 200;

image(2)[2] Vimg = image("../data/vorttest.nrrd");
field#1(2)[2] V = Vimg ⊛ ctmr;
image(2)[] Rimg = image("../data/vorttest-rand.nrrd");
field#0(2)[] R = Rimg ⊛ tent;

strand LIC (int xi, int yi) {
    real xx = lerp(0.0, 3.0, -0.5, real(xi), real(imgSizeX)-0.5);
    real yy = lerp(0.0, 2.0, -0.5, real(yi), real(imgSizeY)-0.5);
    vec2 pos = [xx,yy];
    // HEY (want) the errors due to not initializing variables are
    // pretty cryptic.  The line "output vec2 blah" here causes:
    //  [uninit.diderot:28.18] Error: syntax error; try substituting "{" for ";"
    //  [uninit.diderot:24.21] Error: syntax error; try deleting "; update { ID"
    //  uncaught exception Fail [Fail: Error in compiling uninit.diderot]
    //    raised at driver/main.sml:31.39-31.76
    // which is cryptic in part because line ?? is the "stabilize;" line,
    // while line ?? is in fact the following problem line, but 
    // there's nothing about a lack of initialization.
    output vec2 blah;       // should be, e.g. output vec2 blah = [0.0,0.0];

    update {
        blah = V(pos);
        stabilize;
    }
}

initially [ LIC(xi, yi) | yi in 0..(imgSizeY-1), xi in 0..(imgSizeX-1) ];

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