Does anyone know a decent algorithm for drawing a anti-aliased (smooth) quadratic bezier curves in a raster?
I could simply draw them as vectors and then copy the image to a raster..
Is there any clever yet freely available algorithm to draw the curve directly to the pixels?
I am currently using the algorithm implemented here:
http://www.bytearray.org/?p=67
quadBezier()
I am wondering if there is a way to change it to render anti-aliased bezier?
Thanks in advance.
I am doing this for learning purposes and because I am hoping it would be faster than using the copy pixels from a Shape option.
Here is an example showing the none-smooth bezier is faster than the regular bezier:
http://lab.generalrelativity.org/raster/
Implementing your own algorithm will almost certainly be slower than using
bitmapData.draw(shape).When you use
graphics.lineTo,graphics.curveToetc, you are constructing a model, but not actually drawing anything yet. It’s only after the shape gets added to the stage, and during the subsequent[render]phase that the model is traversed and pixels drawn by a fast algorithm written in C. When you usebitmapData.drawto draw a vector into a bitmap, it will use the same native code. So it isn’t as if you are drawing anything twice, as you might imagine, and it will be hard (or impossible) to beat for speed by implementing anything from scratch in AS3 alone.