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.1 2015/02/24 19:39:27 greg 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 = |
41 |
(char*)malloc(strlen(pmapParams [t].fileName)); |
42 |
strcpy(rp -> pmapParams [t].fileName, pmapParams [t].fileName); |
43 |
} |
44 |
else rp -> pmapParams [t].fileName = NULL; |
45 |
|
46 |
rp -> pmapParams [t].minGather = pmapParams [t].minGather; |
47 |
rp -> pmapParams [t].maxGather = pmapParams [t].maxGather; |
48 |
} |
49 |
} |
50 |
|
51 |
|
52 |
void ray_restore_pmap (RAYPARAMS *rp) |
53 |
/* Interface to ray_restore(); restore photon mapping params */ |
54 |
{ |
55 |
unsigned t; |
56 |
|
57 |
for (t = 0; t < NUM_PMAP_TYPES; t++) { |
58 |
pmapParams [t].fileName = rp -> pmapParams [t].fileName; |
59 |
pmapParams [t].minGather = rp -> pmapParams [t].minGather; |
60 |
pmapParams [t].maxGather = rp -> pmapParams [t].maxGather; |
61 |
} |
62 |
} |