[cairo] adding a new curve type to cairo

Paul Davis paul at linuxaudiosystems.com
Wed Jul 12 09:47:51 PDT 2006


greetings. the ardour project (http://ardour.org/ its a digital audio
workstation) is looking ahead just a little towards our move onto a
Cairo-based canvas for our editor. 

one of our interests is in getting "native" support from the graphics
library for a rather unique type of constrained spline that we use. at
the moment, we never draw these curves because (a) libart_lgpl does not
support them and (b) we would want them anti-aliased, which looks more
complex than any of our developers has wanted to tackle so far. instead,
we just draw straight line segments through the control points for the
splines.

the constrained spline is a brilliant little piece of work by a chemical
engineer from the UK. unlike regular splines, the curve never goes above
or below the control points, which makes it more useful for engineering
applications than regular splines. a paper on it can be found here:

	http://www.korf.co.uk/spline.pdf

source code that implements the spline within ardour can be found here:

    http://subversion.ardour.org/svn/ardour2/trunk/libs/ardour/curve.cc
	
ARDOUR::Curve::solve() generates the required coefficients, and
ARDOUR::Curve::get_vector() fills a floating point array with the y-
coordinates of the curve between two given x-coordinates.

i would be interested in an estimate of how hard it would be to add this
spline to cairo's primitives so that we can trivially get these
displayed with anti-aliasing on a cairo-based canvas?

many thanks to everyone working on cairo!

--p







More information about the cairo mailing list