ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/rt/data.h
(Generate patch)

Comparing ray/src/rt/data.h (file contents):
Revision 1.2 by greg, Tue Apr 3 17:24:33 1990 UTC vs.
Revision 2.9 by greg, Tue Mar 12 16:54:51 2024 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1986 Regents of the University of California */
2 <
3 < /* SCCSid "$SunId$ LBL" */
4 <
1 > /* RCSid $Id$ */
2   /*
3 < *  data.h - header file for routines which interpolate data.
7 < *
8 < *     6/4/86
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  MAXDIM         8               /* maximum dimensions for data array */
11 > #define  MAXDDIM        6               /* 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  
15 #define  DSCANF         "%f"            /* scan format for DATATYPE */
16
17   typedef struct datarray {
18 +        struct datarray  *next;         /* next array in list */
19          char  *name;                    /* name of our data */
20 <        int  nd;                        /* number of dimensions */
21 <        struct {
22 <                double  org, siz;               /* coordinate domain */
20 >        short  type;                    /* DATATY, SPECTY, RED, GRN or BLU */
21 >        short  nd;                      /* number of dimensions */
22 >        union {
23 >                DATATYPE  *d;                   /* float data */
24 >                COLR  *c;                       /* RGBE data */
25 >                uby8  *s;                       /* spectral data */
26 >                void  *p;                       /* generic pointer */
27 >        }  arr;                         /* the data */
28 >        struct dadim {                  /* put this last */
29 >                DATATYPE  *p;                   /* point locations */
30 >                DATATYPE  org, siz;             /* coordinate domain */
31                  int  ne;                        /* number of elements */
32 <                double  *p;                     /* point locations */
24 <        } dim[MAXDIM];                  /* dimension specifications */
25 <        DATATYPE  *arr;                 /* the data */
26 <        struct datarray  *next;         /* next array in list */
32 >        } dim[MAXDDIM];                 /* dimension specifications */
33   } DATARRAY;                     /* a data array */
34  
35 < extern DATARRAY  *getdata(), *getpict();
35 > extern DATARRAY *getdata(char *dname);
36 > extern DATARRAY *getpict(char *pname);
37 > extern DATARRAY *getspec(char *sname);
38 > extern void     freedata(DATARRAY *dta);
39 > extern double   datavalue(DATARRAY *dp, double *pt);
40 > /* release datavector() pointer with free() not freedata() */
41 > extern DATARRAY *datavector(DATARRAY *dp, double *pt);
42  
43 < extern double  datavalue();
43 > #ifdef __cplusplus
44 > }
45 > #endif
46 > #endif /* _RAD_DATA_H_ */
47 >

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines