1 |
+ |
/* RCSid $Id$ */ |
2 |
+ |
|
3 |
|
/* |
4 |
< |
================================================================== |
4 |
> |
====================================================================== |
5 |
|
Photon map main header |
6 |
|
|
7 |
|
Roland Schregle (roland.schregle@{hslu.ch, gmail.com}) |
8 |
|
(c) Fraunhofer Institute for Solar Energy Systems, |
9 |
|
(c) Lucerne University of Applied Sciences and Arts, |
10 |
< |
supported by the Swiss National Science Foundation (SNSF, #147053) |
11 |
< |
================================================================== |
10 |
> |
supported by the Swiss National Science Foundation (SNSF, #147053) |
11 |
> |
====================================================================== |
12 |
|
|
13 |
|
$Id$ |
14 |
|
*/ |
17 |
|
#ifndef PMAP_H |
18 |
|
#define PMAP_H |
19 |
|
|
20 |
+ |
#ifndef NIX |
21 |
+ |
#if defined(_WIN32) || defined(_WIN64) |
22 |
+ |
#define NIX 0 |
23 |
+ |
#else |
24 |
+ |
#define NIX 1 |
25 |
+ |
#endif |
26 |
+ |
#endif |
27 |
+ |
|
28 |
|
#include "pmapparm.h" |
29 |
|
#include "pmapdata.h" |
30 |
|
|
31 |
+ |
#ifdef __cplusplus |
32 |
+ |
extern "C" { |
33 |
+ |
#endif |
34 |
|
|
35 |
|
#ifndef min |
36 |
< |
#define min(a, b) ((a) < (b) ? (a) : (b)) |
36 |
> |
#define min(a, b) ((a) < (b) ? (a) : (b)) |
37 |
|
#endif |
38 |
|
|
39 |
|
#ifndef max |
40 |
< |
#define max(a, b) ((a) > (b) ? (a) : (b)) |
40 |
> |
#define max(a, b) ((a) > (b) ? (a) : (b)) |
41 |
|
#endif |
42 |
|
|
43 |
< |
#define sqr(a) ((a) * (a)) |
43 |
> |
#define sqr(a) ((a) * (a)) |
44 |
|
|
45 |
|
/* Average over colour channels */ |
46 |
|
#define colorAvg(col) ((col [0] + col [1] + col [2]) / 3) |
47 |
|
|
48 |
|
/* Macros to test for enabled photon maps */ |
49 |
|
#define photonMapping (globalPmap || preCompPmap || \ |
50 |
< |
causticPmap ||contribPmap) |
51 |
< |
#define causticPhotonMapping (causticPmap) |
52 |
< |
#define directPhotonMapping (directPmap) |
53 |
< |
#define volumePhotonMapping (volumePmap) |
54 |
< |
#define contribPhotonMapping (contribPmap && contribPmap -> srcContrib) |
55 |
< |
|
56 |
< |
|
50 |
> |
causticPmap || contribPmap) |
51 |
> |
#define causticPhotonMapping (causticPmap != NULL) |
52 |
> |
#define directPhotonMapping (directPmap != NULL) |
53 |
> |
#define volumePhotonMapping (volumePmap != NULL) |
54 |
> |
/* #define contribPhotonMapping (contribPmap && contribPmap -> srcContrib) |
55 |
> |
*/ |
56 |
> |
#define contribPhotonMapping (contribPmap) |
57 |
> |
|
58 |
|
|
59 |
|
extern void (*pmapLookup [])(PhotonMap*, RAY*, COLOR); |
60 |
|
/* Photon map lookup functions per type */ |
69 |
|
void cleanUpPmaps (PhotonMap **pmaps); |
70 |
|
/* Trash all photon maps after processing is complete */ |
71 |
|
|
72 |
< |
void distribPhotons (PhotonMap **pmaps); |
72 |
> |
void distribPhotons (PhotonMap **pmaps, unsigned numProc); |
73 |
|
/* Emit photons from light sources and build photon maps for non-NULL |
74 |
|
* entries in photon map array */ |
75 |
|
|
90 |
|
|
91 |
|
void colorNorm (COLOR); |
92 |
|
/* Normalise colour channels to average of 1 */ |
93 |
+ |
|
94 |
+ |
#ifdef __cplusplus |
95 |
+ |
} |
96 |
+ |
#endif |
97 |
|
|
98 |
|
#endif |