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