--- ray/src/util/ranimove1.c 2005/04/19 01:15:07 3.10 +++ ray/src/util/ranimove1.c 2008/11/10 19:08:20 3.15 @@ -1,10 +1,10 @@ #ifndef lint -static const char RCSid[] = "$Id: ranimove1.c,v 3.10 2005/04/19 01:15:07 greg Exp $"; +static const char RCSid[] = "$Id: ranimove1.c,v 3.15 2008/11/10 19:08:20 greg Exp $"; #endif /* * ranimove1.c * - * Basic frame rendering routines for ranimate(1). + * Basic frame rendering routines for ranimove(1). * * Created by Gregory Ward on Wed Jan 08 2003. */ @@ -54,6 +54,7 @@ static void setmotion(int n, FVECT wpos); static void init_frame_sample(void); +#if 0 extern void write_map( /* write out float map (debugging) */ float *mp, @@ -79,6 +80,7 @@ write_map( /* write out float map (debugging) */ } fclose(fp); } +#endif static void @@ -658,19 +660,12 @@ extern void init_frame(void) /* render base (low quality) frame */ { int restart; - /* allocate/swap buffers */ next_frame(); /* check rendering status */ restart = (!nobjects || vdef(MOVE)); if (!restart && curparams != &lorendparams && nprocs > 1) restart = -1; - if (restart > 0) { - if (nprocs > 1) - ray_pdone(1); - else - ray_done(1); - } /* post low quality parameters */ if (curparams != &lorendparams) ray_restore(curparams = &lorendparams); @@ -702,7 +697,7 @@ init_frame(void) /* render base (low quality) frame init_frame_sample(); /* initialize frame error */ comp_frame_error(); -return; +#if 0 { float *ebuf = (float *)malloc(sizeof(float)*hres*vres); char fnm[256]; @@ -714,6 +709,7 @@ return; write_map(ebuf, fnm); free((void *)ebuf); } +#endif } @@ -762,6 +758,16 @@ filter_frame(void) /* interpolation, motion-blur, an continue; nc = getclosest(neigh, NPINTERP, x, y); setcolor(cbuffer[n], 0., 0., 0.); + if (nc <= 0) { /* no acceptable neighbors */ + if (y < vres-1) + nc = fndx(x, y+1); + else if (x < hres-1) + nc = fndx(x+1, y); + else + continue; + copycolor(cbuffer[n], cbuffer[nc]); + continue; + } wsum = 0.; while (nc-- > 0) { copycolor(cval, cbuffer[neigh[nc]]); @@ -771,10 +777,8 @@ filter_frame(void) /* interpolation, motion-blur, an addcolor(cbuffer[n], cval); wsum += w; } - if (wsum > FTINY) { - w = 1.0/wsum; - scalecolor(cbuffer[n], w); - } + w = 1.0/wsum; + scalecolor(cbuffer[n], w); } /* motion blur if requested */ if (mblur > .02) { @@ -896,7 +900,7 @@ send_frame(void) /* send frame to destination */ int y; /* open output picture */ sprintf(pfname, vval(BASENAME), fcur); - strcat(pfname, ".pic"); + strcat(pfname, ".hdr"); fp = fopen(pfname, "w"); if (fp == NULL) { sprintf(errmsg, "cannot open output frame \"%s\"", pfname);