ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/util/ranimove1.c
(Generate patch)

Comparing ray/src/util/ranimove1.c (file contents):
Revision 3.11 by greg, Sun Jul 24 21:11:53 2005 UTC vs.
Revision 3.14 by greg, Thu Apr 17 14:49:59 2008 UTC

# Line 54 | Line 54 | static void setmotion(int      n, FVECT        wpos);
54   static void init_frame_sample(void);
55  
56  
57 + #if 0
58   extern void
59   write_map(              /* write out float map (debugging) */
60          float   *mp,
# Line 79 | Line 80 | write_map(             /* write out float map (debugging) */
80          }
81          fclose(fp);
82   }
83 + #endif
84  
85  
86   static void
# Line 658 | Line 660 | extern void
660   init_frame(void)                        /* render base (low quality) frame */
661   {
662          int     restart;
661
663                                          /* allocate/swap buffers */
664          next_frame();
665                                          /* check rendering status */
666          restart = (!nobjects || vdef(MOVE));
667          if (!restart && curparams != &lorendparams && nprocs > 1)
668                  restart = -1;
668        if (restart > 0) {
669                if (nprocs > 1)
670                        ray_pdone(1);
671                else
672                        ray_done(1);
673        }
669                                          /* post low quality parameters */
670          if (curparams != &lorendparams)
671                  ray_restore(curparams = &lorendparams);
# Line 702 | Line 697 | init_frame(void)                       /* render base (low quality) frame
697          init_frame_sample();
698                                          /* initialize frame error */
699          comp_frame_error();
700 < return;
700 > #if 0
701   {
702          float   *ebuf = (float *)malloc(sizeof(float)*hres*vres);
703          char    fnm[256];
# Line 714 | Line 709 | return;
709          write_map(ebuf, fnm);
710          free((void *)ebuf);
711   }
712 + #endif
713   }
714  
715  
# Line 762 | Line 758 | filter_frame(void)                     /* interpolation, motion-blur, an
758                          continue;
759                  nc = getclosest(neigh, NPINTERP, x, y);
760                  setcolor(cbuffer[n], 0., 0., 0.);
761 +                if (nc <= 0) {          /* no acceptable neighbors */
762 +                        if (y < vres-1)
763 +                                nc = fndx(x, y+1);
764 +                        else if (x < hres-1)
765 +                                nc = fndx(x+1, y);
766 +                        else
767 +                                continue;
768 +                        copycolor(cbuffer[n], cbuffer[nc]);
769 +                        continue;
770 +                }
771                  wsum = 0.;
772                  while (nc-- > 0) {
773                          copycolor(cval, cbuffer[neigh[nc]]);
# Line 771 | Line 777 | filter_frame(void)                     /* interpolation, motion-blur, an
777                          addcolor(cbuffer[n], cval);
778                          wsum += w;
779                  }
780 <                if (wsum > FTINY) {
781 <                        w = 1.0/wsum;
776 <                        scalecolor(cbuffer[n], w);
777 <                }
780 >                w = 1.0/wsum;
781 >                scalecolor(cbuffer[n], w);
782              }
783                                          /* motion blur if requested */
784          if (mblur > .02) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines