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

Comparing ray/src/px/pcond2.c (file contents):
Revision 3.16 by greg, Thu Sep 8 21:16:44 2005 UTC vs.
Revision 3.17 by greg, Thu Sep 8 22:29:47 2005 UTC

# Line 149 | Line 149 | greypoint(                     /* compute gamut mapping grey target */
149                                  /* improves saturated color rendering */
150          copycolor(gryc, col);
151          for (i = 3; i--; )
152 <                if (gryc[i] > cwhite[i])
153 <                        gryc[i] = cwhite[i];
154 <                else if (gryc[i] < cblack[i])
155 <                        gryc[i] = cblack[i];
156 <        return((*lumf)(gryc,0));
152 >                if (gryc[i] > 1)
153 >                        gryc[i] = 1;
154 >                else if (gryc[i] < 0)
155 >                        gryc[i] = 0;
156 >        return(bright(gryc));
157   }
158  
159  
# Line 164 | Line 164 | matscan(                       /* apply color matrix to scaline */
164          COLORMAT        mat
165   )
166   {
167        double  gryv;
168
167          while (len--) {
170                gryv = greypoint(sl[0]);
168                  colortrans(sl[0], mat, sl[0]);
169 <                clipgamut(sl[0], gryv, CGAMUT, cblack, cwhite);
169 >                clipgamut(sl[0], greypoint(sl[0]), CGAMUT, cblack, cwhite);
170                  sl++;
171          }
172   }
# Line 186 | Line 183 | mbscan(                        /* apply macbethcal adj. to scaline */
183          register int    i, j;
184  
185          while (len--) {
189                d = greypoint(sl[0]);
186                  colortrans(sl[0], mb->cmat, sl[0]);
187 <                clipgamut(sl[0], d, CGAMUT, mb->cmin, mb->cmax);
187 >                clipgamut(sl[0], greypoint(sl[0]), CGAMUT, mb->cmin, mb->cmax);
188                  for (i = 0; i < 3; i++) {
189                          d = colval(sl[0],i);
190                          for (j = 0; j < 4 && mb->xa[i][j+1] <= d; j++)
# Line 210 | Line 206 | cwscan(                        /* apply color space warp to scaline */
206   )
207   {
208          int     rval;
213        double  gryv;
209  
210          while (len--) {
216                gryv = greypoint(sl[0]);
211                  rval = warp3d(sl[0], sl[0], wp);
212                  if (rval & W3ERROR)
213                          syserror("warp3d");
# Line 222 | Line 216 | cwscan(                        /* apply color space warp to scaline */
216                                          progname, cwarpfile);
217                          exit(1);
218                  }
219 <                clipgamut(sl[0], gryv, CGAMUT, cblack, cwhite);
219 >                clipgamut(sl[0], greypoint(sl[0]), CGAMUT, cblack, cwhite);
220                  sl++;
221          }
222   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines