meltingice/CamanJS — pull request #114 by bebraw (2013-10-09 14:41:30+00:00)
Title: Curves plugin - Support arbitrary amount of control points

I haven't tested it a lot. I mainly ran examples/browser/ and that seems to work ok. `Filter.curves` API looks the same as before. We just support arbitrary amount of control points. The original `...` was very handy this way.

The biggest changes were made to `Calculate.bezier`. In that case I shimmed it so that it works both using the new declaration ([control points], lowBound, upperBound) and the original one. The docs point at the new one. I suggest you drop the shim at 5.0.

The algorithm itself is really simple. It's just an implementation of de Casteljau's algorithm. I suspect it's slower with low amount of control points but I'm not sure if that's really an issue. If it is, you might want to add back the old implementation and revert to that with a low amount of control points (<= 4) and use this one otherwise.

Closes #43.