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

# Content
1 /* RCSid $Id: view.h,v 2.14 2003/10/24 05:29:42 greg Exp $ */
2 /*
3 * view.h - header file for image generation.
4 *
5 * Include after stdio.h and fvect.h
6 * Includes resolu.h
7 */
8 #ifndef _RAD_VIEW_H_
9 #define _RAD_VIEW_H_
10
11 #include <time.h>
12
13 #include "rtmath.h"
14 #include "resolu.h"
15
16 #ifdef __cplusplus
17 extern "C" {
18 #endif
19
20 /* view types */
21 #define VT_PER 'v' /* perspective */
22 #define VT_PAR 'l' /* parallel */
23 #define VT_ANG 'a' /* angular fisheye */
24 #define VT_HEM 'h' /* hemispherical fisheye */
25 #define VT_CYL 'c' /* cylindrical panorama */
26
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 double hoff; /* horizontal image offset */
35 double voff; /* vertical image offset */
36 double vfore; /* fore clipping plane */
37 double vaft; /* aft clipping plane (<=0 for inf) */
38 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 } VIEW; /* view parameters */
43
44 extern VIEW stdview;
45
46 #define viewaspect(v) sqrt((v)->vn2/(v)->hn2)
47
48 #define STDVIEW {VT_PER,{0.,0.,0.},{0.,1.,0.},{0.,0.,1.}, \
49 45.,45.,0.,0.,0.,0., \
50 {0.,0.,0.},{0.,0.,0.},0.,0.}
51
52 #define VIEWSTR "VIEW="
53 #define VIEWSTRL 5
54
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 extern void pix2loc(RREAL loc[2], RESOLU *rp, int px, int py);
61 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
70 #ifdef __cplusplus
71 }
72 #endif
73 #endif /* _RAD_VIEW_H_ */
74