287 |
|
} |
288 |
|
return; |
289 |
|
memerr: |
290 |
< |
quit("out of memory"); |
290 |
> |
quiterr("out of memory"); |
291 |
|
} |
292 |
|
|
293 |
|
|
373 |
|
sprintf(buf, "%.3f", intens(cval)/exposure); |
374 |
|
break; |
375 |
|
case 'l': /* luminance */ |
376 |
< |
sprintf(buf, "%.0fn", bright(cval)*683.0/exposure); |
376 |
> |
sprintf(buf, "%.0fn", luminance(cval)/exposure); |
377 |
|
break; |
378 |
|
case 'c': /* color */ |
379 |
|
comp = pow(2.0, (double)scale); |
548 |
|
|
549 |
|
if ((inl = (rgbpixel *)malloc(xmax*sizeof(rgbpixel))) == NULL |
550 |
|
|| (cerr = (short *)calloc(xmax,sizeof(short))) == NULL) |
551 |
< |
quit("out of memory in getmono"); |
551 |
> |
quiterr("out of memory in getmono"); |
552 |
|
dp = ourras->data.m - 1; |
553 |
|
for (y = 0; y < ymax; y++) { |
554 |
|
picreadline3(y, inl); |
635 |
|
if (scanpos == NULL || scanpos[y] == -1) |
636 |
|
return(-1); |
637 |
|
if (fseek(fin, scanpos[y], 0) == -1) |
638 |
< |
quit("fseek error"); |
638 |
> |
quiterr("fseek error"); |
639 |
|
cury = y; |
640 |
|
} else if (scanpos != NULL) |
641 |
|
scanpos[y] = ftell(fin); |
681 |
|
register int i, val; |
682 |
|
|
683 |
|
for (i = 0; i < 256; i++) { |
684 |
< |
val = pow(i/256.0, 1.0/gamcor) * 256.0; |
684 |
> |
val = pow((i+0.5)/256.0, 1.0/gamcor) * 256.0; |
685 |
|
map[0][i] = map[1][i] = map[2][i] = val; |
686 |
|
} |
687 |
|
} |