Back to index

radiance  4R0+20100331
data.h
Go to the documentation of this file.
00001 /* RCSid $Id: data.h,v 2.7 2003/06/27 06:53:22 greg Exp $ */
00002 /*
00003  * Header for data file loading and computation routines.
00004  */
00005 #ifndef _RAD_DATA_H_
00006 #define _RAD_DATA_H_
00007 #ifdef __cplusplus
00008 extern "C" {
00009 #endif
00010 
00011 #define  MAXDDIM     5             /* maximum data dimensions */
00012 
00013 #define  DATATYPE    float         /* single precision to save space */
00014 #define  DATATY             'f'           /* format for DATATYPE */
00015 
00016 typedef struct datarray {
00017        char  *name;                /* name of our data */
00018        short  type;                /* DATATY, RED, GRN or BLU */
00019        short  nd;                  /* number of dimensions */
00020        struct {
00021               DATATYPE  org, siz;         /* coordinate domain */
00022               int  ne;                    /* number of elements */
00023               DATATYPE  *p;               /* point locations */
00024        } dim[MAXDDIM];                    /* dimension specifications */
00025        union {
00026               DATATYPE  *d;               /* float data */
00027               COLR  *c;                   /* RGB data */
00028        }  arr;                            /* the data */
00029        struct datarray  *next;            /* next array in list */
00030 } DATARRAY;                 /* a data array */
00031 
00032 
00033 extern DATARRAY      *getdata(char *dname);
00034 extern DATARRAY      *getpict(char *pname);
00035 extern void   freedata(DATARRAY *dta);
00036 extern double datavalue(DATARRAY *dp, double *pt);
00037 
00038 
00039 #ifdef __cplusplus
00040 }
00041 #endif
00042 #endif /* _RAD_DATA_H_ */
00043