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

SCM Repository

[diderot] View of /branches/ein16/synth/t2/unary_d2.ddro
ViewVC logotype

View of /branches/ein16/synth/t2/unary_d2.ddro

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3874 - (download) (annotate)
Wed May 18 16:45:54 2016 UTC (3 years, 4 months ago) by cchiw
File size: 801 byte(s)
added some binary operators for 2-d
field#1(2)[] F = ctmr ⊛ image("data/orig.nrrd");// SCALARIN
field#1(2)[2] F = ctmr ⊛ image("data/orig.nrrd");// VEC2IN
input int outSize = 50;
input real scale = 1;

strand sample(int idx0, int idx1) {

    real xx = lerp(-0.5, 0.5, -0.5, real(idx0), real(outSize)-0.5);
    real yy = lerp(-0.5, 0.5, -0.5, real(idx1), real(outSize)-0.5);

   vec2 pos = [xx, yy];
   output vec2 out = [0.0, 0.0]; //VEC2OUT
   output real out = 0.0; //SCALAROUT
   update {
        if(inside(pos, F)){
        out = F(pos); // PROBE
        out = scale*F(pos); // SCALE
        out = - F(pos); // NEG
        out = ∇F(pos); // GRADIENT

        }
      stabilize;
   }
}
initially [ sample(idx0, idx1)
            | idx1 in 0..(outSize-1),  // slowest axis
              idx0 in 0..(outSize-1)]; // fastest axis

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