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

Comparing ray/src/px/ra_t16.c (file contents):
Revision 1.11 by greg, Thu Apr 18 14:35:42 1991 UTC vs.
Revision 1.12 by greg, Fri May 17 08:41:52 1991 UTC

# Line 1 | Line 1
1 < /* Copyright (c) 1986 Regents of the University of California */
1 > /* Copyright (c) 1991 Regents of the University of California */
2  
3   #ifndef lint
4   static char SCCSid[] = "$SunId$ LBL";
# Line 291 | Line 291 | struct hdStruct  *hp;
291                  colrs_gambs(inl, hp->x);
292                  if (hp->dataBits == 16) {
293                          register unsigned short  *dp;
294 +                        register int  v;
295                          dp = (unsigned short *)tarData + j*hp->x;
296                          for (i = 0; i < hp->x; i++) {
297 <                                *dp = ((inl[i][RED]+(random()&7)) & 0xf8)<<7;
298 <                                *dp |= ((inl[i][GRN]+(random()&7)) & 0xf8)<<2;
299 <                                *dp++ |= (inl[i][BLU]+(random()&7))>>3;
297 >                                v = inl[i][RED] + (random()&7);
298 >                                if (v > 255) v = 255;
299 >                                *dp = (v&0xf8)<<7;
300 >                                v = inl[i][GRN] + (random()&7);
301 >                                if (v > 255) v = 255;
302 >                                *dp |= (v&0xf8)<<2;
303 >                                v = inl[i][BLU] + (random()&7);
304 >                                if (v > 255) v = 255;
305 >                                *dp++ |= v>>3;
306                          }
307                  } else {        /* hp->dataBits == 24 */
308                          register unsigned char  *dp;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines