ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/view.h
(Generate patch)

Comparing ray/src/common/view.h (file contents):
Revision 1.1 by greg, Thu Feb 2 10:34:24 1989 UTC vs.
Revision 2.11 by greg, Fri Jun 27 06:53:22 2003 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1988 Regents of the University of California */
2 <
3 < /* SCCSid "$SunId$ LBL" */
4 <
1 > /* RCSid $Id$ */
2   /*
3   *  view.h - header file for image generation.
4   *
5 < *     9/19/88
5 > *  Include after fvect.h
6 > *  Includes resolu.h
7   */
8 + #ifndef _RAD_VIEW_H_
9 + #define _RAD_VIEW_H_
10 + #ifdef __cplusplus
11 + extern "C" {
12 + #endif
13  
14 + #include  "resolu.h"
15 +
16                                  /* view types */
17   #define  VT_PER         'v'             /* perspective */
18   #define  VT_PAR         'l'             /* parallel */
19 + #define  VT_ANG         'a'             /* angular fisheye */
20 + #define  VT_HEM         'h'             /* hemispherical fisheye */
21 + #define  VT_CYL         'c'             /* cylindrical panorama */
22  
23   typedef struct {
24          int  type;              /* view type */
# Line 19 | Line 27 | typedef struct {
27          FVECT  vup;             /* view up */
28          double  horiz;          /* horizontal view size */
29          double  vert;           /* vertical view size */
30 <        int  hresolu;           /* horizontal resolution */
31 <        int  vresolu;           /* vertical resolution */
32 <        FVECT  vhinc;           /* computed horizontal increment */
33 <        FVECT  vvinc;           /* computed vertical increment */
30 >        double  hoff;           /* horizontal image offset */
31 >        double  voff;           /* vertical image offset */
32 >        double  vfore;          /* fore clipping plane */
33 >        double  vaft;           /* aft clipping plane (<=0 for inf) */
34 >        FVECT  hvec;            /* computed horizontal image vector */
35 >        FVECT  vvec;            /* computed vertical image vector */
36 >        double  hn2;            /* DOT(hvec,hvec) */
37 >        double  vn2;            /* DOT(vvec,vvec) */
38   } VIEW;                 /* view parameters */
39  
40   extern VIEW  stdview;
41  
42 < extern char  *setview();
42 > #define  viewaspect(v)  sqrt((v)->vn2/(v)->hn2)
43  
44 < #define  STDVIEW(h)     {VT_PER,0.,0.,0.,0.,1.,0.,0.,0.,1.,45.,45.,h,h}
44 > #define  STDVIEW        {VT_PER,{0.,0.,0.},{0.,1.,0.},{0.,0.,1.}, \
45 >                                45.,45.,0.,0.,0.,0., \
46 >                                {0.,0.,0.},{0.,0.,0.},0.,0.}
47  
48   #define  VIEWSTR        "VIEW="
49 + #define  VIEWSTRL       5
50 +
51 +
52 + extern char     *setview(VIEW *v);
53 + extern void     normaspect(double va, double *ap, int *xp, int *yp);
54 + extern double   viewray(FVECT orig, FVECT direc, VIEW *v, double x, double y);
55 + extern void     viewloc(FVECT ip, VIEW *v, FVECT p);
56 + extern void     pix2loc(RREAL loc[2], RESOLU *rp, int px, int py);
57 + extern void     loc2pix(int pp[2], RESOLU *rp, double lx, double ly);
58 + extern int      getviewopt(VIEW *v, int ac, char *av[]);
59 + extern int      sscanview(VIEW *vp, char *s);
60 + extern void     fprintview(VIEW *vp, FILE *fp);
61 + extern char     *viewopt(VIEW *vp);
62 + extern int      isview(char *s);
63 + extern int      viewfile(char *fname, VIEW *vp, RESOLU *rp);
64 +
65 +
66 + #ifdef __cplusplus
67 + }
68 + #endif
69 + #endif /* _RAD_VIEW_H_ */
70 +

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines