54 |
|
#include "lookup.h" |
55 |
|
#include <stdint.h> |
56 |
|
|
57 |
– |
|
58 |
– |
|
57 |
|
/* Primary photon ray for light source contributions */ |
58 |
|
typedef struct { |
59 |
|
int16 srcIdx; /* Index of emitting light source */ |
117 |
|
PhotonPrimaryIdx primary; /* Index to primary ray */ |
118 |
|
} Photon; |
119 |
|
|
120 |
+ |
/* Define search queue and underlying data struct types */ |
121 |
+ |
#ifdef PMAP_OOC |
122 |
+ |
#include "pmapooc.h" |
123 |
+ |
#else |
124 |
+ |
#include "pmapkdt.h" |
125 |
+ |
#endif |
126 |
|
|
127 |
|
|
128 |
|
/* Define PMAP_FLOAT_FLUX to store photon flux as floats instead of |
146 |
|
|
147 |
|
/* Forward declaration */ |
148 |
|
struct PhotonMap; |
145 |
– |
|
146 |
– |
|
147 |
– |
/* Define search queue and underlying data struct types */ |
148 |
– |
#ifdef PMAP_OOC |
149 |
– |
#include "pmapooc.h" |
150 |
– |
#else |
151 |
– |
#include "pmapkdt.h" |
152 |
– |
#endif |
149 |
|
|
150 |
|
|
151 |
|
/* Mean size of heapfile write buffer, in number of photons */ |
265 |
|
#define isContribPmap(p) ((p) -> type == PMAP_TYPE_CONTRIB) |
266 |
|
#define isVolumePmap(p) ((p) -> type == PMAP_TYPE_VOLUME) |
267 |
|
|
268 |
+ |
#ifdef __cplusplus |
269 |
+ |
extern "C" { |
270 |
+ |
#endif |
271 |
|
|
273 |
– |
|
272 |
|
void initPhotonMap (PhotonMap *pmap, PhotonMapType t); |
273 |
|
/* Initialise empty photon map of specified type */ |
274 |
|
|
315 |
|
are placed search queue starting with the furthest photon at pmap -> |
316 |
|
squeue.node, and pmap -> squeue.tail being the number actually found. */ |
317 |
|
|
318 |
< |
void find1Photon (PhotonMap *pmap, const RAY *ray, Photon *photon); |
319 |
< |
/* Finds single closest photon to ray -> rop with similar normal. |
320 |
< |
Returns NULL if none found. */ |
318 |
> |
Photon *find1Photon (PhotonMap *pmap, const RAY *ray, Photon *photon); |
319 |
> |
/* Find single closest photon to ray -> rop with similar normal. |
320 |
> |
Return NULL if none found, else the supplied Photon* buffer, |
321 |
> |
indicating that it contains a valid photon. */ |
322 |
|
|
323 |
|
void getPhoton (PhotonMap *pmap, PhotonIdx idx, Photon *photon); |
324 |
|
/* Retrieve photon referenced by idx from pmap -> store */ |
332 |
|
|
333 |
|
void deletePhotons (PhotonMap*); |
334 |
|
/* Free dem mammaries... */ |
335 |
+ |
|
336 |
+ |
#ifdef __cplusplus |
337 |
+ |
} |
338 |
+ |
#endif |
339 |
|
|
340 |
|
#endif |