|
From: Daniel J S. <dan...@ie...> - 2004-09-27 20:52:20
|
Petr,
Daniel J Sebald wrote:
> My thought was as follows: PaletteMake creates a cmap structure:
>
>
>
> typedef struct cmap_t {
> Colormap colormap;
> unsigned long colors[Ncolors]; /* line colors */
> #ifdef PM3D
> unsigned long xorpixel; /* line colors */
> int total;
> int allocated;
> unsigned long *pixels; /* pm3d colors */
> #endif
> } cmap_t;
I'm thinking that in the case that a palette comes across the pipe and
it is different from that of the current_plot, the palette code should
also search the linked list for a colormap that matches the one sent
across the pipe. It doesn't seem too far-fetched to me that someone
experimenting with color maps would go back and forth between maps a lot
of times. The result could be, similar to the previous discussion, the
same color map stored in memory many, many times.
So does it seem worthwhile including inside the above structure an
instance of t_sm_palette, so that we may have quick comparisons in the
case of palettes that are a color formula as opposed to user-defined
gradients? (Of course, I wouldn't store the gradient colors *and* the
color map pixels because that would be real bloat.) Or should we just
stick to what I described previously, and if someone has a lot of varied
palettes of very large size visible and is switching back and forth
between them they will just have to live with it.
In some sense, for harmony or parsimony, or whatever you want to call
it, between gnuplot_x11 and gnuplot, the frequency of sending the
palette over the link should match how often gnuplot_x11 really needs
it. As Ethan pointed out, there are couple schemes:
The basic layout of gnuplot_x11 is that commands are read from the input
stream and either
(a) executed immediately (e.g. "close window #5")
or (b) stored in a list to be executed every time the current plot is redrawn.
In the former case, gnuplot should only be sending over the palette when
it changes. In the latter, gnuplot should send every time so that it
goes into the plot buffer. Right now, gnuplot_x11 is set up for (a),
but gnuplot sends the palette every time a plot is done. That would
prevent gnuplot_x11 from testing every plot if the palette changed.
Just nit-picking I guess.
Dan
|