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

SCM Repository

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

View of /branches/pure-cfg/test/zslice-rgb.diderot

Parent Directory Parent Directory | Revision Log Revision Log


Revision 916 - (download) (annotate)
Thu Apr 21 19:13:54 2011 UTC (8 years, 5 months ago) by glk
File size: 1151 byte(s)
new probe syntax
// 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;

// These 3 lines work for probing the per-component images
//image(2)[] imgR=load("../data/hue-0.nrrd"); field#0(2)[] RR=imgR ⊛ tent;
//image(2)[] imgG=load("../data/hue-1.nrrd"); field#0(2)[] GG=imgG ⊛ tent;
//image(2)[] imgB=load("../data/hue-2.nrrd"); field#0(2)[] BB=imgB ⊛ tent;

// This should work for probing the RGB image
image(2)[3] imgRGB=load("../data/hue.nhdr"); field#0(2)[3] RGB=imgRGB ⊛ 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