1 |
– |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
– |
|
1 |
|
#ifndef lint |
2 |
< |
static char SCCSid[] = "$SunId$ LBL"; |
2 |
> |
static const char RCSid[] = "$Id$"; |
3 |
|
#endif |
6 |
– |
|
4 |
|
/* |
5 |
< |
* oki20c.c - program to dump pixel file to OkiMate 20 color printer. |
5 |
> |
* oki20.c - program to dump pixel file to OkiMate 20 printer. |
6 |
|
*/ |
7 |
|
|
8 |
|
#include <stdio.h> |
9 |
+ |
#include <time.h> |
10 |
|
|
11 |
+ |
#include "platform.h" |
12 |
+ |
#include "rtprocess.h" |
13 |
|
#include "color.h" |
14 |
|
#include "resolu.h" |
15 |
|
|
16 |
< |
#define NROWS 1440 /* 10" at 144 dpi */ |
17 |
< |
#define NCOLS 960 /* 8" at 120 dpi */ |
16 |
> |
#define NROWS 1440 /* 10" at 144 dpi */ |
17 |
> |
#define NCOLS 960 /* 8" at 120 dpi */ |
18 |
|
|
19 |
< |
#define ASPECT (120./144.) /* pixel aspect ratio */ |
19 |
> |
#define ASPECT (120./144.) /* pixel aspect ratio */ |
20 |
|
|
21 |
< |
#define FILTER "pfilt -1 -x %d -y %d -p %f %s",NCOLS,NROWS,ASPECT |
21 |
> |
#define FILTER "pfilt -1 -x %d -y %d -p %f %s",NCOLS,NROWS,ASPECT |
22 |
|
|
23 |
|
long lpat[NCOLS]; |
24 |
|
|
30 |
|
char *argv[]; |
31 |
|
{ |
32 |
|
int i, status = 0; |
33 |
< |
|
33 |
> |
SET_DEFAULT_BINARY(); |
34 |
> |
SET_FILE_BINARY(stdin); |
35 |
> |
SET_FILE_BINARY(stdout); |
36 |
|
if (argc > 1 && !strcmp(argv[1], "-p")) { |
37 |
|
dofilter++; |
38 |
|
argv++; argc--; |
39 |
|
} |
38 |
– |
#ifdef _IOLBF |
39 |
– |
stdout->_flag &= ~_IOLBF; |
40 |
– |
#endif |
40 |
|
if (argc < 2) |
41 |
|
status = printp(NULL) == -1; |
42 |
|
else |
145 |
|
putchar(i >> 8); |
146 |
|
for (i = start; i <= end; i++) { |
147 |
|
c = lpat[i]; |
148 |
< |
putchar(c>>16); |
149 |
< |
putchar(c>>8 & 255); |
150 |
< |
putchar(c & 255); |
148 |
> |
putchar((int)(c>>16)); |
149 |
> |
putchar((int)(c>>8 & 255)); |
150 |
> |
putchar((int)(c & 255)); |
151 |
|
if (y) /* repeat this row next time */ |
152 |
|
lpat[i] = (c & 1) << 23; |
153 |
|
else /* or clear for next image */ |