| 68 |
|
extern void tranotify(OBJECT obj); |
| 69 |
|
static void tabin(RAY *r); |
| 70 |
|
static RayReportCall ourtrace; |
| 71 |
– |
static RayReportCall printvals; |
| 71 |
|
|
| 72 |
< |
static void putscolor(COLORV *scol); |
| 72 |
> |
RayReportCall printvals; /* print selected ray values */ |
| 73 |
|
|
| 74 |
+ |
void putscolor(COLORV *scol, double sf = 1.); /* convert/print spectral color */ |
| 75 |
+ |
|
| 76 |
|
static oputf_t *ray_out[32], *every_out[32]; |
| 76 |
– |
static putf_t *putreal; |
| 77 |
|
|
| 78 |
+ |
putf_t *putreal; /* put out real vector */ |
| 79 |
+ |
|
| 80 |
|
void |
| 81 |
|
quit( /* quit program */ |
| 82 |
|
int code |
| 238 |
|
pending |= (n > 1); // time to flush output? |
| 239 |
|
bool atZero = IsZeroVec(ivbuf[2*n-1]); |
| 240 |
|
if (pending & (atZero | (n == flushIntvl))) { |
| 241 |
< |
if (!myRTmanager.FlushQueue()) |
| 241 |
> |
if (myRTmanager.FlushQueue() <= 0) |
| 242 |
|
error(USER, "ray flush error"); |
| 243 |
|
fflush(stdout); |
| 244 |
|
pending = false; |
| 413 |
|
return(ncomp); |
| 414 |
|
} |
| 415 |
|
|
| 416 |
< |
static int |
| 416 |
> |
int |
| 417 |
|
printvals( /* print requested ray values */ |
| 418 |
|
RAY *r, void *cd |
| 419 |
|
) |
| 511 |
|
RAY *r |
| 512 |
|
) |
| 513 |
|
{ |
| 514 |
< |
putscolor(r->mcol); |
| 514 |
> |
putscolor(r->mcol, out_scalefactor); |
| 515 |
|
} |
| 516 |
|
|
| 517 |
|
static void |
| 532 |
|
copyscolor(cdiff, r->rcol); |
| 533 |
|
sopscolor(cdiff, -=, r->mcol); |
| 534 |
|
|
| 535 |
< |
putscolor(cdiff); |
| 535 |
> |
putscolor(cdiff, out_scalefactor); |
| 536 |
|
} |
| 537 |
|
|
| 538 |
|
static void |
| 548 |
|
RAY *r |
| 549 |
|
) |
| 550 |
|
{ |
| 551 |
< |
putscolor(r->rcol); |
| 551 |
> |
putscolor(r->rcol, out_scalefactor); |
| 552 |
|
} |
| 553 |
|
|
| 554 |
|
static void |
| 560 |
|
|
| 561 |
|
raycontrib(contr, r, PRIMARY); |
| 562 |
|
smultscolor(contr, r->rcol); |
| 563 |
< |
putscolor(contr); |
| 563 |
> |
putscolor(contr, out_scalefactor); |
| 564 |
|
} |
| 565 |
|
|
| 566 |
|
static void |
| 768 |
|
putbinary(cout, sizeof(cout), 1, stdout); |
| 769 |
|
} |
| 770 |
|
|
| 771 |
< |
static void |
| 772 |
< |
putscolor(COLORV *scol) /* output (spectral) color */ |
| 771 |
> |
void |
| 772 |
> |
putscolor(COLORV *scol, double sf) /* output (spectral) color */ |
| 773 |
|
{ |
| 774 |
|
static COLORMAT xyz2myrgbmat; |
| 775 |
|
SCOLOR my_scol; |
| 776 |
|
COLOR col; |
| 777 |
|
/* single channel output? */ |
| 778 |
|
if (sens_curve != NULL) { |
| 779 |
< |
RREAL v = (*sens_curve)(scol) * out_scalefactor; |
| 779 |
> |
RREAL v = (*sens_curve)(scol) * sf; |
| 780 |
|
(*putreal)(&v, 1); |
| 781 |
|
return; |
| 782 |
|
} |
| 783 |
< |
if (out_scalefactor != 1.) { /* apply scalefactor if any */ |
| 783 |
> |
if (sf != 1.) { /* apply scalefactor if any */ |
| 784 |
|
copyscolor(my_scol, scol); |
| 785 |
< |
scalescolor(my_scol, out_scalefactor); |
| 785 |
> |
scalescolor(my_scol, sf); |
| 786 |
|
scol = my_scol; |
| 787 |
|
} |
| 788 |
|
if (out_prims == NULL) { /* full spectral reporting */ |