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

Comparing ray/src/px/aedimage.c (file contents):
Revision 1.4 by greg, Fri Sep 15 09:10:24 1989 UTC vs.
Revision 1.5 by greg, Fri Oct 20 20:35:57 1989 UTC

# Line 396 | Line 396 | picreadline3(y, l3)                    /* read in 3-byte scanline */
396   int  y;
397   register rgbpixel  *l3;
398   {
399 <        register BYTE   *l4;
400 <        register int    shift, c;
401 <        int     i;
402 <
399 >        register int    i;
400 >                                                        /* read scanline */
401          getscan(y);
402                                                          /* convert scanline */
403 <        for (l4=scanline[0], i=xmax; i--; l4+=4, l3++) {
404 <                shift = l4[EXP] - COLXS;
405 <                if (shift >= 8) {
406 <                        l3->r = l3->g = l3->b = 255;
407 <                } else if (shift <= -8) {
410 <                        l3->r = l3->g = l3->b = 0;
411 <                } else if (shift > 0) {
412 <                        c = l4[RED] << shift;
413 <                        l3->r = c > 255 ? 255 : c;
414 <                        c = l4[GRN] << shift;
415 <                        l3->g = c > 255 ? 255 : c;
416 <                        c = l4[BLU] << shift;
417 <                        l3->b = c > 255 ? 255 : c;
418 <                } else if (shift < 0) {
419 <                        l3->r = l4[RED] >> -shift;
420 <                        l3->g = l4[GRN] >> -shift;
421 <                        l3->b = l4[BLU] >> -shift;
422 <                } else {
423 <                        l3->r = l4[RED];
424 <                        l3->g = l4[GRN];
425 <                        l3->b = l4[BLU];
426 <                }
403 >        normcolrs(scanline, xmax);
404 >        for (i = 0; i < xmax; i++) {
405 >                l3[i].r = scanline[i][RED];
406 >                l3[i].g = scanline[i][GRN];
407 >                l3[i].b = scanline[i][BLU];
408          }
409   }
410  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines