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