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.1 by greg, Tue Nov 12 16:55:34 1991 UTC vs.
Revision 2.4 by greg, Fri Oct 2 15:59:58 1992 UTC

# Line 17 | Line 17 | static char SCCSid[] = "$SunId$ LBL";
17   #define  MINELEN        8       /* minimum scanline length for encoding */
18   #define  MINRUN         4       /* minimum run length */
19  
20 + #ifndef frexp
21 + extern double  frexp();
22 + #endif
23  
24 +
25   char *
26   tempbuffer(len)                 /* get a temporary buffer */
27   unsigned  len;
# Line 39 | Line 43 | unsigned  len;
43  
44   fwritecolrs(scanline, len, fp)          /* write out a colr scanline */
45   register COLR  *scanline;
46 < int  len;
46 > unsigned  len;
47   register FILE  *fp;
48   {
49          register int  i, j, beg, cnt;
50          int  c2;
51          
52 <        if (len < MINELEN)              /* too small to encode */
52 >        if (len < MINELEN | len > 0x7fff)       /* OOBs, write out flat */
53                  return(fwrite((char *)scanline,sizeof(COLR),len,fp) - len);
54 <        if (len > 32767)                /* too big! */
51 <                return(-1);
52 <        putc(2, fp);                    /* put magic header */
54 >                                        /* put magic header */
55          putc(2, fp);
56 +        putc(2, fp);
57          putc(len>>8, fp);
58          putc(len&255, fp);
59                                          /* put components seperately */
# Line 98 | Line 101 | register FILE  *fp;
101          register int  i, j;
102          int  code;
103                                          /* determine scanline type */
104 <        if (len < MINELEN)
104 >        if (len < MINELEN | len > 0x7fff)
105                  return(oldreadcolrs(scanline, len, fp));
106          if ((i = getc(fp)) == EOF)
107                  return(-1);
# Line 226 | Line 229 | setcolr(clr, r, g, b)          /* assign a short color value *
229   register COLR  clr;
230   double  r, g, b;
231   {
229        double  frexp();
232          double  d;
233          int  e;
234          

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines