--- ray/src/px/oki20c.c 1992/07/03 10:46:25 2.8 +++ ray/src/px/oki20c.c 2003/06/05 19:29:34 2.12 @@ -1,49 +1,49 @@ -/* Copyright (c) 1992 Regents of the University of California */ - #ifndef lint -static char SCCSid[] = "$SunId$ LBL"; +static const char RCSid[] = "$Id: oki20c.c,v 2.12 2003/06/05 19:29:34 schorsch Exp $"; #endif - /* * oki20c.c - program to dump pixel file to OkiMate 20 color printer. */ #include +#include +#include "platform.h" #include "color.h" #include "resolu.h" -#define NROWS 1440 /* 10" at 144 dpi */ -#define NCOLS 960 /* 8" at 120 dpi */ +#define NROWS 1440 /* 10" at 144 dpi */ +#define NCOLS 960 /* 8" at 120 dpi */ -#define ASPECT (120./144.) /* pixel aspect ratio */ +#define ASPECT (120./144.) /* pixel aspect ratio */ -#define FILTER "pfilt -1 -x %d -y %d -p %f %s",NCOLS,NROWS,ASPECT +#define FILTER "pfilt -1 -x %d -y %d -p %f %s",NCOLS,NROWS,ASPECT /* - * Subtractive primaries are ordered: Yellow, Magenta, Cyan. + * Subtractive primaries are ordered: Yellow, Magenta, Cyan. */ -#define sub_add(sub) (2-(sub)) /* map subtractive to additive pri. */ +#define sub_add(sub) (2-(sub)) /* map subtractive to additive pri. */ long lpat[NCOLS][3]; int dofilter = 0; /* filter through pfilt first? */ +extern FILE *popen(); + main(argc, argv) int argc; char *argv[]; { int i, status = 0; - + SET_DEFAULT_BINARY(); + SET_FILE_BINARY(stdin); + SET_FILE_BINARY(stdout); if (argc > 1 && !strcmp(argv[1], "-p")) { dofilter++; argv++; argc--; } -#ifdef _IOLBF - stdout->_flag &= ~_IOLBF; -#endif if (argc < 2) status = printp(NULL) == -1; else @@ -146,9 +146,9 @@ int y; } for (i = 0; i < len; i++) { c = lpat[i][j] | colbit(scan[i],i,j); - putchar(c>>16); - putchar(c>>8 & 255); - putchar(c & 255); + putchar((int)(c>>16)); + putchar((int)(c>>8 & 255)); + putchar((int)(c & 255)); if (y) /* repeat this row */ lpat[i][j] = (c & 1) << 23; else /* or clear for next image */