From: Olof S. <sve...@es...> - 2002-01-07 14:56:44
|
Hi João, I have started to work on making the Windows plplot device win3 a fast image device. I can now run the x20c example on Windows and the device is fast. However, before sending Alan the patch I'd like to make a couple of suggestions for plimage. I have discussed these suggestions with Alessandro and he have no objections. My primary concern about the current implementation of plimage is use of memory. Here at the ESRF we would like to use plimage to plot relatively large images, i.e. up to 2000 x 2000 pixels. One can do this with the current implementation however it uses a lot of memory and the buffering of the image takes quite some time. In order to solve this problem I have the following two suggestions: 1. I'd like to remove the two arrays containing the X and Y co-ordinates for every pixel. From what I can see in the code these arrays are not yet used - please correct me if I'm wrong. If I understood Alessandro right the idea was that these arrays could be used to plot 2D data that were not on a regular grid. I understand that this is desirable in some circumstances, I have myself worked with correcting 2D detector data for spatial distortion. However, I think it is wrong to delegate this task to plimage. I believe that it is better to have this code outside plimage, e.g. to have a function that accepts as arguments the image and the co-ordinates for each pixel and then creates a new image which can be sent to plimage. 2. I'd also like to go back to having the possibility of sending an image as a PLFLT * instead as a PLFLT **. I understand that it is easy to handle 2D data with plplot in the PLFLT ** format. However, large images are most conveniently stored as PLFLT * in C. Using a PLFLT * pointer has the advantage that it can be passed directly to a fast image device, thus avoiding allocating memory. This pointer could also be saved by plbuf_image instead of saving the whole image. (A solution could be to add a new plimage function in plplot. The "old" plimage could still be used with the PLFLT ** argument. The "new" plimage could accept a PLFLT * argument and not allocate any extra memory, except needed by the fast image device.) What do you think? Regards, Olof |