--- ray/src/px/ra_pict.c 1993/06/04 14:47:37 2.6 +++ ray/src/px/ra_pict.c 2003/06/05 19:29:34 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_pict.c,v 2.9 2003/06/05 19:29:34 schorsch Exp $"; #endif - /* Convert an Radiance image to APPLE pict format. * * Orginally Iris to PICT by Paul Haeberli - 1990 @@ -21,20 +18,17 @@ static char SCCSid[] = "$SunId$ LBL"; #include #include -#ifdef MSDOS -#include -#endif +#include +#include "platform.h" #include "pict.h" #include "color.h" #include "resolu.h" -extern char *malloc(); - int outbytes; /* This had better be 32 bits! */ char *progname; int verbose = 0; -float gamma = 2.0; +float gamcor = 2.0; int bradj = 0; /* First some utility routines */ @@ -101,18 +95,15 @@ char **argv; int xsize, ysize; int i, picsize; int ssizepos, lsizepos; -#ifdef MSDOS - extern int _fmode; - _fmode = O_BINARY; - setmode(fileno(stdin), O_BINARY); - setmode(fileno(stdout), O_BINARY); -#endif + SET_DEFAULT_BINARY(); + SET_FILE_BINARY(stdin); + SET_FILE_BINARY(stdout); progname = argv[0]; for (i = 1; i < argc ; i++) if (argv[i][0] == '-') switch (argv[i][1]) { - case 'g': gamma = atof(argv[++i]); + case 'g': gamcor = atof(argv[++i]); break; case 'e': if (argv[i+1][0] != '+' && argv[i+1][0] != '-') @@ -158,7 +149,7 @@ outofparse: #ifdef DEBUG fprintf(stderr, "Input file: %s\n", i <= argc - 1 ? argv[i] : "stdin"); fprintf(stderr, "Outut file: %s\n", i <= argc - 2 ? argv[i+1] : "stdout" ); - fprintf(stderr, "Gamma: %f\n", gamma); + fprintf(stderr, "Gamma: %f\n", gamcor); fprintf(stderr, "Brightness adjust: %d\n", bradj); fprintf(stderr, "Verbose: %s\n", verbose ? "on" : "off"); #endif @@ -173,7 +164,7 @@ outofparse: /* Set the gamma correction */ - setcolrgam(gamma); + setcolrgam(gamcor); for(i=0; i