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.20 by greg, Sat Feb 23 19:11:25 2019 UTC vs.
Revision 2.21 by greg, Mon May 27 15:44:26 2019 UTC

# Line 62 | Line 62 | fwritecolrs(                   /* write out a colr scanline */
62          putc(2, fp);
63          putc(2, fp);
64          putc(len>>8, fp);
65 <        putc(len&255, fp);
65 >        putc(len&0xff, fp);
66                                          /* put components seperately */
67          for (i = 0; i < 4; i++) {
68              for (j = 0; j < len; j += cnt) {    /* find next run */
# Line 160 | Line 160 | freadcolrs(                    /* read in an encoded colr scanline */
160          scanline[0][BLU] = getc(fp);
161          if ((i = getc(fp)) == EOF)
162                  return(-1);
163 <        if (scanline[0][GRN] != 2 || scanline[0][BLU] & 128) {
163 >        if ((scanline[0][GRN] != 2) | ((scanline[0][BLU] & 0x80) != 0)) {
164                  scanline[0][RED] = 2;
165                  scanline[0][EXP] = i;
166                  return(oldreadcolrs(scanline+1, len-1, fp));
# Line 270 | Line 270 | setcolr(                       /* assign a short color value */
270                  return;
271          }
272  
273 <        d = frexp(d, &e) * 255.9999 / d;
273 >        d = frexp(d, &e) * 256.0 / d;
274  
275          if (r > 0.0)
276                  clr[RED] = r * d;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines