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

Comparing ray/src/rt/rpict.c (file contents):
Revision 2.86 by greg, Thu Mar 21 00:03:09 2013 UTC vs.
Revision 2.87 by greg, Tue Feb 18 12:13:42 2014 UTC

# Line 33 | Line 33 | static const char RCSid[] = "$Id$";
33   #include  "view.h"
34   #include  "random.h"
35   #include  "paths.h"
36 < #include  "rtmisc.h" /* myhostname() */
36 > #include  "hilbert.h"
37  
38  
39   #define  RFTEMPLATE     "rfXXXXXX"
# Line 802 | Line 802 | writerr:
802   }
803  
804   static int
805 < pixnumber(              /* compute pixel index (brushed) */
805 > pixnumber(              /* compute pixel index (screen door) */
806          int  x,
807          int  y,
808          int  xres,
809          int  yres
810   )
811   {
812 <        x -= y;
813 <        while (x < 0)
814 <                x += xres;
815 <        return((((x>>2)*yres + y) << 2) + (x & 3));
812 >        unsigned        nbits = 0;
813 >        bitmask_t       coord[2];
814 >
815 >        if (xres < yres) xres = yres;
816 >        while (xres > 0) {
817 >                xres >>= 1;
818 >                ++nbits;
819 >        }
820 >        coord[0] = x; coord[1] = y;
821 >        return ((int)hilbert_c2i(2, nbits, coord));
822   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines