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

Comparing ray/src/common/color.c (file contents):
Revision 2.5 by greg, Fri Feb 26 10:08:50 1993 UTC vs.
Revision 2.7 by greg, Fri Jun 4 14:51:39 1993 UTC

# Line 12 | Line 12 | static char SCCSid[] = "$SunId$ LBL";
12  
13   #include  <stdio.h>
14  
15 + #include  <math.h>
16 +
17   #include  "color.h"
18  
19   #define  MINELEN        8       /* minimum scanline length for encoding */
20 < #define  MAXELEN        0x7ffe  /* maximum scanline length for encoding */
20 > #define  MAXELEN        0x7fff  /* maximum scanline length for encoding */
21   #define  MINRUN         4       /* minimum run length */
22  
21 #ifndef frexp
22 extern double  frexp();
23 #endif
23  
25
24   char *
25   tempbuffer(len)                 /* get a temporary buffer */
26   unsigned  len;
# Line 100 | Line 98 | int  len;
98   register FILE  *fp;
99   {
100          register int  i, j;
101 <        int  code;
101 >        int  code, val;
102                                          /* determine scanline type */
103          if (len < MINELEN | len > MAXELEN)
104                  return(oldreadcolrs(scanline, len, fp));
# Line 127 | Line 125 | register FILE  *fp;
125                  if ((code = getc(fp)) == EOF)
126                      return(-1);
127                  if (code > 128) {       /* run */
128 <                    scanline[j++][i] = getc(fp);
129 <                    for (code &= 127; --code; j++)
130 <                        scanline[j][i] = scanline[j-1][i];
128 >                    code &= 127;
129 >                    val = getc(fp);
130 >                    while (code--)
131 >                        scanline[j++][i] = val;
132                  } else                  /* non-run */
133                      while (code--)
134                          scanline[j++][i] = getc(fp);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines