I'm currently working on a small vector graphics rasterizer to try out some different techniques. Basically, what I do is to take a spline outline consiting of straight lines and quadratic bezier curves, and fill that outline. I'm not satisfied with the performance and accuracy of my current scanline rasterizer...
The new approach is more similar to how triangles in "regular 3d graphics" are rasterized. I evaluate if pixels lie within a triangle by using the edge functions of the three edges (implicit line ax + by + c) and checking the sign.
But there are alot of bezier curves in the outline... It takes some time to convert the bezier curves into line segments (and then to proceed as described above).
So my question is, is there any way to rewrite a bezier curve into something that resembles the edge function? I can't seem to figure it out quite...
I've tried to rewrite a curve on the form ax + by + cx^2 + dx^2 + e (+ 0*xy) = 0, but it gets very messy, with roots and stuff which is not really cpu-friendly. I also tried converting the pixel coordinates to be evaluated into barycentric coordinates, but this also gets a bit messy, and I can't get rid of the divisions (two, one per coordinate)...
I'm very thankful for any help, or even just a hint in any direction, because I fell a bit stuck. I really feel like I'm overlooking something, and this really shouldn't be too difficult :/
I think I need a break and some coffee
Thanks in advance!