569 |
|
return 0; /* should be internal error */ |
570 |
|
/* get BSDF value */ |
571 |
|
yval = SDlookupTre(sdt->stc[tt_Y], gridPos, hc); |
572 |
+ |
if (coef == NULL) /* just getting hypercube? */ |
573 |
+ |
return 1; |
574 |
|
if (sdt->stc[tt_u] == NULL || sdt->stc[tt_v] == NULL) { |
575 |
< |
if (coef != NULL) *coef = yval; |
575 |
> |
*coef = yval; |
576 |
|
return 1; /* no color */ |
577 |
|
} |
576 |
– |
if (coef == NULL) /* just getting hypercube? */ |
577 |
– |
return 1; |
578 |
|
/* else decode color */ |
579 |
|
SDyuv2rgb(yval, SDlookupTre(sdt->stc[tt_u], gridPos, NULL), |
580 |
|
SDlookupTre(sdt->stc[tt_v], gridPos, NULL), coef); |
924 |
|
} |
925 |
|
|
926 |
|
/* Advance pointer past matching token (or any token if c==0) */ |
927 |
< |
#define eat_token(spp,c) (next_token(spp)==(c) ^ !(c) ? *(*(spp))++ : 0) |
927 |
> |
#define eat_token(spp,c) ((next_token(spp)==(c)) ^ !(c) ? *(*(spp))++ : 0) |
928 |
|
|
929 |
|
/* Count words from this point in string to '}' */ |
930 |
|
static int |
1354 |
|
memcpy(df->comp[0].cspec, tt_RGB_prim, sizeof(tt_RGB_prim)); |
1355 |
|
dv->cieY = subtract_min_RGB(&dv->spec, sdt->stc); |
1356 |
|
} else { |
1357 |
< |
df->comp[0].cspec[0] = c_dfcolor; |
1357 |
> |
df->comp[0].cspec[0] = dv->spec = c_dfcolor; |
1358 |
|
dv->cieY = subtract_min_Y(sdt->stc[tt_Y]); |
1359 |
|
} |
1360 |
|
df->maxHemi -= dv->cieY; /* adjust maximum hemispherical */ |