1 |
< |
/* Copyright (c) 1997 Silicon Graphics, Inc. */ |
1 |
> |
/* Copyright (c) 1998 Silicon Graphics, Inc. */ |
2 |
|
|
3 |
|
#ifndef lint |
4 |
|
static char SCCSid[] = "$SunId$ SGI"; |
96 |
|
char *id; |
97 |
|
{ |
98 |
|
extern char *getenv(); |
99 |
< |
char *gv; |
99 |
> |
static RGBPRIMS myprims = STDPRIMS; |
100 |
> |
char *ev; |
101 |
|
double gamval = GAMMA; |
102 |
+ |
RGBPRIMP dpri = stdprims; |
103 |
|
int nplanes; |
104 |
|
XSetWindowAttributes ourwinattr; |
105 |
|
XWMHints ourxwmhints; |
132 |
|
ourwhite = WhitePixel(ourdisplay,ourscreen); |
133 |
|
} |
134 |
|
/* set gamma and tone mapping */ |
135 |
< |
if ((gv = XGetDefault(ourdisplay, "radiance", "gamma")) != NULL |
136 |
< |
|| (gv = getenv("DISPLAY_GAMMA")) != NULL) |
137 |
< |
gamval = atof(gv); |
138 |
< |
if (tmInit(mytmflags(), stdprims, gamval) == NULL) |
135 |
> |
if ((ev = XGetDefault(ourdisplay, "radiance", "gamma")) != NULL |
136 |
> |
|| (ev = getenv("DISPLAY_GAMMA")) != NULL) |
137 |
> |
gamval = atof(ev); |
138 |
> |
if ((ev = getenv("DISPLAY_PRIMARIES")) != NULL && |
139 |
> |
sscanf(ev, "%f %f %f %f %f %f %f %f", |
140 |
> |
&myprims[RED][CIEX],&myprims[RED][CIEY], |
141 |
> |
&myprims[GRN][CIEX],&myprims[GRN][CIEY], |
142 |
> |
&myprims[BLU][CIEX],&myprims[BLU][CIEY], |
143 |
> |
&myprims[WHT][CIEX],&myprims[WHT][CIEY]) >= 6) |
144 |
> |
dpri = myprims; |
145 |
> |
if (tmInit(mytmflags(), dpri, gamval) == NULL) |
146 |
|
error(SYSTEM, "not enough memory in dev_open"); |
147 |
|
/* open window */ |
148 |
|
ourwinattr.background_pixel = ourblack; |
262 |
|
} |
263 |
|
qtReplant(); |
264 |
|
return(1); |
265 |
+ |
} |
266 |
+ |
|
267 |
+ |
|
268 |
+ |
dev_auxcom(cmd, args) /* process an auxiliary command */ |
269 |
+ |
char *cmd, *args; |
270 |
+ |
{ |
271 |
+ |
sprintf(errmsg, "%s: unknown command", cmd); |
272 |
+ |
error(COMMAND, errmsg); |
273 |
+ |
} |
274 |
+ |
|
275 |
+ |
|
276 |
+ |
VIEW * |
277 |
+ |
dev_auxview(n, hvres) /* return nth auxiliary view */ |
278 |
+ |
int n; |
279 |
+ |
int hvres[2]; |
280 |
+ |
{ |
281 |
+ |
if (n) |
282 |
+ |
return(NULL); |
283 |
+ |
hvres[0] = odev.hres; hvres[1] = odev.vres; |
284 |
+ |
return(&odev.v); |
285 |
|
} |
286 |
|
|
287 |
|
|