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

Comparing ray/src/common/tmapluv.c (file contents):
Revision 3.11 by greg, Fri Jan 7 21:41:06 2005 UTC vs.
Revision 3.12 by greg, Tue Nov 15 06:53:00 2005 UTC

# Line 266 | Line 266 | int    len
266                  returnErr(TM_E_ILLEGAL);
267                                          /* check scaling offset */
268          if (!FEQ(tms->inpsf, lastsf)) {
269 <                offset = BRT2SCALE(64);
270 <                if (tms->inpsf > 1.0001)
271 <                        offset -= (int)(TM_BRTSCALE*log(tms->inpsf)+.5);
272 <                else if (tms->inpsf < 0.9999)
273 <                        offset -= (int)(TM_BRTSCALE*log(tms->inpsf)-.5);
269 >                offset = BRT2SCALE(64) - tmCvLuminance(tms->inpsf);
270                  lastsf = tms->inpsf;
271          }
272                                          /* convert each pixel */
# Line 295 | Line 291 | TMstruct       *tms;
291                  exit(1);
292          }
293          ld = (LUV32DATA *)tms->pd[luv32Reg];
294 <        ld->offset = BRT2SCALE(64);
299 <        if (tms->inpsf > 1.0001)
300 <                ld->offset -= (int)(TM_BRTSCALE*log(tms->inpsf)+.5);
301 <        else if (tms->inpsf < 0.9999)
302 <                ld->offset -= (int)(TM_BRTSCALE*log(tms->inpsf)-.5);
294 >        ld->offset = BRT2SCALE(64) - tmCvLuminance(tms->inpsf);
295          clruvall(ld);
296   }
297  
# Line 330 | Line 322 | TMstruct *tms;
322                  exit(1);
323          }
324          ld = (LUV24DATA *)tms->pd[luv24Reg];
325 <        ld->offset = BRT2SCALE(12);
334 <        if (tms->inpsf > 1.0001)
335 <                ld->offset -= (int)(TM_BRTSCALE*log(tms->inpsf)+.5);
336 <        else if (tms->inpsf < 0.9999)
337 <                ld->offset -= (int)(TM_BRTSCALE*log(tms->inpsf)-.5);
325 >        ld->offset = BRT2SCALE(12) - tmCvLuminance(tms->inpsf);
326          clruvall(ld);
327   }
328  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines