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); |
789 |
|
for (i = sdt->stc[tt_Y]->ndim - 2; i--; ) |
790 |
|
inCoord[i] = floor(inCoord[i]/quantum)*quantum + .5*quantum; |
791 |
|
cdlast = NULL; /* check for direction in cache list */ |
792 |
+ |
/* PLACE MUTEX LOCK HERE FOR THREAD-SAFE */ |
793 |
|
for (cd = (SDTreCDst *)sdc->cdList; cd != NULL; |
794 |
|
cdlast = cd, cd = cd->next) { |
795 |
|
if (cd->sidef != mode) |
808 |
|
cd->next = (SDTreCDst *)sdc->cdList; |
809 |
|
sdc->cdList = (SDCDst *)cd; |
810 |
|
} |
811 |
+ |
/* END MUTEX LOCK */ |
812 |
|
return (SDCDst *)cd; /* ready to go */ |
813 |
|
} |
814 |
|
|
926 |
|
} |
927 |
|
|
928 |
|
/* Advance pointer past matching token (or any token if c==0) */ |
929 |
< |
#define eat_token(spp,c) (next_token(spp)==(c) ^ !(c) ? *(*(spp))++ : 0) |
929 |
> |
#define eat_token(spp,c) ((next_token(spp)==(c)) ^ !(c) ? *(*(spp))++ : 0) |
930 |
|
|
931 |
|
/* Count words from this point in string to '}' */ |
932 |
|
static int |
1356 |
|
memcpy(df->comp[0].cspec, tt_RGB_prim, sizeof(tt_RGB_prim)); |
1357 |
|
dv->cieY = subtract_min_RGB(&dv->spec, sdt->stc); |
1358 |
|
} else { |
1359 |
< |
df->comp[0].cspec[0] = c_dfcolor; |
1359 |
> |
df->comp[0].cspec[0] = dv->spec = c_dfcolor; |
1360 |
|
dv->cieY = subtract_min_Y(sdt->stc[tt_Y]); |
1361 |
|
} |
1362 |
|
df->maxHemi -= dv->cieY; /* adjust maximum hemispherical */ |