419 |
|
static void |
420 |
|
pixtoval(void) /* convert picture to values */ |
421 |
|
{ |
422 |
< |
register COLOR *scanln; |
422 |
> |
COLOR *scanln; |
423 |
|
int dogamma; |
424 |
|
COLOR lastc; |
425 |
|
RREAL hv[2]; |
426 |
|
int startprim, endprim; |
427 |
|
long startpos; |
428 |
< |
int y; |
429 |
< |
register int x; |
428 |
> |
int x, y; |
429 |
|
|
430 |
|
scanln = (COLOR *)malloc(scanlen(&picres)*sizeof(COLOR)); |
431 |
|
if (scanln == NULL) { |
492 |
|
static void |
493 |
|
valtopix(void) /* convert values to a pixel file */ |
494 |
|
{ |
495 |
< |
int dogamma; |
496 |
< |
register COLOR *scanln; |
497 |
< |
int y; |
498 |
< |
register int x; |
495 |
> |
int dogamma; |
496 |
> |
COLOR *scanln; |
497 |
> |
COLR rgbe; |
498 |
> |
int x, y; |
499 |
|
|
500 |
|
scanln = (COLOR *)malloc(scanlen(&picres)*sizeof(COLOR)); |
501 |
|
if (scanln == NULL) { |
524 |
|
pow(colval(scanln[x],BLU), gamcor)); |
525 |
|
if (doexposure) |
526 |
|
multcolor(scanln[x], exposure); |
527 |
+ |
if (uniq) { /* uncompressed? */ |
528 |
+ |
setcolr(rgbe, scanln[x][RED], |
529 |
+ |
scanln[x][GRN], |
530 |
+ |
scanln[x][BLU]); |
531 |
+ |
if (putbinary(rgbe, sizeof(COLR), 1, stdout) != 1) |
532 |
+ |
goto writerr; |
533 |
+ |
} |
534 |
|
} |
535 |
< |
if (fwritescan(scanln, scanlen(&picres), stdout) < 0) { |
536 |
< |
fprintf(stderr, "%s: write error\n", progname); |
537 |
< |
quit(1); |
532 |
< |
} |
535 |
> |
/* write scan if compressed */ |
536 |
> |
if (!uniq && fwritescan(scanln, scanlen(&picres), stdout) < 0) |
537 |
> |
goto writerr; |
538 |
|
} |
539 |
|
free((void *)scanln); |
540 |
+ |
return; |
541 |
+ |
writerr: |
542 |
+ |
fprintf(stderr, "%s: write error\n", progname); |
543 |
+ |
quit(1); |
544 |
|
} |
545 |
|
|
546 |
|
|
948 |
|
COLOR col |
949 |
|
) |
950 |
|
{ |
951 |
< |
register int i; |
951 |
> |
int i; |
952 |
|
uby8 vb; |
953 |
|
|
954 |
|
i = (*mybright)(col)*256.; |