SF.net SVN: matplotlib:[8457] trunk/matplotlib/src/_image.cpp
Revision: 8457 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8457&view=rev Author: mdboom Date: 2010-06-23 14:18:05 + (Wed, 23 Jun 2010) Log Message: --- Do image clipping of images in doubles rather than ints -- prevents the "disappearing image when zooming in too far" problem. Modified Paths: -- trunk/matplotlib/src/_image.cpp Modified: trunk/matplotlib/src/_image.cpp === --- trunk/matplotlib/src/_image.cpp 2010-06-22 19:30:57 UTC (rev 8456) +++ trunk/matplotlib/src/_image.cpp 2010-06-23 14:18:05 UTC (rev 8457) @@ -29,6 +29,7 @@ #include "agg_span_image_filter_rgb.h" #include "agg_span_image_filter_rgba.h" #include "agg_span_interpolator_linear.h" +#include "agg_rasterizer_sl_clip.h" #include "util/agg_color_conv_rgb8.h" #include "_image.h" #include "mplutils.h" @@ -350,7 +351,7 @@ pixfmt pixf(*rbufOut); renderer_base rb(pixf); rb.clear(bg); - agg::rasterizer_scanline_aa<> ras; + agg::rasterizer_scanline_aa ras; agg::scanline_u8 sl; ras.clip_box(0, 0, numcols, numrows); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[8458] trunk/matplotlib/src
Revision: 8458 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8458&view=rev Author: mdboom Date: 2010-06-23 14:43:52 + (Wed, 23 Jun 2010) Log Message: --- Uses doubles for rectangle clipping everywhere in the Agg backend. Modified Paths: -- trunk/matplotlib/src/_backend_agg.h trunk/matplotlib/src/_image.cpp Modified: trunk/matplotlib/src/_backend_agg.h === --- trunk/matplotlib/src/_backend_agg.h 2010-06-23 14:18:05 UTC (rev 8457) +++ trunk/matplotlib/src/_backend_agg.h 2010-06-23 14:43:52 UTC (rev 8458) @@ -55,7 +55,7 @@ typedef agg::renderer_base renderer_base; typedef agg::renderer_scanline_aa_solid renderer_aa; typedef agg::renderer_scanline_bin_solid renderer_bin; -typedef agg::rasterizer_scanline_aa<> rasterizer; +typedef agg::rasterizer_scanline_aa rasterizer; typedef agg::scanline_p8 scanline_p8; typedef agg::scanline_bin scanline_bin; Modified: trunk/matplotlib/src/_image.cpp === --- trunk/matplotlib/src/_image.cpp 2010-06-23 14:18:05 UTC (rev 8457) +++ trunk/matplotlib/src/_image.cpp 2010-06-23 14:43:52 UTC (rev 8458) @@ -39,7 +39,7 @@ typedef agg::pixfmt_rgba32 pixfmt; typedef agg::renderer_base renderer_base; typedef agg::span_interpolator_linear<> interpolator_type; -typedef agg::rasterizer_scanline_aa<> rasterizer; +typedef agg::rasterizer_scanline_aa rasterizer; Image::Image() : @@ -351,7 +351,7 @@ pixfmt pixf(*rbufOut); renderer_base rb(pixf); rb.clear(bg); - agg::rasterizer_scanline_aa ras; + rasterizer ras; agg::scanline_u8 sl; ras.clip_box(0, 0, numcols, numrows); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
SF.net SVN: matplotlib:[8459] trunk/matplotlib/lib/matplotlib/tests/ test_simplification.py
Revision: 8459 http://matplotlib.svn.sourceforge.net/matplotlib/?rev=8459&view=rev Author: mdboom Date: 2010-06-23 14:44:32 + (Wed, 23 Jun 2010) Log Message: --- Add unit test to ensure that rendering complexity exceeded exception is properly propagated to Python. Modified Paths: -- trunk/matplotlib/lib/matplotlib/tests/test_simplification.py Modified: trunk/matplotlib/lib/matplotlib/tests/test_simplification.py === --- trunk/matplotlib/lib/matplotlib/tests/test_simplification.py 2010-06-23 14:43:52 UTC (rev 8458) +++ trunk/matplotlib/lib/matplotlib/tests/test_simplification.py 2010-06-23 14:44:32 UTC (rev 8459) @@ -6,6 +6,10 @@ from pylab import * import numpy as np from matplotlib import patches, path, transforms + +from nose.tools import raises +import cStringIO + nan = np.nan Path = path.Path @@ -165,6 +169,24 @@ assert len(segs) == 1 assert segs[0][1] == Path.MOVETO +...@raises(OverflowError) +def test_throw_rendering_complexity_exceeded(): +rcParams['path.simplify'] = False + +xx = np.arange(20) +yy = np.random.rand(20) +yy[1000] = np.nan +fig = plt.figure() +ax = fig.add_subplot(111) +ax.plot(xx, yy) +try: +fig.savefig(cStringIO.StringIO()) +except e: +raise e +else: +rcParams['path.simplify'] = True + + if __name__=='__main__': import nose nose.runmodule(argv=['-s','--with-doctest'], exit=False) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. -- ThinkGeek and WIRED's GeekDad team up for the Ultimate GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the lucky parental unit. See the prize list and enter to win: http://p.sf.net/sfu/thinkgeek-promo ___ Matplotlib-checkins mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins
