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"; |
55 |
|
char *dispname = NULL; /* our display name */ |
56 |
|
|
57 |
|
Window wind = 0; /* our output window */ |
58 |
< |
unsigned long ourblack=1, ourwhite=0; /* black and white for this visual */ |
58 |
> |
unsigned long ourblack=0, ourwhite=1; /* black and white for this visual */ |
59 |
|
Font fontid; /* our font */ |
60 |
|
|
61 |
|
int maxcolors = 0; /* maximum colors */ |
116 |
|
int argc; |
117 |
|
char *argv[]; |
118 |
|
{ |
119 |
+ |
extern char *getenv(); |
120 |
+ |
char *gv; |
121 |
|
int headline(); |
122 |
|
int i; |
123 |
|
|
124 |
|
progname = argv[0]; |
125 |
+ |
if ((gv = getenv("GAMMA")) != NULL) |
126 |
+ |
gamcor = atof(gv); |
127 |
|
|
128 |
|
for (i = 1; i < argc; i++) |
129 |
|
if (argv[i][0] == '-') |
244 |
|
CWBackPixel|CWBorderPixel|CWColormap, &ourwinattr); |
245 |
|
if (wind == 0) |
246 |
|
quiterr("cannot create window"); |
247 |
+ |
XFreeColormap(thedisplay, ourwinattr.colormap); |
248 |
|
width = xmax; |
249 |
|
height = ymax; |
250 |
|
ourgc = XCreateGC(thedisplay, wind, 0, 0); |
432 |
|
} else if (ourvis.class == PseudoColor) { |
433 |
|
ourblack = BlackPixel(thedisplay,ourscreen); |
434 |
|
ourwhite = WhitePixel(thedisplay,ourscreen); |
435 |
+ |
if ((ourblack|ourwhite) & ~255L) { |
436 |
+ |
ourblack = 0; |
437 |
+ |
ourwhite = 1; |
438 |
+ |
} |
439 |
|
} else { |
440 |
|
ourblack = 0; |
441 |
< |
ourwhite = ~0; |
441 |
> |
ourwhite = ourvis.red_mask|ourvis.green_mask|ourvis.blue_mask; |
442 |
|
} |
443 |
|
XFree((char *)xvi); |
444 |
|
} |
939 |
|
if (fseek(fin, scanpos[y], 0) == -1) |
940 |
|
quiterr("fseek error"); |
941 |
|
cury = y; |
942 |
< |
} else if (scanpos != NULL) |
942 |
> |
} else if (scanpos != NULL && scanpos[y] == -1) |
943 |
|
scanpos[y] = ftell(fin); |
944 |
|
|
945 |
|
if (freadcolrs(scanline, xmax, fin) < 0) |