[SDL] drawing of an anti aliased circular arc

Will Langford unfies at gmail.com
Mon Mar 12 13:46:27 PDT 2007


Drawing the arc to another surface then super-sampling the anti-alias such
as SamuraiCrow suggested is probably your easiest solution.

If you've got a standard iterating arc drawing algorithm, you might be able
to take the error term and use it somehow to generate the partial pixels.
It'd be more difficult than a wu antialiased line, but I imagine something
is possible although the outcome might not be quite what you want.

-Will

On 3/12/07, SamuraiCrow <samuraileumas at yahoo.com> wrote:
>
> Armin Steinhoff <A-Steinhoff <at> web.de> writes:
>
> > I'm looking for an algorithm for drawing an anti aliased circular arc.
> >
> > Are there any pointers or sources of it ?
>
> The basic idea for 4 to 1 antialiasing is that you draw an image at 4
> times the
> resolution and then you merge them together by adding the reds, greens,
> and
> blues from each of the 4 adjacent pixels and then shift the result right
> by 2
> bits (to divide the result by four).
>
> Say for example these are your surface pixels:
>
> abcdefg
> hijklmn
>
> You would calculuate the color of the first destination pixel by doing
> (a+b+h+i)>>2 for the red, green, and blue pixel components individually
> (or,
> better still, use autovectoring in your compiler to do these operations in
> an
> SIMD configuration).  Likewise the second pixel in the destination surface
> would
> be (c+d+j+k)>>2 .
>
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20070312/d238c284/attachment.htm 


More information about the SDL mailing list