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

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