1 |
/* |
2 |
================================================================== |
3 |
Photon map interface to RADIANCE raycalls |
4 |
|
5 |
Roland Schregle (roland.schregle@{hslu.ch, gmail.com}) |
6 |
(c) Fraunhofer Institute for Solar Energy Systems, |
7 |
(c) Lucerne University of Applied Sciences and Arts, |
8 |
supported by the Swiss National Science Foundation (SNSF, #147053) |
9 |
================================================================== |
10 |
|
11 |
$Id: pmapray.c,v 2.2 2015/05/08 13:20:23 rschregle Exp $ |
12 |
*/ |
13 |
|
14 |
|
15 |
#include "pmapray.h" |
16 |
#include "pmap.h" |
17 |
|
18 |
|
19 |
void ray_init_pmap () |
20 |
/* Interface to ray_init(); init & load photon maps */ |
21 |
{ |
22 |
loadPmaps(photonMaps, pmapParams); |
23 |
} |
24 |
|
25 |
|
26 |
void ray_done_pmap () |
27 |
/* Interface to ray_done(); free photon maps */ |
28 |
{ |
29 |
cleanUpPmaps(photonMaps); |
30 |
} |
31 |
|
32 |
|
33 |
void ray_save_pmap (RAYPARAMS *rp) |
34 |
/* Interface to ray_save(); save photon map params */ |
35 |
{ |
36 |
unsigned t; |
37 |
|
38 |
for (t = 0; t < NUM_PMAP_TYPES; t++) { |
39 |
if (pmapParams [t].fileName) |
40 |
rp -> pmapParams [t].fileName = savqstr(pmapParams [t].fileName); |
41 |
|
42 |
else rp -> pmapParams [t].fileName = NULL; |
43 |
|
44 |
rp -> pmapParams [t].minGather = pmapParams [t].minGather; |
45 |
rp -> pmapParams [t].maxGather = pmapParams [t].maxGather; |
46 |
} |
47 |
} |
48 |
|
49 |
|
50 |
void ray_restore_pmap (RAYPARAMS *rp) |
51 |
/* Interface to ray_restore(); restore photon mapping params */ |
52 |
{ |
53 |
unsigned t; |
54 |
|
55 |
for (t = 0; t < NUM_PMAP_TYPES; t++) { |
56 |
pmapParams [t].fileName = rp -> pmapParams [t].fileName; |
57 |
pmapParams [t].minGather = rp -> pmapParams [t].minGather; |
58 |
pmapParams [t].maxGather = rp -> pmapParams [t].maxGather; |
59 |
} |
60 |
} |