|
From: Daniel J S. <dan...@ie...> - 2004-09-06 17:57:35
|
Dave Denholm wrote: >Daniel J Sebald <dan...@ie...> writes: > > > >>I didn't investigate that far. But I believe it is set up to impose >>one. (Whatever appears after the above code.) I know there is a bit >>of a conflict there, i.e., accepting the given window then trying to >>impose a colormap. But, if gnuplot doesn't provide the color map, >>what good is it? The plots will make no sense. >> >> > > >But if you are reusing the window in order to allow the owning app to >add it's own stuff, then that will make no sense.. > Not necessarily. If the app and gnuplot_x11 are in synch with the attributes of the window, the app could put something else on the window. I know it is far fetched, but you can't anticipate the various things programmers want to do. Maybe they want to print a graph in the bottom half of the screen, then overlay their own stuff in the top half of the image. >It definitely gets complicated if you try to use the existing >colormap. You have to mess around based on visual type : > Yes. In some sense, you almost have to give a protocol in the documentation, or whatever, that the user must create an X window of certain specifications, and then let gnuplot_x11 impose its color map. > if it's static (staticGray, staticColor, TrueColor) you can just ask > it to give you appropriate pixels given RGB. The server does the > lookup. > > But if it's dynamic (pseudoColor or DirectColor) then you can't ask > the X server to choose the nearest existing colour, which is a > pain. You can usually treat DirectColor as TrueColor. pseudocolor is > then the problem. When I was working on it, pseudocolor was pretty > common, but I suspect everyone uses truecolor these days. > > >I can't rememver if you can retrieve all the assigned pixels. > Probably, I recall using an X routine to PutPixel for the image stuff. X seems to have "opposites" for most of their routines, e.g., GetPixel. Dan |