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

SCM Repository

[diderot] View of /branches/vis12/test/fields.diderot
ViewVC logotype

View of /branches/vis12/test/fields.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1927 - (download) (annotate)
Sat Jun 23 18:09:16 2012 UTC (7 years, 1 month ago) by jhr
File size: 986 byte(s)
  converting to use "image" instead of "load" for image nrrd loading
// fields
//
// documents bugs in field expressions
// process output with:
// unu reshape -i mip.txt -s 2 300 200 | unu pad -min 0 0 0 -max 2 M M -b wrap | unu quantize -b 8  -o fields.png


int imgSizeX = 300;
int imgSizeY = 200;

image(2)[2] Vimg = image("../data/vorttest.nrrd");

field#1(2)[2] Vpos = Vimg ⊛ ctmr;
field#1(2)[2] V1 = -Vpos;

field#1(2)[2] V2 = 1.0*(Vimg ⊛ ctmr);

field#1(2)[2] V3 = Vpos;

field#1(2)[2] V4 = Vpos + Vpos;

//image(2)[] Rimg = image("../data/vorttest-rand.nrrd");
field#0(2)[] R = image("../data/vorttest-rand.nrrd") ⊛ 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];
    output vec2 v = [0.0,0.0];

    update {
        v = (V1(pos) + V2(pos) + V3(pos) + V4(pos)) * R(pos);
        v = -V1(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