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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 916 - (view) (download)

1 : jhr 880 // to process output:
2 :     //
3 : jhr 882 // unu reshape -i mip.txt -s 3 200 200 | unu quantize -b 8 -o zslice-rgb.png
4 : glk 875
5 :     int imgRes = 200;
6 :     int dataRes = 110;
7 :    
8 :     // These 3 lines work for probing the per-component images
9 : jhr 880 //image(2)[] imgR=load("../data/hue-0.nrrd"); field#0(2)[] RR=imgR ⊛ tent;
10 :     //image(2)[] imgG=load("../data/hue-1.nrrd"); field#0(2)[] GG=imgG ⊛ tent;
11 :     //image(2)[] imgB=load("../data/hue-2.nrrd"); field#0(2)[] BB=imgB ⊛ tent;
12 : glk 875
13 :     // This should work for probing the RGB image
14 : jhr 880 image(2)[3] imgRGB=load("../data/hue.nhdr"); field#0(2)[3] RGB=imgRGB ⊛ tent;
15 : glk 875
16 :     strand RayCast (int ui, int vi)
17 :     {
18 : jhr 898 int u = ui;
19 :     int v = vi;
20 : glk 875 vec2 pos = [lerp(-1.0, 1.0, -0.5, real(ui), real(imgRes)-0.5),
21 :     lerp(-1.0, 1.0, -0.5, real(vi), real(imgRes)-0.5)];
22 :     output vec3 rgb = [0.0,0.0,0.0];
23 :    
24 :     update
25 :     {
26 :    
27 :     // How to probe the per-component images
28 : glk 916 //rgb = [RR(pos),GG(pos),BB(pos)] if inside(pos,RR) else [0.0,0.0,0.0];
29 : glk 875
30 :     // How to probe the single RGB image
31 : glk 916 rgb = RGB(pos) if inside(pos,RGB) else [0.0,0.0,0.0];
32 : glk 875
33 :     stabilize;
34 :     }
35 :     }
36 :    
37 :     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