I should point out that example 20 now produces slightly different
results from the old version. The text on page 3 is now yellow not blue.
It looks like the old code did not properly restore the colour after
plotting the sombrero on page 1. Hez's changes have fixed this.

Andrew

On Sat, Jul 19, 2008 at 10:43:50PM +0100, Andrew Ross wrote:
> 
> Hez,
> 
> I've finally got round to looking at your plimagefr patch. Many
> apologies for the long delay! I've commited the patch with a few 
> changes (see below). Just to recap this adds transformation support to
> the plimagefr function so you can plot images with transformations.
> Example 20 is updated to demonstrate this. 
> 
> A few comments.
> 
> 1) Rather than changing comments to // to nest them inside /* ... */ I
> would suggest just using 
> #if 0
> ...
> #endif
> around the code block. (I've implemented this.) We try to avoid C++
> style comments in C code.
> 
> 2) I notice you commented out the call to plP_image in rdbug_image since
> the API has changed. This would break the plplot buffering of images
> to replay / replot figures. However on closer examination I deduced that
> this function isn't actually used with fast_img disabled. Fixing this is
> non-trivial since the pltr_data would need the data copying, but this is
> arbitrary data so plplot doesn't actually know what format the data is.
> Only the usea'rs pltr function needs to know this. I've clarified your
> comment to explain why this is commented out. If and when the
> dev_fastimg code is re-enabled this will need sorting out. 
> 
> 3) Your patch breaks various other language bindings. For now I have
> disabled plimagefr support in f77 / f95. These require a bit of work to
> support pltr and I've not had time today. If someone else would like to
> take this on it would be great. Hez, you might like to look at how
> plcont and plvect work (with internal plfcont and plfvect functions) to
> aid the f77 / f95 bindings. Best to make the plimagefr consistent. This
> will be an internal change for the C API though so I've gone ahead and
> commited your existing version for now. 
> 
> 4) Other languages will need plimagefr support adding once we've
> finalised the API. Also all (non-C) versions of example 20 will need
> updating.
> 
> 5) You example transformation in example 20 is quite subtle. Perhaps
> something like a shear would be more obvious and generally useful
> example? 
> 
> Thanks again for your contribution to plplot. The ability to plot
> transformed images is neat, and potentially useful to a lot of users.
> 
> Andrew
> 
> On Thu, May 29, 2008 at 04:17:11PM -0400, Hezekiah M. Carty wrote:
> > Here is a small revision to the previous plimage patch(es).  The only
> > internal change vs the last patch I posted is that plimage and
> > plimagefr now save and restore the color palette 0 color in use before
> > they are called.
> > 
> > The major difference between this patch and the last I posted to the
> > list is that I have updated the C example 20 to illustrate the
> > functionality of plimagefr.  Two new pages are added to the example:
> > 
> > - A cap on the dynamic range in an image plotted by plimagefr.  This
> > gives the image a saturated look.  Any values smaller than 25% of the
> > maximum value in the image are painted black, and any values larger
> > than 75% are painted white.
> > - A distortion example using plimagefr.  The example gives the image a
> > paint-stroke look.  This was not particularly intended, but the end
> > result is interesting.
> > 
> > Here is the pngcairo output of the (a) original plimage plot, (b) the
> > saturated plimagefr plot and (c) the distorted plimagefr plot:
> > a) http://0ok.org/images/plplot/plimage-normal.png
> > b) http://0ok.org/images/plplot/plimagefr-saturated.png
> > c) http://0ok.org/images/plplot/plimagefr-distorted.png
> > 
> > The description of the changes to the plimage internals by this patch
> > are copied below from my previous email.
> > 
> > > Several updates have been made to the PLplot Subversion source tree
> > > since I submitted my previous patches.  Here is an updated version of
> > > my coordinate transform support in plimagefr patch which should apply
> > > cleanly against the latest PLplot SVN revision.
> > >
> > > The changes introduced are:
> > > - Comment out the dev_fastimg rendering path - No code is removed,
> > > just commented out.
> > > - Add coordinate transform support to plimagefr (same structure as in
> > > the plshade functions)
> > > - Update api.xml with the above changes
> > >
> > > Some code was hoisted out of plimagefr and back in to plimage to clean
> > > things up a bit.  I also changed all of the comment to C style
> > > comments /* */ rather than C++ style // to match the rest of the
> > > PLplot code base.
> > >
> > > I ran some tests using example 20 compiled against PLplot 5.9.0 vs
> > > PLplot svn + this patch using the xwin display device to see what sort
> > > of difference the removal of the dev_fastimg rendering path makes.
> > > The difference in speed seems minimal if it exists at all.  This is on
> > > a Pentium-M 1.7ghz laptop under Debian Sid.
> > 
> > If there are any questions or concerns, please let me know.
> > 
> > Thanks,
> > Hez
> > 
> > -- 
> > Hezekiah M. Carty
> > Graduate Research Assistant
> > University of Maryland
> > Department of Atmospheric and Oceanic Science
> 
> 
> > -------------------------------------------------------------------------
> > This SF.net email is sponsored by: Microsoft
> > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > _______________________________________________
> > Plplot-devel mailing list
> > Plplot-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/plplot-devel
> 

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to