| 1 |
+ |
#ifndef lint |
| 2 |
+ |
static const char RCSid[] = "$Id$"; |
| 3 |
+ |
#endif |
| 4 |
+ |
|
| 5 |
|
/* |
| 6 |
|
================================================================== |
| 7 |
|
Photon map interface to RADIANCE raycalls |
| 16 |
|
*/ |
| 17 |
|
|
| 18 |
|
|
| 19 |
+ |
#include "ray.h" |
| 20 |
|
#include "pmapray.h" |
| 21 |
|
#include "pmap.h" |
| 22 |
|
|
| 25 |
|
/* Interface to ray_init(); init & load photon maps */ |
| 26 |
|
{ |
| 27 |
|
loadPmaps(photonMaps, pmapParams); |
| 28 |
+ |
|
| 29 |
+ |
if (NCSAMP > 3 && photonMapping) |
| 30 |
+ |
error(USER, "hyperspectral photon-mapping currently unsupported"); |
| 31 |
|
} |
| 32 |
|
|
| 33 |
|
|
| 44 |
|
unsigned t; |
| 45 |
|
|
| 46 |
|
for (t = 0; t < NUM_PMAP_TYPES; t++) { |
| 47 |
< |
if (pmapParams [t].fileName) { |
| 48 |
< |
rp -> pmapParams [t].fileName = |
| 49 |
< |
(char*)malloc(strlen(pmapParams [t].fileName)); |
| 42 |
< |
strcpy(rp -> pmapParams [t].fileName, pmapParams [t].fileName); |
| 43 |
< |
} |
| 47 |
> |
if (pmapParams [t].fileName) |
| 48 |
> |
rp -> pmapParams [t].fileName = savqstr(pmapParams [t].fileName); |
| 49 |
> |
|
| 50 |
|
else rp -> pmapParams [t].fileName = NULL; |
| 51 |
|
|
| 52 |
|
rp -> pmapParams [t].minGather = pmapParams [t].minGather; |
| 53 |
|
rp -> pmapParams [t].maxGather = pmapParams [t].maxGather; |
| 54 |
+ |
rp -> pmapParams [t].distribTarget = pmapParams [t].distribTarget; |
| 55 |
|
} |
| 56 |
|
} |
| 57 |
|
|
| 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 |
+ |
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 |
|
} |
| 83 |
|
} |