--- ray/src/px/ra_pr24.c 1992/09/23 09:17:53 2.4 +++ ray/src/px/ra_pr24.c 2003/02/22 02:07:28 2.9 @@ -1,9 +1,6 @@ -/* Copyright (c) 1992 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: ra_pr24.c,v 2.9 2003/02/22 02:07:28 greg Exp $"; #endif - /* * program to convert between RADIANCE and 24-bit rasterfiles. */ @@ -14,18 +11,18 @@ static char SCCSid[] = "$SunId$ LBL"; #include #endif +#include + +#include + #include "rasterfile.h" #include "color.h" #include "resolu.h" -extern double pow(); +double gamcor = 2.2; /* gamma correction */ -extern char *malloc(); - -double gamma = 2.2; /* gamma correction */ - int bradj = 0; /* brightness adjustment */ char *progname; @@ -53,7 +50,7 @@ char *argv[]; if (argv[i][0] == '-') switch (argv[i][1]) { case 'g': - gamma = atof(argv[++i]); + gamcor = atof(argv[++i]); break; case 'e': if (argv[i+1][0] != '+' && argv[i+1][0] != '-') @@ -80,11 +77,11 @@ char *argv[]; exit(1); } if (i == argc-2 && freopen(argv[i+1], "w", stdout) == NULL) { - fprintf(stderr, "can't open output \"%s\"\n", + fprintf(stderr, "%s: can't open output \"%s\"\n", progname, argv[i+1]); exit(1); } - setcolrgam(gamma); + setcolrgam(gamcor); if (reverse) { /* get header */ if (fread((char *)&head, sizeof(head), 1, stdin) != 1) @@ -99,6 +96,7 @@ char *argv[]; || head.ras_depth != 24) quiterr("incompatible format"); /* put header */ + newheader("RADIANCE", stdout); printargs(i, argv, stdout); fputformat(COLRFMT, stdout); putchar('\n'); @@ -176,7 +174,7 @@ int pad; quiterr("error writing Radiance picture"); } /* free scanline */ - free((char *)scanout); + free((void *)scanout); } @@ -222,5 +220,5 @@ int pad; quiterr("error writing rasterfile"); } /* free scanline */ - free((char *)scanin); + free((void *)scanin); }