| 215 |
|
for (miga[0] = rbf->ejl; miga[0] != NULL; |
| 216 |
|
miga[0] = nextedge(rbf,miga[0])) |
| 217 |
|
if (opp_rbf(rbf,miga[0]) == rbf->next) { |
| 218 |
< |
double nf = 1. - rbf->invec[2]*rbf->invec[2]; |
| 218 |
> |
double nf = 1. - |
| 219 |
> |
rbf->next->invec[2]*rbf->next->invec[2]; |
| 220 |
|
if (nf > FTINY) { /* rotate to match */ |
| 221 |
|
nf = sqrt((1.-invec[2]*invec[2])/nf); |
| 222 |
< |
invec[0] = nf*rbf->invec[0]; |
| 223 |
< |
invec[1] = nf*rbf->invec[1]; |
| 222 |
> |
invec[0] = nf*rbf->next->invec[0]; |
| 223 |
> |
invec[1] = nf*rbf->next->invec[1]; |
| 224 |
|
} |
| 225 |
< |
return(0); |
| 225 |
> |
return(0); /* rotational symmetry */ |
| 226 |
|
} |
| 227 |
|
break; |
| 228 |
|
} |
| 280 |
|
VCOPY(sivec, invec); /* find triangle/edge */ |
| 281 |
|
sym = get_interp(miga, sivec); |
| 282 |
|
if (sym < 0) /* can't interpolate? */ |
| 283 |
< |
return(NULL); |
| 283 |
> |
return(def_rbf_spec(invec)); |
| 284 |
|
if (miga[1] == NULL) { /* advect along edge? */ |
| 285 |
|
rbf = e_advect_rbf(miga[0], sivec, lobe_lim); |
| 286 |
|
if (single_plane_incident) |
| 343 |
|
const RBFVAL *rbf0i = &miga[0]->rbfv[0]->rbfa[i]; |
| 344 |
|
const float w0i = rbf0i->peak; |
| 345 |
|
const double rad0i = R2ANG(rbf0i->crad); |
| 346 |
+ |
C_COLOR cc0; |
| 347 |
|
ovec_from_pos(v0, rbf0i->gx, rbf0i->gy); |
| 348 |
+ |
c_decodeChroma(&cc0, rbf0i->chroma); |
| 349 |
|
for (j = 0; j < mtx_ncols(miga[0]); j++) { |
| 350 |
|
const float ma = mtx_coef(miga[0],i,j); |
| 351 |
|
const RBFVAL *rbf1j; |
| 352 |
+ |
C_COLOR ccs; |
| 353 |
|
double srad2; |
| 354 |
|
if (ma <= cthresh) |
| 355 |
|
continue; |
| 356 |
|
rbf1j = &miga[0]->rbfv[1]->rbfa[j]; |
| 357 |
+ |
c_decodeChroma(&ccs, rbf1j->chroma); |
| 358 |
+ |
c_cmix(&ccs, 1.-s, &cc0, s, &ccs); |
| 359 |
|
srad2 = R2ANG(rbf1j->crad); |
| 360 |
|
srad2 = (1.-s)*(1.-t)*rad0i*rad0i + s*(1.-t)*srad2*srad2; |
| 361 |
|
ovec_from_pos(v1, rbf1j->gx, rbf1j->gy); |
| 373 |
|
rad2 = srad2 + t*rad2*rad2; |
| 374 |
|
rbf->rbfa[n].peak = w0i * ma * (mb*mbfact + mc*mcfact) * |
| 375 |
|
rad0i*rad0i/rad2; |
| 376 |
+ |
if (rbf_colorimetry == RBCtristimulus) { |
| 377 |
+ |
C_COLOR cres; |
| 378 |
+ |
c_decodeChroma(&cres, rbf2k->chroma); |
| 379 |
+ |
c_cmix(&cres, 1.-t, &ccs, t, &cres); |
| 380 |
+ |
rbf->rbfa[n].chroma = c_encodeChroma(&cres); |
| 381 |
+ |
} else |
| 382 |
+ |
rbf->rbfa[n].chroma = c_dfchroma; |
| 383 |
|
rbf->rbfa[n].crad = ANG2R(sqrt(rad2)); |
| 384 |
|
ovec_from_pos(v2, rbf2k->gx, rbf2k->gy); |
| 385 |
|
geodesic(v2, v1, v2, t, GEOD_REL); |