Main Site Documentation

Project - SmoothLine Anti-aliasing line drawing with alpha blending


#1

I just posted SmoothLine Anti-aliasing line drawing with alpha blending on Codeshare. Feel free to discuss and make suggestions here.


#2

I like it. Well done


#3

This would be a nice addition to Tinkr :smiley:
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:


#4

Very Nice!

Thanks…


#5

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.

http://www.nondot.org/sabre/Mirrored/GraphicsProgrammingBlackBook/gpbb42.pdf


#6

Does it support different line thickness too? And may be patterns for dotted, … lines?


#7

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.


#8

That’s just something that would be really cool to draw shapes or line graphs.


#9

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.


#10

Hi peeps.

I have upgraded my smoothLine code to take advantage of the new RLP Bitmap functionality provided in 4.3.6.0 (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.