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.2 by greg, Sun Dec 10 13:41:08 1989 UTC vs.
Revision 2.8 by greg, Tue Feb 25 02:47: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  
9 + #include "copyright.h"
10 +
11 + #include  "resolu.h"
12 +
13                                  /* view types */
14   #define  VT_PER         'v'             /* perspective */
15   #define  VT_PAR         'l'             /* parallel */
16 + #define  VT_ANG         'a'             /* angular fisheye */
17 + #define  VT_HEM         'h'             /* hemispherical fisheye */
18 + #define  VT_CYL         'c'             /* cylindrical panorama */
19  
20   typedef struct {
21          int  type;              /* view type */
# Line 19 | Line 24 | typedef struct {
24          FVECT  vup;             /* view up */
25          double  horiz;          /* horizontal view size */
26          double  vert;           /* vertical view size */
27 <        int  hresolu;           /* horizontal resolution */
28 <        int  vresolu;           /* vertical resolution */
29 <        FVECT  vhinc;           /* computed horizontal increment */
30 <        FVECT  vvinc;           /* computed vertical increment */
31 <        double  vhs2;           /* 1.0/DOT(vhinc,vhinc) */
32 <        double  vvs2;           /* 1.0/DOT(vvinc,vvinc) */
27 >        double  hoff;           /* horizontal image offset */
28 >        double  voff;           /* vertical image offset */
29 >        double  vfore;          /* fore clipping plane */
30 >        double  vaft;           /* aft clipping plane (<=0 for inf) */
31 >        FVECT  hvec;            /* computed horizontal image vector */
32 >        FVECT  vvec;            /* computed vertical image vector */
33 >        double  hn2;            /* DOT(hvec,hvec) */
34 >        double  vn2;            /* DOT(vvec,vvec) */
35   } VIEW;                 /* view parameters */
36  
37   extern VIEW  stdview;
38  
39 < extern char  *setview();
39 > #define  viewaspect(v)  sqrt((v)->vn2/(v)->hn2)
40  
41 < #define  STDVIEW(h)     {VT_PER,0.,0.,0.,0.,1.,0.,0.,0.,1.,45.,45.,h,h}
41 > #define  STDVIEW        {VT_PER,{0.,0.,0.},{0.,1.,0.},{0.,0.,1.}, \
42 >                                45.,45.,0.,0.,0.,0., \
43 >                                {0.,0.,0.},{0.,0.,0.},0.,0.}
44  
45   #define  VIEWSTR        "VIEW="
46 + #define  VIEWSTRL       5
47 +
48 + #ifdef NOPROTO
49 +
50 + extern char     *setview();
51 + extern void     normaspect();
52 + extern double   viewray();
53 + extern void     viewloc();
54 + extern void     pix2loc();
55 + extern void     loc2pix();
56 + extern int      getviewopt();
57 + extern int      sscanview();
58 + extern void     fprintview();
59 + extern char     *viewopt();
60 + extern int      isview();
61 + extern int      viewfile();
62 +
63 + #else
64 +
65 + extern char     *setview(VIEW *v);
66 + extern void     normaspect(double va, double *ap, int *xp, int *yp);
67 + extern double   viewray(FVECT orig, FVECT direc, VIEW *v, double x, double y);
68 + extern void     viewloc(FVECT ip, VIEW *v, FVECT p);
69 + extern void     pix2loc(FLOAT loc[2], RESOLU *rp, int px, int py);
70 + extern void     loc2pix(int pp[2], RESOLU *rp, double lx, double ly);
71 + extern int      getviewopt(VIEW *v, int ac, char *av[]);
72 + extern int      sscanview(VIEW *vp, char *s);
73 + extern void     fprintview(VIEW *vp, FILE *fp);
74 + extern char     *viewopt(VIEW *vp);
75 + extern int      isview(char *s);
76 + extern int      viewfile(char *fname, VIEW *vp, RESOLU *rp);
77 +
78 + #endif

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines