--- ray/src/common/view.h 1994/12/20 20:15:06 2.4 +++ ray/src/common/view.h 2003/06/26 00:58:09 2.10 @@ -1,18 +1,26 @@ -/* Copyright (c) 1994 Regents of the University of California */ - -/* SCCSid "$SunId$ LBL" */ - +/* RCSid $Id: view.h,v 2.10 2003/06/26 00:58:09 schorsch Exp $ */ /* * view.h - header file for image generation. * - * 9/19/88 + * Include after fvect.h + * Includes resolu.h */ +#ifndef _RAD_VIEW_H_ +#define _RAD_VIEW_H_ +#ifdef __cplusplus +extern "C" { +#endif +#include "copyright.h" + +#include "resolu.h" + /* view types */ #define VT_PER 'v' /* perspective */ #define VT_PAR 'l' /* parallel */ #define VT_ANG 'a' /* angular fisheye */ #define VT_HEM 'h' /* hemispherical fisheye */ +#define VT_CYL 'c' /* cylindrical panorama */ typedef struct { int type; /* view type */ @@ -33,10 +41,6 @@ typedef struct { extern VIEW stdview; -extern char *setview(); - -extern double viewray(); - #define viewaspect(v) sqrt((v)->vn2/(v)->hn2) #define STDVIEW {VT_PER,{0.,0.,0.},{0.,1.,0.},{0.,0.,1.}, \ @@ -45,3 +49,24 @@ extern double viewray(); #define VIEWSTR "VIEW=" #define VIEWSTRL 5 + + +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(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); +extern void fprintview(VIEW *vp, FILE *fp); +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_ */ +