ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/pmapray.c
Revision: 2.9
Committed: Sat Mar 23 16:40:52 2024 UTC (7 weeks, 6 days ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 2.8: +5 -5 lines
Log Message:
fix: Needed to move test for it to work!

File Contents

# User Rev Content
1 greg 2.4 #ifndef lint
2 greg 2.9 static const char RCSid[] = "$Id: pmapray.c,v 2.8 2024/03/22 16:54:16 greg Exp $";
3 greg 2.4 #endif
4 rschregle 2.6
5 greg 2.1 /*
6     ==================================================================
7     Photon map interface to RADIANCE raycalls
8    
9     Roland Schregle (roland.schregle@{hslu.ch, gmail.com})
10     (c) Fraunhofer Institute for Solar Energy Systems,
11 rschregle 2.2 (c) Lucerne University of Applied Sciences and Arts,
12     supported by the Swiss National Science Foundation (SNSF, #147053)
13 greg 2.1 ==================================================================
14    
15 greg 2.9 $Id: pmapray.c,v 2.8 2024/03/22 16:54:16 greg Exp $
16 greg 2.1 */
17    
18    
19 greg 2.8 #include "ray.h"
20 greg 2.1 #include "pmapray.h"
21     #include "pmap.h"
22    
23    
24     void ray_init_pmap ()
25     /* Interface to ray_init(); init & load photon maps */
26     {
27 greg 2.9 loadPmaps(photonMaps, pmapParams);
28    
29 greg 2.8 if (NCSAMP > 3 && photonMapping)
30 greg 2.9 error(USER, "hyperspectral photon-mapping currently unsupported");
31 greg 2.1 }
32    
33    
34     void ray_done_pmap ()
35     /* Interface to ray_done(); free photon maps */
36     {
37     cleanUpPmaps(photonMaps);
38     }
39    
40    
41     void ray_save_pmap (RAYPARAMS *rp)
42     /* Interface to ray_save(); save photon map params */
43     {
44     unsigned t;
45    
46     for (t = 0; t < NUM_PMAP_TYPES; t++) {
47 greg 2.3 if (pmapParams [t].fileName)
48     rp -> pmapParams [t].fileName = savqstr(pmapParams [t].fileName);
49    
50 greg 2.1 else rp -> pmapParams [t].fileName = NULL;
51    
52     rp -> pmapParams [t].minGather = pmapParams [t].minGather;
53     rp -> pmapParams [t].maxGather = pmapParams [t].maxGather;
54 greg 2.7 rp -> pmapParams [t].distribTarget = pmapParams [t].distribTarget;
55 greg 2.1 }
56     }
57    
58    
59     void ray_restore_pmap (RAYPARAMS *rp)
60     /* Interface to ray_restore(); restore photon mapping params */
61     {
62     unsigned t;
63    
64     for (t = 0; t < NUM_PMAP_TYPES; t++) {
65     pmapParams [t].fileName = rp -> pmapParams [t].fileName;
66     pmapParams [t].minGather = rp -> pmapParams [t].minGather;
67     pmapParams [t].maxGather = rp -> pmapParams [t].maxGather;
68 greg 2.7 pmapParams [t].distribTarget = rp -> pmapParams [t].distribTarget;
69     }
70     }
71    
72     void ray_defaults_pmap (RAYPARAMS *rp)
73     /* Interface to ray_defaults(); set photon mapping defaults */
74     {
75     unsigned t;
76    
77     for (t = 0; t < NUM_PMAP_TYPES; t++) {
78     rp -> pmapParams [t].fileName = NULL;
79     rp -> pmapParams [t].minGather = 0;
80     rp -> pmapParams [t].maxGather = 0;
81     rp -> pmapParams [t].distribTarget = 0;
82 greg 2.1 }
83     }