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

SCM Repository

[diderot] View of /branches/charisee/test/zslice-rgb.diderot
ViewVC logotype

View of /branches/charisee/test/zslice-rgb.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2377 - (download) (annotate)
Mon Jun 3 19:41:56 2013 UTC (6 years, 3 months ago) by jhr
File size: 959 byte(s)
  Create new branch for Charisee's Einstein stuff
// to process output:
//
//	unu reshape -i zslice-rgb.txt -s 3 200 200 | unu quantize -b 8 -o zslice-rgb.png

int imgRes = 200;
int dataRes = 110;

field#0(2)[3] RGB= load("../data/txf/2d-bow.nrrd") ⊛ tent;

strand RayCast (int ui, int vi)
{
    int u = ui;
    int v = vi;
    vec2 pos = [lerp(-1.0, 1.0, -0.5, real(ui), real(imgRes)-0.5),
                lerp(-1.0, 1.0, -0.5, real(vi), real(imgRes)-0.5)];
    output vec3 rgb = [0.0,0.0,0.0];

    update
    {
       // How to probe the per-component images
       //rgb = [RR(pos),GG(pos),BB(pos)] if inside(pos,RR) else [0.0,0.0,0.0];

       // How to probe the single RGB image
         rgb = RGB(pos) if inside(pos,RGB) else [0.0,0.0,0.0];
      // rgb = [0.5,0.0,0.0] if inside(pos,RGB) else [0.0,0.0,0.0];
      // rgb = [0.5 + pos[0], 0.0, 0.5 + pos[1]] if inside(pos,RGB) else [0.0,0.0,0.0];

       stabilize;
    }
}

initially [ RayCast(ui, vi) | vi in 0..(imgRes-1), ui in 0..(imgRes-1) ];

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