ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/pmap.h
Revision: 2.10
Committed: Tue Sep 17 16:36:04 2024 UTC (7 months, 1 week ago) by greg
Content type: text/plain
Branch: MAIN
CVS Tags: HEAD
Changes since 2.9: +9 -2 lines
Log Message:
chore: Added extern "C" to headers to avoid C++ name mangling

File Contents

# User Rev Content
1 greg 2.10 /* RCSid $Id: pmap.h,v 2.9 2018/01/24 19:39:05 rschregle Exp $ */
2 rschregle 2.7
3 greg 2.1 /*
4 rschregle 2.8 ======================================================================
5 greg 2.1 Photon map main header
6    
7     Roland Schregle (roland.schregle@{hslu.ch, gmail.com})
8     (c) Fraunhofer Institute for Solar Energy Systems,
9 rschregle 2.3 (c) Lucerne University of Applied Sciences and Arts,
10 rschregle 2.8 supported by the Swiss National Science Foundation (SNSF, #147053)
11     ======================================================================
12 greg 2.1
13 greg 2.10 $Id: pmap.h,v 2.9 2018/01/24 19:39:05 rschregle Exp $
14 greg 2.1 */
15    
16    
17     #ifndef PMAP_H
18     #define PMAP_H
19    
20 rschregle 2.8 #ifndef NIX
21     #if defined(_WIN32) || defined(_WIN64)
22     #define NIX 0
23     #else
24     #define NIX 1
25     #endif
26     #endif
27    
28 greg 2.1 #include "pmapparm.h"
29     #include "pmapdata.h"
30    
31 greg 2.10 #ifdef __cplusplus
32     extern "C" {
33     #endif
34 greg 2.1
35 greg 2.2 #ifndef min
36 rschregle 2.7 #define min(a, b) ((a) < (b) ? (a) : (b))
37 greg 2.2 #endif
38    
39     #ifndef max
40 rschregle 2.7 #define max(a, b) ((a) > (b) ? (a) : (b))
41 greg 2.2 #endif
42    
43 rschregle 2.7 #define sqr(a) ((a) * (a))
44 greg 2.1
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 greg 2.4 causticPmap || contribPmap)
51     #define causticPhotonMapping (causticPmap != NULL)
52     #define directPhotonMapping (directPmap != NULL)
53     #define volumePhotonMapping (volumePmap != NULL)
54 rschregle 2.9 /* #define contribPhotonMapping (contribPmap && contribPmap -> srcContrib)
55     */
56     #define contribPhotonMapping (contribPmap)
57    
58 greg 2.1
59     extern void (*pmapLookup [])(PhotonMap*, RAY*, COLOR);
60     /* Photon map lookup functions per type */
61    
62     void loadPmaps (PhotonMap **pmaps, const PhotonMapParams *params);
63     /* Load photon and set their respective parameters, checking timestamps
64     * relative to octree for possible staleness */
65    
66     void savePmaps (const PhotonMap **pmaps, int argc, char **argv);
67     /* Save all defined photon maps with specified command line */
68    
69     void cleanUpPmaps (PhotonMap **pmaps);
70     /* Trash all photon maps after processing is complete */
71    
72 rschregle 2.7 void distribPhotons (PhotonMap **pmaps, unsigned numProc);
73 greg 2.1 /* Emit photons from light sources and build photon maps for non-NULL
74     * entries in photon map array */
75    
76     void tracePhoton (RAY*);
77     /* Follow photon as it bounces around the scene. Analogon to
78     * raytrace(). */
79    
80     void photonDensity (PhotonMap*, RAY*, COLOR irrad);
81     /* Perform surface density estimate from incoming photon flux at
82     ray's intersection point. Returns irradiance from found photons. */
83    
84     void photonPreCompDensity (PhotonMap *pmap, RAY *r, COLOR irrad);
85     /* Returns precomputed photon density estimate at ray -> rop. */
86    
87     void volumePhotonDensity (PhotonMap*, RAY*, COLOR);
88     /* Perform volume density estimate from incoming photon flux at
89     ray's intersection point. Returns irradiance. */
90    
91     void colorNorm (COLOR);
92     /* Normalise colour channels to average of 1 */
93    
94 greg 2.10 #ifdef __cplusplus
95     }
96     #endif
97    
98 greg 2.1 #endif