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

Comparing ray/src/px/ximage.c (file contents):
Revision 1.11 by greg, Tue Oct 3 09:11:43 1989 UTC vs.
Revision 1.12 by greg, Fri Oct 20 20:36:10 1989 UTC

# Line 646 | Line 646 | picreadline3(y, l3)                    /* read in 3-byte scanline */
646   int  y;
647   register rgbpixel  *l3;
648   {
649 <        register BYTE   *l4;
650 <        register int    shift, c;
651 <        int     i;
652 <
649 >        register int    i;
650 >                                                        /* read scanline */
651          if (getscan(y) < 0)
652                  quiterr("cannot seek for picreadline");
653                                                          /* convert scanline */
654 <        for (l4=scanline[0], i=xmax; i--; l4+=4, l3++) {
655 <                shift = l4[EXP] - COLXS + scale;
656 <                if (shift >= 8) {
657 <                        l3->r = l3->g = l3->b = 255;
658 <                } else if (shift <= -8) {
661 <                        l3->r = l3->g = l3->b = 0;
662 <                } else if (shift > 0) {
663 <                        c = l4[RED] << shift;
664 <                        l3->r = c > 255 ? 255 : c;
665 <                        c = l4[GRN] << shift;
666 <                        l3->g = c > 255 ? 255 : c;
667 <                        c = l4[BLU] << shift;
668 <                        l3->b = c > 255 ? 255 : c;
669 <                } else if (shift < 0) {
670 <                        l3->r = l4[RED] >> -shift;
671 <                        l3->g = l4[GRN] >> -shift;
672 <                        l3->b = l4[BLU] >> -shift;
673 <                } else {
674 <                        l3->r = l4[RED];
675 <                        l3->g = l4[GRN];
676 <                        l3->b = l4[BLU];
677 <                }
654 >        normcolrs(scanline, xmax);
655 >        for (i = 0; i < xmax; i++) {
656 >                l3[i].r = scanline[i][RED];
657 >                l3[i].g = scanline[i][GRN];
658 >                l3[i].b = scanline[i][BLU];
659          }
660   }
661  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines