I just posted SmoothLine Anti-aliasing line drawing with alpha blending on Codeshare. Feel free to discuss and make suggestions here.
I like it. Well done
This would be a nice addition to Tinkr
I already thought about a canvas control where you can easily draw shapes like lines, circles, …
AA and alpha would be great for that.
If there would be just someone to implement this :whistle:
After a bit of thought I’ve decided the next step when I get time is to convert this to fixed point math. This should hopefully make it much faster. Then I might add a smooth circle and ellipse and maybe a sub-pixel dot.
I just found this excellent article about wu lines from the 386 PC era. It’s got a really good explanation of how it works as well as some wise words about fried chicken.
Does it support different line thickness too? And may be patterns for dotted, … lines?
I’ll see what I can do, but the patterned lines might be very difficult to implement efficiently. Thick lines would be very hard on ellipses and circles due to the boundary conditions when the steepness of the line changes past 45deg.
That’s just something that would be really cool to draw shapes or line graphs.
I have now updated this code to use fixed point math. This gives a nice speed up.
Also I have implemented gamma correction to reduce the rope effect that was sometimes visible on shallow angled lines.
I have upgraded my smoothLine code to take advantage of the new RLP Bitmap functionality provided in 188.8.131.52 (4.3 Release 5 2014).
The new code fixes a small alignment bug and is now only 3x slower than the standard drawLine function, but with all the anti-aliasing, alpha-blending and gamma correction goodness.
Please post a note here if you use this code.