ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/data.h
Revision: 2.8
Committed: Wed Dec 13 23:26:16 2023 UTC (5 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 2.7: +7 -3 lines
Log Message:
feat(rpict,rvu,rtrace,rcontrib): Added "specdata" and "specpict" pattern primitives

File Contents

# Content
1 /* RCSid $Id: data.h,v 2.7 2003/06/27 06:53:22 greg Exp $ */
2 /*
3 * Header for data file loading and computation routines.
4 */
5 #ifndef _RAD_DATA_H_
6 #define _RAD_DATA_H_
7 #ifdef __cplusplus
8 extern "C" {
9 #endif
10
11 #define MAXDDIM 5 /* maximum data dimensions */
12
13 #define DATATYPE float /* single precision to save space */
14 #define DATATY 'f' /* format for DATATYPE */
15 #define SPECTY 'c' /* format for SCOLR */
16
17 typedef struct datarray {
18 char *name; /* name of our data */
19 short type; /* DATATY, SPECTY, RED, GRN or BLU */
20 short nd; /* number of dimensions */
21 struct {
22 DATATYPE org, siz; /* coordinate domain */
23 int ne; /* number of elements */
24 DATATYPE *p; /* point locations */
25 } dim[MAXDDIM]; /* dimension specifications */
26 union {
27 DATATYPE *d; /* float data */
28 COLR *c; /* RGBE data */
29 uby8 *s; /* spectral data */
30 void *p; /* generic pointer */
31 } arr; /* the data */
32 struct datarray *next; /* next array in list */
33 } DATARRAY; /* a data array */
34
35
36 extern DATARRAY *getdata(char *dname);
37 extern DATARRAY *getpict(char *pname);
38 extern DATARRAY *getspec(char *sname);
39 extern void freedata(DATARRAY *dta);
40 extern double datavalue(DATARRAY *dp, double *pt);
41
42
43 #ifdef __cplusplus
44 }
45 #endif
46 #endif /* _RAD_DATA_H_ */
47