Skip to content

X11 Device Driver

5 messages · Ross Ihaka, Brian Ripley, Friedrich Leisch +1 more

#
I have made some modifications to the X11 graphics driver so that it is
more flexible about its use of colors.  I have added a new parameter to
the X11/x11 function which controls this.  The parameter is currently
called "colormodel" and works as follows:

	colormodel = 0		Monochrome graphics
	colormodel = 1		Grayscale (256 shades)
	colormodel = 2		Pseudocolor1
	colormodel = 3		Pseudocolor2
	colormodel = 4		Truecolor

Pseudocolor1 allocates as big a color cube as possible and then
approximates requested colors with colors from the cube.

Pseudocolor2 allocates colors "on-demand" until it runs out of
colors.  You then get a "can't allocate colors" error message.

More sophisticated devices will support the color models of less
sophisticated devices.  E.g. you can do grey-scale and pseudocolor
on a truecolor device.

So, one question is:  How should this functionality be packaged?

One possibility is to have multiple X11 device driver entry points

    X11.mono, X11.gray, X11.pseudo1, X11.pseudo2, X11.color

This would be useful because people could use options() to set
the appropriate default device.

Another possibility would be to have use an additional argument to
the driver and to make it rather more meaningful than 0, 1, 2, 3, 4.

Perhaps there are better ideas also.

A second question is what should the default behavior be on Pseudocolor
devices; Pseudocolor1 or Pseudocolor2?

Would anyone care to express an opinion.  I'd like to get this commited
for the 0.64 release.

	Ross

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Fri, 2 Apr 1999, Ross Ihaka wrote:

            
I would prefer a single driver, with (effectively)

X11(display = "", width = 7, height = 7, pointsize = 12, 
    colortype=options()$X11colortype)

and choosing type from "mono", "gray", "pseudo.cube", "pseudo", "true"
as appropriate.
Pseudocolor2, please.  I very rarely have a problem (but then I have
netscape and gs under control).
Yes, please.
#
RI> I have made some modifications to the X11 graphics driver so that it is
RI> more flexible about its use of colors.  I have added a new parameter to
RI> the X11/x11 function which controls this.  The parameter is currently
RI> called "colormodel" and works as follows:

RI> 	colormodel = 0		Monochrome graphics
RI> 	colormodel = 1		Grayscale (256 shades)
RI> 	colormodel = 2		Pseudocolor1
RI> 	colormodel = 3		Pseudocolor2
RI> 	colormodel = 4		Truecolor

RI> Pseudocolor1 allocates as big a color cube as possible and then
RI> approximates requested colors with colors from the cube.

don't know if that's possible, but how hard would it be to optionally
limit the size of the cube? I have something in mind like only
allowing 64 colors or whatever to be able to start other applications
(and leaving them some room in the colormap) after R has started.

Netscape.maxImageColors worked always fine for me ...


.f
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Fri, 2 Apr 1999, Friedrich Leisch wrote:

            
It'll be easy enough to add a maxcolors= argument, with a
default of 256.

Any other requests from anyone while I'm at it?

	Ross

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
#
On Fri, 2 Apr 1999, Ross Ihaka wrote:

            
I'd prefer this one
I would go for allocating colors on demand, especially if we can print out
a message suggesting the color cube driver when colors run out.

	-thomas


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._