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 1052 - (download) (annotate)
Tue May 3 17:34:57 2011 UTC (8 years, 8 months ago) by glk
File size: 814 byte(s)
vector field convolution works now
// 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;

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