--- ray/src/rt/data.h 1989/02/02 10:41:13 1.1 +++ ray/src/rt/data.h 2003/06/27 06:53:22 2.7 @@ -1,30 +1,43 @@ -/* Copyright (c) 1986 Regents of the University of California */ - -/* SCCSid "$SunId$ LBL" */ - +/* RCSid $Id: data.h,v 2.7 2003/06/27 06:53:22 greg Exp $ */ /* - * data.h - header file for routines which interpolate data. - * - * 6/4/86 + * Header for data file loading and computation routines. */ +#ifndef _RAD_DATA_H_ +#define _RAD_DATA_H_ +#ifdef __cplusplus +extern "C" { +#endif -#define MAXDIM 8 /* maximum dimensions for data array */ +#define MAXDDIM 5 /* maximum data dimensions */ #define DATATYPE float /* single precision to save space */ +#define DATATY 'f' /* format for DATATYPE */ -#define DSCANF "%f" /* scan format for DATATYPE */ - typedef struct datarray { char *name; /* name of our data */ - int nd; /* number of dimensions */ + short type; /* DATATY, RED, GRN or BLU */ + short nd; /* number of dimensions */ struct { - double org, siz; /* coordinate domain */ + DATATYPE org, siz; /* coordinate domain */ int ne; /* number of elements */ - } dim[MAXDIM]; /* dimension specifications */ - DATATYPE *arr; /* the data */ + DATATYPE *p; /* point locations */ + } dim[MAXDDIM]; /* dimension specifications */ + union { + DATATYPE *d; /* float data */ + COLR *c; /* RGB data */ + } arr; /* the data */ struct datarray *next; /* next array in list */ } DATARRAY; /* a data array */ -extern DATARRAY *getdata(), *getpict(); -extern double datavalue(); +extern DATARRAY *getdata(char *dname); +extern DATARRAY *getpict(char *pname); +extern void freedata(DATARRAY *dta); +extern double datavalue(DATARRAY *dp, double *pt); + + +#ifdef __cplusplus +} +#endif +#endif /* _RAD_DATA_H_ */ +