1 |
< |
/* Copyright (c) 1991 Regents of the University of California */ |
1 |
> |
/* Copyright (c) 1992 Regents of the University of California */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ LBL"; |
10 |
|
|
11 |
|
#include <stdio.h> |
12 |
|
|
13 |
+ |
#ifdef MSDOS |
14 |
+ |
#include <fcntl.h> |
15 |
+ |
#endif |
16 |
+ |
|
17 |
|
#include "rasterfile.h" |
18 |
|
|
19 |
|
#include "color.h" |
20 |
|
|
21 |
< |
extern double atof(), pow(); |
21 |
> |
#include "resolu.h" |
22 |
|
|
23 |
+ |
extern double pow(); |
24 |
+ |
|
25 |
+ |
extern char *malloc(); |
26 |
+ |
|
27 |
|
double gamma = 2.2; /* gamma correction */ |
28 |
|
|
29 |
|
int bradj = 0; /* brightness adjustment */ |
40 |
|
struct rasterfile head; |
41 |
|
int reverse = 0; |
42 |
|
int i; |
43 |
< |
|
43 |
> |
#ifdef MSDOS |
44 |
> |
extern int _fmode; |
45 |
> |
_fmode = O_BINARY; |
46 |
> |
setmode(fileno(stdin), O_BINARY); |
47 |
> |
setmode(fileno(stdout), O_BINARY); |
48 |
> |
#endif |
49 |
|
progname = argv[0]; |
50 |
|
|
51 |
|
head.ras_type = RT_STANDARD; |
102 |
|
printargs(i, argv, stdout); |
103 |
|
fputformat(COLRFMT, stdout); |
104 |
|
putchar('\n'); |
105 |
< |
fputresolu(YMAJOR|YDECR, xmax, ymax, stdout); |
105 |
> |
fprtresolu(xmax, ymax, stdout); |
106 |
|
/* convert file */ |
107 |
|
pr2ra(head.ras_type); |
108 |
|
} else { |
109 |
|
/* get header info. */ |
110 |
|
if (checkheader(stdin, COLRFMT, NULL) < 0 || |
111 |
< |
fgetresolu(&xmax, &ymax, stdin) != (YMAJOR|YDECR)) |
111 |
> |
fgetresolu(&xmax, &ymax, stdin) < 0) |
112 |
|
quiterr("bad picture format"); |
113 |
|
/* write rasterfile header */ |
114 |
|
head.ras_magic = RAS_MAGIC; |