开发者

Antialiasing algorithm

I'm looking for a good way to antialias a bitmap i'm generating with actionscript3. My goal would be to achieve this processing from scratch.

I read a lot on the subject but the most common algorithm are looking too heavy to work properly within my swf, because i'm using a scale2x algorithm to smooth the edges of my shape. It doesn't have to be colorfull, since my shape is black and whit开发者_如何转开发e !

Any hint would be appreciated, thanks :)


Xiaolin Wu's line algorithm is what you could use. It is fast and easy to implement.


Draw your shape at 2x the size, then simply scale it down to 1/2 the size, relying on Flash itself to do the smoothing. If you need more smoothing, increase the factors (3x + 1/3, etc). You didn't give very many details on what exactly you are drawing, so this may or may not be fast enough, you'll have to try it out.

PS: In the future, if you want more answers to your questions, don't mark one of the answers as accepted. People will skip your question if they see you already accepted one answer.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜