| 387 |
|
sprintf(buf, "%-3g", intens(cval)/exposure); |
| 388 |
|
break; |
| 389 |
|
case 'l': /* luminance */ |
| 390 |
< |
sprintf(buf, "%-3gL", bright(cval)*683.0/exposure); |
| 390 |
> |
sprintf(buf, "%-3gn", bright(cval)*683.0/exposure); |
| 391 |
|
break; |
| 392 |
|
case 'c': /* color */ |
| 393 |
|
comp = pow(2.0, (double)scale); |
| 401 |
|
fontid, BlackPixel, WhitePixel); |
| 402 |
|
return(0); |
| 403 |
|
case 'i': /* identify (contour) */ |
| 404 |
< |
if (ourras->ncolors == 0) |
| 404 |
> |
if (ourras->pixels == NULL) |
| 405 |
|
return(-1); |
| 406 |
|
n = ourras->data.bz[ekey->x-xoff+BZPixmapSize(xmax,ekey->y-yoff)]; |
| 407 |
|
n = ourras->pmap[n]; |
| 444 |
|
/* fall through */ |
| 445 |
|
case CTRL(R): /* redraw */ |
| 446 |
|
case CTRL(L): |
| 447 |
+ |
unmap_rcolors(ourras); |
| 448 |
|
XClear(wind); |
| 448 |
– |
XStoreColors(ourras->ncolors, ourras->cdefs); |
| 449 |
|
return(redraw(0, 0, width, height)); |
| 450 |
|
case ' ': /* clear */ |
| 451 |
|
return(redraw(box.xmin, box.ymin, box.xsiz, box.ysiz)); |
| 618 |
|
double sf; |
| 619 |
|
{ |
| 620 |
|
register int i; |
| 621 |
< |
int maxv; |
| 621 |
> |
long maxv; |
| 622 |
|
|
| 623 |
+ |
if (xr->pixels == NULL) |
| 624 |
+ |
return; |
| 625 |
+ |
|
| 626 |
|
sf = pow(sf, 1.0/gamcor); |
| 627 |
< |
maxv = (1<<16) / sf; |
| 627 |
> |
maxv = 65535/sf; |
| 628 |
|
|
| 629 |
|
for (i = xr->ncolors; i--; ) { |
| 630 |
< |
xr->cdefs[i].red = xr->cdefs[i].red >= maxv ? |
| 631 |
< |
(1<<16)-1 : |
| 630 |
> |
xr->cdefs[i].red = xr->cdefs[i].red > maxv ? |
| 631 |
> |
65535 : |
| 632 |
|
xr->cdefs[i].red * sf; |
| 633 |
< |
xr->cdefs[i].green = xr->cdefs[i].green >= maxv ? |
| 634 |
< |
(1<<16)-1 : |
| 633 |
> |
xr->cdefs[i].green = xr->cdefs[i].green > maxv ? |
| 634 |
> |
65535 : |
| 635 |
|
xr->cdefs[i].green * sf; |
| 636 |
< |
xr->cdefs[i].blue = xr->cdefs[i].blue >= maxv ? |
| 637 |
< |
(1<<16)-1 : |
| 636 |
> |
xr->cdefs[i].blue = xr->cdefs[i].blue > maxv ? |
| 637 |
> |
65535 : |
| 638 |
|
xr->cdefs[i].blue * sf; |
| 639 |
|
} |
| 640 |
< |
if (xr->pixels != NULL) |
| 638 |
< |
XStoreColors(xr->ncolors, xr->cdefs); |
| 640 |
> |
XStoreColors(xr->ncolors, xr->cdefs); |
| 641 |
|
} |
| 642 |
|
|
| 643 |
|
|