ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/view.h
Revision: 2.15
Committed: Mon Oct 27 10:19:31 2003 UTC (20 years, 6 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 2.14: +3 -1 lines
Log Message:
Added gethomedir.c and various compatibility fixes.

File Contents

# User Rev Content
1 schorsch 2.15 /* RCSid $Id: view.h,v 2.14 2003/10/24 05:29:42 greg Exp $ */
2 greg 1.1 /*
3     * view.h - header file for image generation.
4     *
5 greg 2.12 * Include after stdio.h and fvect.h
6 greg 2.7 * Includes resolu.h
7     */
8 schorsch 2.9 #ifndef _RAD_VIEW_H_
9     #define _RAD_VIEW_H_
10 schorsch 2.13
11 greg 2.14 #include <time.h>
12 schorsch 2.15
13     #include "rtmath.h"
14 schorsch 2.13 #include "resolu.h"
15    
16 schorsch 2.9 #ifdef __cplusplus
17     extern "C" {
18     #endif
19 greg 2.7
20 greg 1.1 /* view types */
21     #define VT_PER 'v' /* perspective */
22     #define VT_PAR 'l' /* parallel */
23 greg 1.6 #define VT_ANG 'a' /* angular fisheye */
24     #define VT_HEM 'h' /* hemispherical fisheye */
25 greg 2.5 #define VT_CYL 'c' /* cylindrical panorama */
26 greg 1.1
27     typedef struct {
28     int type; /* view type */
29     FVECT vp; /* view origin */
30     FVECT vdir; /* view direction */
31     FVECT vup; /* view up */
32     double horiz; /* horizontal view size */
33     double vert; /* vertical view size */
34 greg 1.4 double hoff; /* horizontal image offset */
35     double voff; /* vertical image offset */
36 greg 2.4 double vfore; /* fore clipping plane */
37     double vaft; /* aft clipping plane (<=0 for inf) */
38 greg 1.4 FVECT hvec; /* computed horizontal image vector */
39     FVECT vvec; /* computed vertical image vector */
40     double hn2; /* DOT(hvec,hvec) */
41     double vn2; /* DOT(vvec,vvec) */
42 greg 1.1 } VIEW; /* view parameters */
43    
44     extern VIEW stdview;
45    
46 greg 1.4 #define viewaspect(v) sqrt((v)->vn2/(v)->hn2)
47    
48 greg 2.3 #define STDVIEW {VT_PER,{0.,0.,0.},{0.,1.,0.},{0.,0.,1.}, \
49 greg 2.4 45.,45.,0.,0.,0.,0., \
50     {0.,0.,0.},{0.,0.,0.},0.,0.}
51 greg 1.1
52     #define VIEWSTR "VIEW="
53 greg 1.7 #define VIEWSTRL 5
54 greg 2.7
55    
56     extern char *setview(VIEW *v);
57     extern void normaspect(double va, double *ap, int *xp, int *yp);
58     extern double viewray(FVECT orig, FVECT direc, VIEW *v, double x, double y);
59     extern void viewloc(FVECT ip, VIEW *v, FVECT p);
60 schorsch 2.10 extern void pix2loc(RREAL loc[2], RESOLU *rp, int px, int py);
61 greg 2.7 extern void loc2pix(int pp[2], RESOLU *rp, double lx, double ly);
62     extern int getviewopt(VIEW *v, int ac, char *av[]);
63     extern int sscanview(VIEW *vp, char *s);
64     extern void fprintview(VIEW *vp, FILE *fp);
65     extern char *viewopt(VIEW *vp);
66     extern int isview(char *s);
67     extern int viewfile(char *fname, VIEW *vp, RESOLU *rp);
68    
69 schorsch 2.9
70     #ifdef __cplusplus
71     }
72 greg 2.7 #endif
73 schorsch 2.9 #endif /* _RAD_VIEW_H_ */
74