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