|
From: Olof S. <sve...@es...> - 2002-01-11 16:42:45
|
Joao Cardoso wrote:
>
> What about "plimage" for the new function and "plimagefe" (front end) for the
> current one? Or, if compatibility with PGPLOT is not mandatory, "plimages"
> (straight) for the new function? hum, this could be misleading, Pick your own
> names, I'm not concerned with that.
How about calling the existing function "plgridimage" and the new
function "plimage"? You could even think of make it possible to pass
the list of co-ordinates for the pixels (however I have no idea
if this would be useful or not...):
plimage(PLFLT *idata, PLINT nx, PLINT ny,
PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
PLFLT Dxmin, PLFLT Dxmax, PLFLT Dymin, PLFLT Dymax)
plgridimage(PLFLT **idata, PLFLT *x, PLFLT *y, PLINT nx, PLINT ny,
PLFLT xmin, PLFLT xmax, PLFLT ymin, PLFLT ymax,
PLFLT Dxmin, PLFLT Dxmax, PLFLT Dymin, PLFLT Dymax)
> Yesterday I though that plimage() structure was steady, but today I'm not
> certain of that. It looks like that it is not possible to save a displayed
> image in another format, opening another device and replaying the plot
> buffer. (Using the standard plmkstrm/plcpstrm/plreplot/plend1 way of saving
> plots).
I noticed a problem when resizing a plot with several subplots
containing images - Alessandro and I solved this problem by saving
and restoring the Dxmin etc parameters in plbuf_image and rdbuf_image.
Here's the patch:
--- plplot/drivers/plbuf.c Thu Jan 10 06:39:36 2002
+++ plplot_new/drivers/plbuf.c Fri Jan 11 17:27:18 2002
@@ -230,6 +230,10 @@
fwrite(pls->dev_ix, sizeof(PLINT), (pls->dev_nptsX)*(pls->dev_nptsY), pls->plbufFile);
fwrite(pls->dev_iy, sizeof(PLINT), (pls->dev_nptsX)*(pls->dev_nptsY), pls->plbufFile);
fwrite(pls->dev_z, sizeof(PLFLT), (pls->dev_nptsX-1)*(pls->dev_nptsY-1), pls->plbufFile);
+ fwrite(&pls->Dxmin, sizeof(PLINT), 1, pls->plbufFile);
+ fwrite(&pls->Dxmax, sizeof(PLINT), 1, pls->plbufFile);
+ fwrite(&pls->Dymin, sizeof(PLINT), 1, pls->plbufFile);
+ fwrite(&pls->Dymax, sizeof(PLINT), 1, pls->plbufFile);
}
/*--------------------------------------------------------------------------*\
@@ -553,6 +557,11 @@
fread(dev_ix, sizeof(PLINT), npts, pls->plbufFile);
fread(dev_iy, sizeof(PLINT), npts, pls->plbufFile);
fread(dev_z, sizeof(PLFLT), (nptsX-1)*(nptsY-1), pls->plbufFile);
+
+ fread(&pls->Dxmin, sizeof(PLINT), 1, pls->plbufFile);
+ fread(&pls->Dxmax, sizeof(PLINT), 1, pls->plbufFile);
+ fread(&pls->Dymin, sizeof(PLINT), 1, pls->plbufFile);
+ fread(&pls->Dymax, sizeof(PLINT), 1, pls->plbufFile);
plP_image(dev_ix, dev_iy, dev_z, nptsX, nptsY);
Maybe the problem you site above can be solved by the same patch.
> But the modifications should be minor, so you can start to code your
> modifications and send a patch.
Ok, if you agree on the naming and argument scheme above I'll start making a patch.
> PS-Did you see the current know bugs of plimage, described in a comment in
> x20c.c?
Well, (* blush *) I must admit that I read the code of x20c but skipped the
comments (like a compiler). I'll look more carefully on the comments next time!
Regards,
Olof
|