ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/ranimove.h
Revision: 3.3
Committed: Fri Jun 27 06:53:23 2003 UTC (20 years, 9 months ago) by greg
Content type: text/plain
Branch: MAIN
Changes since 3.2: +1 -3 lines
Log Message:
Broke standard.h into rtio.h, rterror.h, rtmath.h, and rtmisc.h

File Contents

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