1314 |
|
my_min.new_stu = my_min.new_stv = NULL; |
1315 |
|
/* get minimum RGB value */ |
1316 |
|
SDtraverseTre(stc[tt_Y], NULL, 0, get_min_RGB, &my_min); |
1317 |
< |
ymin = tt_RGB_coef[0]*my_min.rgb[0] + |
1318 |
< |
tt_RGB_coef[1]*my_min.rgb[1] + |
1319 |
< |
tt_RGB_coef[2]*my_min.rgb[2]; |
1320 |
< |
if (ymin <= .01/M_PI) { |
1321 |
< |
*cs = c_dfcolor; |
1322 |
< |
return .0; /* not worth bothering about */ |
1323 |
< |
} |
1324 |
< |
/* adjust u' & v' values */ |
1317 |
> |
/* convert to C_COLOR */ |
1318 |
> |
ymin = c_fromSharpRGB(my_min.rgb, cs); |
1319 |
> |
if (ymin <= .01/M_PI) /* not worth bothering about? */ |
1320 |
> |
return .0; |
1321 |
> |
/* adjust u' & v' trees */ |
1322 |
|
SDtraverseTre(stc[tt_u], NULL, 0, adjust_utree, &my_min); |
1323 |
|
SDtraverseTre(stc[tt_v], NULL, 0, adjust_vtree, &my_min); |
1324 |
|
SDfreeTre(stc[tt_u]); SDfreeTre(stc[tt_v]); |
1325 |
|
stc[tt_u] = SDsimplifyTre(my_min.new_stu); |
1326 |
|
stc[tt_v] = SDsimplifyTre(my_min.new_stv); |
1327 |
< |
/* finally, subtract Y value */ |
1327 |
> |
/* subtract Y & return hemispherical */ |
1328 |
|
SDsubtractTreVal(stc[tt_Y], ymin); |
1329 |
< |
/* return color and Y */ |
1330 |
< |
c_fromSharpRGB(my_min.rgb, cs); |
1334 |
< |
return M_PI*ymin; |
1329 |
> |
|
1330 |
> |
return M_PI * ymin; |
1331 |
|
} |
1332 |
|
|
1333 |
|
/* Extract and separate diffuse portion of BSDF */ |