ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/pmapio.h
Revision: 2.8
Committed: Thu Feb 18 17:08:50 2021 UTC (3 years, 3 months ago) by rschregle
Content type: text/plain
Branch: MAIN
CVS Tags: rad5R4, HEAD
Changes since 2.7: +10 -4 lines
Log Message:
fix(mkpmap,pmapdump): Made pmap files (hopefully) more portable by
forcing numPhotons to fixed size irrespective of platform (possibly with 0-padding)

File Contents

# User Rev Content
1 rschregle 2.8 /* RCSid $Id: pmapio.h,v 2.7 2018/12/07 20:07:41 rschregle Exp $ */
2 rschregle 2.6
3 greg 2.1 /*
4 rschregle 2.6 ======================================================================
5 rschregle 2.8 Photon map portable file I/O
6 greg 2.1
7     Roland Schregle (roland.schregle@{hslu.ch, gmail.com})
8     (c) Fraunhofer Institute for Solar Energy Systems,
9 rschregle 2.8 supported by the German Research Foundation
10     (DFG LU-204/10-2, "Fassadenintegrierte Regelsysteme FARESYS")
11 rschregle 2.2 (c) Lucerne University of Applied Sciences and Arts,
12 rschregle 2.8 supported by the Swiss National Science Foundation
13     (SNSF #147053, "Daylight Redirecting Components")
14 rschregle 2.6 ======================================================================
15 greg 2.1
16 rschregle 2.8 $Id: pmapio.h,v 2.7 2018/12/07 20:07:41 rschregle Exp $
17 greg 2.1 */
18    
19    
20     #ifndef PMAPIO_H
21     #define PMAPIO_H
22    
23     #include "pmapdata.h"
24 rschregle 2.6
25    
26     /* File format version with feature suffix */
27 rschregle 2.7 #define PMAP_FILEVER_MAJ "3.1"
28 rschregle 2.6
29     #ifdef PMAP_OOC
30     #define PMAP_FILEVER_TYP "o"
31     #else
32     #define PMAP_FILEVER_TYP "k"
33     #endif
34    
35     #ifdef PMAP_FLOAT_FLUX
36     #define PMAP_FILEVER_FLX "f"
37     #else
38     #define PMAP_FILEVER_FLX ""
39     #endif
40    
41     #ifdef PMAP_PRIMARYPOS
42 rschregle 2.7 #define PMAP_FILEVER_PRIPOS "P"
43 rschregle 2.6 #else
44 rschregle 2.7 #define PMAP_FILEVER_PRIPOS ""
45     #endif
46    
47     #ifdef PMAP_PRIMARYDIR
48     #define PMAP_FILEVER_PRIDIR "D"
49     #else
50     #define PMAP_FILEVER_PRIDIR ""
51 rschregle 2.6 #endif
52    
53     #define PMAP_FILEVER (PMAP_FILEVER_MAJ PMAP_FILEVER_TYP \
54 rschregle 2.7 PMAP_FILEVER_FLX PMAP_FILEVER_PRIPOS \
55     PMAP_FILEVER_PRIDIR)
56 greg 2.1
57 rschregle 2.8 /* Maximum portable size of a long int in photon map file */
58     #define PMAP_LONGSIZE 8
59    
60 greg 2.1
61     void savePhotonMap (const PhotonMap *pmap, const char *fname,
62 greg 2.3 int argc, char **argv);
63 greg 2.1 /* Save portable photon map of specified type to filename,
64     along with the corresponding command line. */
65    
66     PhotonMapType loadPhotonMap (PhotonMap *pmap, const char* fname);
67     /* Load portable photon map from specified filename, and return photon
68     * map type as identified from file header. */
69    
70     #endif
71 rschregle 2.7