On Fri, Oct 15, 2010 at 11:46 PM, Eric Firing <efir...@hawaii.edu> wrote:
> On 10/15/2010 04:37 PM, Michiel de Hoon wrote:
> > Hello,
> >
> > Recently I tried to get animations to work for the Mac OS X backend with
> the new timer framework by implementing a TimerMac class that inherits from
> backend_bases.TimerBase. This seems to work fine; the code is uploaded to
> SVN if you'd like to try it.
> >
> > I am not sure what to do about blitting though. I can imagine two uses
> for blitting: Either to make sure that the next figure appears
> instantaneously as a whole after it has been drawn off-screen, or to
> precalculate a background figure that is used repeatedly, and upon which the
> changing parts of the figure are drawn.
> >
> > The latter would make sense for the Mac OS X backend also, but the former
> would not. Effectively, because of double buffering in Quartz all figures
> are automatically blitted already.
> >
> > So my question is: What is the purpose of blitting for animations in
> matplotlib?
>
> As far as I know, it is only the second--speeding up the animation by
> not having to recalculate and redraw so much.
>
> Eric
>
>
Just to add information here. In an animation, you have to draw each
frame. The actual process of displaying that draw (between the graphics
card and the monitor) is very fast, however, the process of calculating the
draw by the graphics card slow (relative to the display part).
So, imagine your mouse cursor moving across your screen, technically that is
an animation of sorts. If everything else on the screen is static, the
graphics card can keep the draw information for the static background in
memory and then only bother to recalculate the draw for the mouse cursor and
put that data into the appropriate place in the data of the static
background.
Note, it is important to use the 'animated=True' kwarg for the collections
and plots that will be non-static in order to take advantage of blitting.
Any plot object that is tagged as animated will have their rendering
deferred until explicitly told to draw.
Note that blitting isn't always a time-saver. If most of your image is
animated and there is very little static background information, the
overhead of blitting will impact your rendering performance. However, for
most purposes of matplotlib, blitting will improve animation performance.
I hope this is informative,
Ben Root
------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel