[SDL] drawing of an anti aliased circular arc
Armin Steinhoff
A-Steinhoff at web.de
Wed Mar 14 03:05:46 PDT 2007
Hi,
thanks to all responding to the anti aliasing issue.
There are a lot of patented algorthm ... so it looks like a mine field =:-]
Hope I will find a good solution ....
Regards
Armin
"Will Langford" <unfies at gmail.com> schrieb am 12.03.2007 21:46:46:
> 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
>
>
> -----------------------------------------------------------------
> _______________________________________________
> SDL mailing list
> SDL at lists.libsdl.org
> http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
>
_______________________________________________________________________
Viren-Scan für Ihren PC! Jetzt für jeden. Sofort, online und kostenlos.
Gleich testen! http://www.pc-sicherheit.web.de/freescan/?mc=022222
More information about the SDL
mailing list