ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/ranimove.h
Revision: 3.5
Committed: Mon Jul 14 22:24:00 2003 UTC (20 years, 8 months ago) by schorsch
Content type: text/plain
Branch: MAIN
Changes since 3.4: +6 -5 lines
Log Message:
Instrumented headers against multiple inclusion and for use from C++.
Moved includes in headers out of "C" scope.

File Contents

# User Rev Content
1 schorsch 3.5 /* RCSid $Id: ranimove.h,v 3.4 2003/06/27 11:32:12 schorsch Exp $ */
2 greg 3.1 /*
3     * ranimove.h
4     *
5     * Radiance object animation program
6     *
7     * The main difference between this program and ranimate is that
8     * ranimove is optimized for object motion, and includes a complete
9     * blur simulation. We also have a number of clever schemes
10     * for optimizing the computation, allowing rendering time
11     * per frame and noticeable difference threshold to be specified.
12     * Parallel rendering uses multiple processors on the local host,
13     * and network rendering is not directly supported. (However, no
14     * one says you can't run ranimove on other machines at the
15     * same time; just be careful not to overlap frames.)
16     *
17     * See the ranimove(1) man page for further details.
18     */
19 schorsch 3.4 #ifndef _RAD_RANIMOVE_H_
20     #define _RAD_RANIMOVE_H_
21 schorsch 3.5
22     #include "ray.h"
23     #include "view.h"
24     #include "vars.h"
25    
26 schorsch 3.4 #ifdef __cplusplus
27     extern "C" {
28     #endif
29    
30 greg 3.1 /* input variables (alphabetical by name) */
31     #define BASENAME 0 /* output image base name */
32     #define END 1 /* number of animation frames */
33     #define EXPOSURE 2 /* how to compute exposure */
34     #define HIGHQ 3 /* high quality setting */
35     #define LOWQ 4 /* low quality setting */
36     #define MBLUR 5 /* motion blur parameter */
37     #define MOVE 6 /* object movement */
38     #define OCONV 7 /* oconv options */
39     #define OCTREEF 8 /* octree file name */
40     #define RATE 9 /* frame rate (fps) */
41     #define RESOLUTION 10 /* desired final resolution */
42     #define RIF 11 /* rad input file */
43     #define VIEWFILE 12 /* animation frame views */
44    
45     #define NV_INIT 13 /* number of variables */
46    
47     #define VV_INIT { \
48     {"BASENAME", 3, 0, NULL, onevalue}, \
49     {"END", 3, 0, NULL, intvalue}, \
50     {"EXPOSURE", 3, 0, NULL, onevalue}, \
51     {"highq", 2, 0, NULL, catvalues}, \
52     {"lowq", 2, 0, NULL, catvalues}, \
53     {"MBLUR", 2, 0, NULL, fltvalue}, \
54     {"move", 2, 0, NULL, NULL}, \
55     {"oconv", 2, 0, NULL, catvalues}, \
56     {"OCTREE", 3, 0, NULL, onevalue}, \
57     {"RATE", 2, 0, NULL, fltvalue}, \
58     {"RESOLUTION", 3, 0, NULL, onevalue}, \
59     {"RIF", 3, 0, NULL, onevalue}, \
60     {"VIEWFILE", 2, 0, NULL, onevalue} \
61     }
62    
63     struct ObjMove {
64     int parent; /* parent object index */
65     char name[64]; /* object name */
66     char xf_file[128]; /* transform file name */
67     char spec[512]; /* object file or command */
68     char prio_file[128]; /* priority file name */
69     int cfm; /* current frame number */
70     char xfs[512]; /* part transform arguments */
71     MAT4 xfm; /* part transform matrix */
72     MAT4 cxfm; /* combined transform matrix */
73     MAT4 bxfm; /* transform to previous frame */
74     double prio; /* part priority */
75     double cprio; /* combined priority */
76     };
77    
78     extern int silent; /* run silently? */
79    
80     extern int quickstart; /* time initial frame as well? */
81    
82     extern int nprocs; /* number of rendering processes */
83    
84     extern int rtperfrm; /* seconds to spend per frame */
85    
86     extern double ndthresh; /* noticeable difference threshold */
87     extern int ndtset; /* did user set ndthresh? */
88    
89     extern int fbeg; /* starting frame */
90     extern int fend; /* ending frame */
91     extern int fcur; /* current frame being rendered */
92    
93     extern char lorendoptf[]; /* LQ options file */
94     extern RAYPARAMS lorendparams; /* LQ rendering parameters */
95     extern char hirendoptf[]; /* HQ options file */
96     extern RAYPARAMS hirendparams; /* HQ rendering parameters */
97     extern RAYPARAMS *curparams; /* current parameter settings */
98     extern int twolevels; /* low and high quality differ */
99    
100     extern double mblur; /* vflt(MBLUR) */
101     extern double rate; /* vflt(RATE) */
102    
103     extern char objtmpf[]; /* object temporary file */
104    
105     extern struct ObjMove *obj_move; /* object movements */
106    
107     extern int haveprio; /* high-level saliency specified */
108    
109     extern int gargc; /* global argc for printargs */
110     extern char **gargv; /* global argv for printargs */
111    
112     VIEW *getview();
113     int countviews();
114     int getmove();
115     char *getexp(), *getoctspec(), *getobjname(), *getxf();
116     double expspec_val(), obj_prio();
117     void setdefaults(), setmove(), animate(), getradfile(), setrendparams();
118     void init_frame(), filter_frame(), send_frame(), free_frame();
119     int refine_frame();
120     double getTime();
121    
122     /*************************************************************************
123     * Frame rendering stuff (defined in ranimove1.c and ranimove2.c)
124     */
125     /* enumerated accuracy map values */
126     #define ANOVAL 0 /* unevaluated pixel */
127     #define ALOWQ 1 /* single low-quality sample */
128     #define AHIGHQ 2 /* single high-quality sample */
129     #define AMIN 3 /* start of error lookup table */
130     #define ADISTANT 255 /* ray went off to infinity */
131    
132     extern double acctab[256]; /* accuracy value table */
133    
134     extern int hres, vres; /* frame resolution (fcur) */
135     extern double pixaspect; /* pixel aspect ratio */
136    
137     extern VIEW vw; /* view for this frame */
138     extern COLOR *cbuffer; /* color at each pixel */
139     extern float *zbuffer; /* depth at each pixel */
140     extern OBJECT *obuffer; /* object id at each pixel */
141     extern short *xmbuffer; /* x motion at each pixel */
142     extern short *ymbuffer; /* y motion at each pixel */
143     extern BYTE *abuffer; /* accuracy at each pixel */
144     extern BYTE *sbuffer; /* sample count per pixel */
145    
146     extern VIEW vwprev; /* last frame's view */
147     extern COLOR *cprev; /* last frame colors */
148     extern float *zprev; /* last frame depth */
149     extern OBJECT *oprev; /* last frame objects */
150     extern BYTE *aprev; /* last frame accuracy */
151    
152     extern float *cerrmap; /* conspicuous error map */
153     extern int cerrzero; /* is all of cerrmap zero? */
154     extern COLOR *val2map; /* value-squared map for variance */
155    
156     extern double frm_stop; /* when to stop rendering this frame */
157    
158     extern double hlsmax; /* maximum high-level saliency */
159    
160     #define CSF_SMN (1./0.82) /* 1/avg_tracking_efficacy */
161    
162     #define outbuffer cprev /* used to hold final output */
163     #define wbuffer zprev /* used for final filtering */
164    
165     #define fndx(x,y) ((y)*hres + (x))
166    
167     #define MO_UNK -32768 /* unknown motion value */
168    
169     #define FOV_DEG 1.0 /* foveal radius (degrees) */
170    
171     #define LOG_E1 (-0.0233) /* ln(0.977) */
172     #define errorf(i) exp(LOG_E1*((i)-AMIN))
173     #define errori(e) (int)(log(e)*(1./LOG_E1) + (AMIN+.5))
174    
175     #define NSAMPOK 5 /* samples enough for error estimation */
176    
177     #define NPINTERP 4 /* number of pixels to interpolate */
178    
179     #define ATIDIFF 7 /* error difference for time extrapolation */
180    
181     void write_map(), sample_pos(), comp_frame_error(), conspicuity();
182     int getclosest(), getambcolor(), refine_first();
183     double sample_wt(), estimaterr(), comperr();
184 schorsch 3.4
185    
186     #ifdef __cplusplus
187     }
188     #endif
189     #endif /* _RAD_RANIMOVE_H_ */
190