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

SCM Repository

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

View of /trunk/test/zslice-rgb.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1115 - (download) (annotate)
Thu May 5 04:42:18 2011 UTC (8 years, 3 months ago) by jhr
File size: 795 byte(s)
  More merging of pure-cfg back into trunk
// to process output:
//
//	unu reshape -i mip.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];

       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