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, 1 week 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

# Content
1 /* RCSid $Id: pmapparm.h,v 2.10 2021/04/14 11:26:25 rschregle Exp $ */
2
3 /*
4 ======================================================================
5 Parameters for photon map generation and rendering; used by mkpmap
6 and rpict/rvu/rtrace.
7
8 Roland Schregle (roland.schregle@{hslu.ch, gmail.com}
9 (c) Fraunhofer Institute for Solar Energy Systems,
10 supported by the German Research Foundation
11 (DFG LU-204/10-2, "Fassadenintegrierte Regelsysteme" (FARESYS))
12 (c) Lucerne University of Applied Sciences and Arts,
13 supported by the Swiss National Science Foundation
14 (SNSF #147053, "Daylight Redirecting Components")
15 ======================================================================
16
17 $Id: pmapparm.h,v 2.10 2021/04/14 11:26:25 rschregle Exp $
18 */
19
20
21 #ifndef PMAPPARAMS_H
22 #define PMAPPARAMS_H
23
24 #include "pmaptype.h"
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29
30 /* 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
37 /* Region of interest */
38 typedef struct {
39 /* siz [1], siz [2] <= 0 --> sphere, else rectangle */
40 float pos [3], siz [3];
41 } PhotonMapROI;
42
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
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 extern float pdfSamples, preDistrib, finalGather,
59 gatherTolerance, maxDistFix, pmapMaxDist,
60 photonMaxDist;
61 extern unsigned long photonHeapSizeInc, photonMaxBounce;
62 extern unsigned photonRepTime, maxPreDistrib, defaultGather,
63 verbose;
64
65 extern unsigned pmapNumROI;
66 extern PhotonMapROI *pmapROI;
67
68 #ifdef PMAP_OOC
69 extern float pmapCachePageSize;
70 extern unsigned long pmapCacheSize;
71 #endif
72
73
74 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
83 #ifdef __cplusplus
84 }
85 #endif
86
87 #endif