? Xiaolin Wu's Anti-aliased Lines Algorithm ● SmileBASIC Source

Sign In

Register
*Usernames are case-sensitive
Forgot my password
This website has been moved, please see this post

Xiaolin Wu's Anti-aliased Lines Algorithm

Submitted
Updated
Author
HackTheWorlds
Public Key
5R3358KV
Min. Compat.
All
Version
1.0.0
Rating
4 votes
Description Draw anti-aliased lines in SmileBASIC! This program draws anti-aliased lines using Xiaolin Wu's line algorithm. I copied it almost verbatim so there is no optimization as of yet. Future Plans
  1. Color control
  2. Speed optimization
  3. Line thickness control
Instructions Run the example or use the command in your programs.
Categories
Keywords
  • anti-aliasing
  • algorithm
5 Comment(s) DFrost DFrost Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength I actually made an anti - aliasing algorithm a few days ago and it was insanely fast, but used sprites to work. a line from (0,0) to (200,20) @~1ms Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies Fantastic! This is interesting However, it is very slow, I ran some tests: On average it takes 9.87 milliseconds to draw a line across the screen GLINE takes 0.019 milliseconds to do the same thing So AALINE is approximately 496.33 times slower than GLINE It is still very interesting I'll definitely be studying this code in the future. hakke hakke RNG Hidden Easter Eggs QSP Contest 2 Contest Participant I participated in the second SmileBASIC Source QSP Contest! Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength But Simeon, you didnt say that antialiasing was practically putting a 1pixel radius blur? Simeon Simeon Scholar Received for knowing a great deal about programming topics Achievements Amazing Page Hidden Achievements Drawing I like to draw! Hobbies ¯\_(ツ)_/¯ Pass Lol jk, but that's slightly unrelated because actual developers have a huge advantage of resources as opposed to SmileBASICians 12Me21 12Me21 Syntax Highlighter Received for creating the code syntax highlighter on SBS Night Person I like the quiet night and sleep late. Express Yourself drawing a line with GPSET is already around 100 time slower than GLINE, so there's an upper limit to the speed of any alternate line drawing programs. However, this algorithm actually draws TWO pixels in each position, so it would be 200x slower than GLINE, at best.