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