[cairo] Isn't there a way to pass multiple points to Cairo? (sorry for duplicate)

Jonathan Morton jonathan.morton at movial.com
Fri Aug 5 04:52:38 PDT 2011


On Thu, 2011-08-04 at 21:47 +0200, Andrej Mitrovic wrote:
> Yeah this was completely my mistake, this is not how waveforms should be drawn.
> 
> The stroking is what took most of the time, not the function calls.
> The trick is apparently to use an average (or absolute) min and max of
> several samples and then draw a vertical line between the min and max.
> And when the waveform is zoomed in the lines can be drawn from one
> point to another without them overlapping each other, which speeds up
> drawing again.

Another technique you could consider is to use those min-max points to
define the edge of a single, continuous shape.  If you both fill and
stroke that shape with the same colour, it will always be visible even
if the local amplitude goes to zero, and depending on the width of your
subsampling filter, it should be a lower rendering load than stroking
many vertical lines.

-- 
------
From: Jonathan Morton
      jonathan.morton at movial.com




More information about the cairo mailing list