48 |
|
CUBE thescene; /* our scene */ |
49 |
|
OBJECT nsceneobjs; /* number of objects in our scene */ |
50 |
|
|
51 |
+ |
extern RGBPRIMP out_prims; /* output color primitives (NULL if spectral) */ |
52 |
+ |
|
53 |
|
int dimlist[MAXDIM]; /* sampling dimensions */ |
54 |
|
int ndims = 0; /* number of sampling dimensions */ |
55 |
|
int samplendx; /* sample index number */ |
342 |
|
if ((pa < .99) | (pa > 1.01)) |
343 |
|
fputaspect(pa, stdout); |
344 |
|
fputnow(stdout); |
345 |
< |
fputprims(stdprims, stdout); |
346 |
< |
fputformat(COLRFMT, stdout); |
347 |
< |
putchar('\n'); |
345 |
> |
if (out_prims == xyzprims) { |
346 |
> |
fputformat(CIEFMT, stdout); |
347 |
> |
} else { |
348 |
> |
fputprims(out_prims, stdout); |
349 |
> |
fputformat(COLRFMT, stdout); |
350 |
> |
} |
351 |
> |
putchar('\n'); /* close header */ |
352 |
|
if (zout != NULL) |
353 |
|
sprintf(cp=fbuf, zout, seq); |
354 |
|
else |
666 |
|
int y |
667 |
|
) |
668 |
|
{ |
669 |
+ |
static COLORMAT xyz2myrgbmat; |
670 |
|
RAY thisray; |
671 |
|
FVECT lorg, ldir; |
672 |
|
double hpos, vpos, lmax; |
701 |
|
|
702 |
|
rayvalue(&thisray); /* trace ray */ |
703 |
|
|
704 |
< |
copycolor(col, thisray.rcol); /* return color */ |
704 |
> |
if (out_prims == stdprims) { /* return color */ |
705 |
> |
scolor_rgb(col, thisray.rcol); |
706 |
> |
} else if (out_prims == xyzprims) { |
707 |
> |
scolor_cie(col, thisray.rcol); |
708 |
> |
scalecolor(col, WHTEFFICACY); |
709 |
> |
} else if (NCSAMP > 3) { |
710 |
> |
COLOR xyz; |
711 |
> |
if (xyz2myrgbmat[0][0] == 0) |
712 |
> |
compxyz2rgbWBmat(xyz2myrgbmat, out_prims); |
713 |
> |
scolor_cie(xyz, thisray.rcol); |
714 |
> |
colortrans(col, xyz2myrgbmat, xyz); |
715 |
> |
clipgamut(col, xyz[CIEY], CGAMUT_LOWER, cblack, cwhite); |
716 |
> |
} else |
717 |
> |
copycolor(col, thisray.rcol); |
718 |
|
|
719 |
|
return(raydistance(&thisray)); /* return distance */ |
720 |
|
} |