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

File Contents

# User Rev Content
1 greg 2.11 /* RCSid $Id: pmapparm.h,v 2.10 2021/04/14 11:26:25 rschregle Exp $ */
2 rschregle 2.7
3 greg 2.1 /*
4 rschregle 2.7 ======================================================================
5     Parameters for photon map generation and rendering; used by mkpmap
6     and rpict/rvu/rtrace.
7 greg 2.1
8     Roland Schregle (roland.schregle@{hslu.ch, gmail.com}
9     (c) Fraunhofer Institute for Solar Energy Systems,
10 rschregle 2.10 supported by the German Research Foundation
11     (DFG LU-204/10-2, "Fassadenintegrierte Regelsysteme" (FARESYS))
12 rschregle 2.2 (c) Lucerne University of Applied Sciences and Arts,
13 rschregle 2.10 supported by the Swiss National Science Foundation
14     (SNSF #147053, "Daylight Redirecting Components")
15 rschregle 2.7 ======================================================================
16    
17 greg 2.11 $Id: pmapparm.h,v 2.10 2021/04/14 11:26:25 rschregle Exp $
18 greg 2.1 */
19    
20    
21     #ifndef PMAPPARAMS_H
22     #define PMAPPARAMS_H
23    
24     #include "pmaptype.h"
25    
26 greg 2.11 #ifdef __cplusplus
27     extern "C" {
28     #endif
29    
30 greg 2.1 /* Struct for passing params per photon map from rpict/rtrace/rvu */
31     typedef struct {
32     char *fileName; /* Photon map file */
33     unsigned minGather, maxGather; /* Num photons to gather */
34     unsigned long distribTarget; /* Num photons to store */
35     } PhotonMapParams;
36 rschregle 2.8
37 rschregle 2.10 /* Region of interest */
38     typedef struct {
39     /* siz [1], siz [2] <= 0 --> sphere, else rectangle */
40     float pos [3], siz [3];
41 rschregle 2.8 } PhotonMapROI;
42 rschregle 2.10
43     #define PMAP_ROI_ISSPHERE(roi) ((roi)->siz[1] <= 0 && (roi)->siz[2] <= 0)
44     #define PMAP_ROI_SETSPHERE(roi) ((roi)->siz[1] = (roi)->siz[2] = -1)
45 greg 2.1
46    
47     extern PhotonMapParams pmapParams [NUM_PMAP_TYPES];
48    
49     /* Macros for type specific photon map parameters */
50     #define globalPmapParams (pmapParams [PMAP_TYPE_GLOBAL])
51     #define preCompPmapParams (pmapParams [PMAP_TYPE_PRECOMP])
52     #define causticPmapParams (pmapParams [PMAP_TYPE_CAUSTIC])
53     #define volumePmapParams (pmapParams [PMAP_TYPE_VOLUME])
54     #define directPmapParams (pmapParams [PMAP_TYPE_DIRECT])
55     #define contribPmapParams (pmapParams [PMAP_TYPE_CONTRIB])
56    
57    
58 rschregle 2.7 extern float pdfSamples, preDistrib, finalGather,
59 rschregle 2.9 gatherTolerance, maxDistFix, pmapMaxDist,
60     photonMaxDist;
61 rschregle 2.7 extern unsigned long photonHeapSizeInc, photonMaxBounce;
62 rschregle 2.8 extern unsigned photonRepTime, maxPreDistrib, defaultGather,
63     verbose;
64    
65     extern unsigned pmapNumROI;
66     extern PhotonMapROI *pmapROI;
67 greg 2.1
68 rschregle 2.7 #ifdef PMAP_OOC
69     extern float pmapCachePageSize;
70     extern unsigned long pmapCacheSize;
71     #endif
72    
73    
74 greg 2.1 struct PhotonMap;
75    
76     int setPmapParam (struct PhotonMap **pm, const PhotonMapParams *parm);
77     /* Allocate photon map and set its parameters from parm */
78    
79     unsigned long parseMultiplier (const char *num);
80     /* Evaluate numeric parameter string with optional multiplier suffix
81     (G = 10^9, M = 10^6, K = 10^3). Returns 0 if parsing fails. */
82 greg 2.11
83     #ifdef __cplusplus
84     }
85     #endif
86    
87 greg 2.1 #endif