--- ray/src/common/view.h 2003/02/25 02:47:22 2.8 +++ ray/src/common/view.h 2005/01/18 00:33:16 2.17 @@ -1,15 +1,19 @@ -/* RCSid $Id: view.h,v 2.8 2003/02/25 02:47:22 greg Exp $ */ +/* RCSid $Id: view.h,v 2.17 2005/01/18 00:33:16 greg Exp $ */ /* * view.h - header file for image generation. * - * Include after fvect.h + * Include after stdio.h and rtmath.h * Includes resolu.h */ +#ifndef _RAD_VIEW_H_ +#define _RAD_VIEW_H_ -#include "copyright.h" - #include "resolu.h" +#ifdef __cplusplus +extern "C" { +#endif + /* view types */ #define VT_PER 'v' /* perspective */ #define VT_PAR 'l' /* parallel */ @@ -22,6 +26,7 @@ typedef struct { FVECT vp; /* view origin */ FVECT vdir; /* view direction */ FVECT vup; /* view up */ + double vdist; /* view distance */ double horiz; /* horizontal view size */ double vert; /* vertical view size */ double hoff; /* horizontal image offset */ @@ -39,34 +44,18 @@ extern VIEW stdview; #define viewaspect(v) sqrt((v)->vn2/(v)->hn2) #define STDVIEW {VT_PER,{0.,0.,0.},{0.,1.,0.},{0.,0.,1.}, \ - 45.,45.,0.,0.,0.,0., \ + 1.,45.,45.,0.,0.,0.,0., \ {0.,0.,0.},{0.,0.,0.},0.,0.} #define VIEWSTR "VIEW=" #define VIEWSTRL 5 -#ifdef NOPROTO -extern char *setview(); -extern void normaspect(); -extern double viewray(); -extern void viewloc(); -extern void pix2loc(); -extern void loc2pix(); -extern int getviewopt(); -extern int sscanview(); -extern void fprintview(); -extern char *viewopt(); -extern int isview(); -extern int viewfile(); - -#else - extern char *setview(VIEW *v); extern void normaspect(double va, double *ap, int *xp, int *yp); extern double viewray(FVECT orig, FVECT direc, VIEW *v, double x, double y); extern void viewloc(FVECT ip, VIEW *v, FVECT p); -extern void pix2loc(FLOAT loc[2], RESOLU *rp, int px, int py); +extern void pix2loc(RREAL loc[2], RESOLU *rp, int px, int py); extern void loc2pix(int pp[2], RESOLU *rp, double lx, double ly); extern int getviewopt(VIEW *v, int ac, char *av[]); extern int sscanview(VIEW *vp, char *s); @@ -75,4 +64,9 @@ extern char *viewopt(VIEW *vp); extern int isview(char *s); extern int viewfile(char *fname, VIEW *vp, RESOLU *rp); + +#ifdef __cplusplus +} #endif +#endif /* _RAD_VIEW_H_ */ +