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 880 - (view) (download)

1 : jhr 880 // to process output:
2 :     //
3 :     // unu reshape -i mip.txt -s 3 200 200 | unu quantize -b 8 -o
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 :     vec2 pos = [lerp(-1.0, 1.0, -0.5, real(ui), real(imgRes)-0.5),
19 :     lerp(-1.0, 1.0, -0.5, real(vi), real(imgRes)-0.5)];
20 :     output vec3 rgb = [0.0,0.0,0.0];
21 :    
22 :     update
23 :     {
24 :    
25 :     // How to probe the per-component images
26 :     //rgb = [RR@pos,GG@pos,BB@pos] if inside(pos,RR) else [0.0,0.0,0.0];
27 :    
28 :     // How to probe the single RGB image
29 :     rgb = RGB@pos if inside(pos,RGB) else [0.0,0.0,0.0];
30 :    
31 :     stabilize;
32 :     }
33 :     }
34 :    
35 :     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