Re: [pygame] multi-width aalines and aacircles

2009-03-30 Thread Lenard Lindstrom
I backported pygame2.sdlgfx.primitives back into Pygame just as a quick and dirty way to try out SDL_gfx. I made it optional, like movieext, so we could decide if we should keep it as is. Though at first glance gfxdraw appears to differ from the draw module, having no line width argument for in

Re: [pygame] multi-width aalines and aacircles

2009-03-29 Thread pymike
Yeah the svg one is a bit fuzzy, but the pygame one is just really messy looking. The function you pointed to - isn't that for normal 1px width aalines? Is it not possible to extend it to aapolygons? -- - pymike

Re: [pygame] multi-width aalines and aacircles

2009-03-29 Thread René Dudfield
hi, it looks like there's one step in the pygame one which misses the aa part.  If you zoom in on the image, you can see it fairly well. The svg one has way more transparent pixels - and looks a bit fuzzy, even jaggy in some parts(bottom lines going high left, to low right). You can see the sou

Re: [pygame] multi-width aalines and aacircles

2009-03-29 Thread Zack Schilling
The pygame line looks like there's something wrong with it. There are very few faded pixels at all. It's essentially not anti-aliased. -Zack On Mar 29, 2009, at 11:12 AM, pymike wrote: I think if you look at a real SVG aaline... http://upload.wikimedia.org/wikipedia/commons/thumb/8/8f/Simp

Re: [pygame] multi-width aalines and aacircles

2009-03-29 Thread pymike
I think if you look at a real SVG aaline... http://upload.wikimedia.org/wikipedia/commons/thumb/8/8f/Simple_polygon.svg/588px-Simple_polygon.svg.png ...then look at the pygame one... http://rene.f0o.com/~rene/stuff/aapolygon.png ...the latter loo

Re: [pygame] multi-width aalines and aacircles

2009-03-28 Thread René Dudfield
hi again, Or for the draw stuff... We could just include these two files: src/SDL_gfx/SDL_gfxPrimitives.c src/SDL_gfx/SDL_gfxPrimitives.h Then use this in Setup GFX = src/SDL_gfx/SDL_gfxPrimitives.c gfxdraw src/gfxdraw.c $(SDL) $(GFX) $(DEBUG) I added those two files in that directory t

Re: [pygame] multi-width aalines and aacircles

2009-03-28 Thread René Dudfield
Hi, very cool module :) I uploaded some png's for people to see: http://rene.f0o.com/~rene/stuff/aapolygon.png http://rene.f0o.com/~rene/stuff/aacircle.png However, with ubuntu SDL_gfx I get this error: >>> import pygame.gfxdraw Traceback (most recent call last): File "", line 1, in Import

Re: [pygame] multi-width aalines and aacircles

2009-03-25 Thread pymike
Hmm. Still doesn't looks pretty rough. For aapolygons, can't you just take SDL_gfx's method for antialiasing lines and apply it to the edges of the polygon, and do the same thing for normal lines with widths? Or will the algorithm only work with 1px wide lines? I'll do some googling on aa algorith

Re: [pygame] multi-width aalines and aacircles

2009-03-25 Thread Lenard Lindstrom
You can see for yourself: http://www3.telus.net/len_l/pygame/gfx_antialiasing.tar.gz Because of a bug aapolygon_gfx.py will not work with the gfx enabled Windows binaries I have provide. The latest Pygame out of SVN is needed. But you can still look at the images I took from a screen shot. L

Re: [pygame] multi-width aalines and aacircles

2009-03-25 Thread Lenard Lindstrom
We could shamelessly rip off their code. :-). Actually AGG is intended for high-quality rendering. Though the developers claim it is still fast, it may still not be fast enough for game usage. Lenard René Dudfield wrote: c++ On Wed, Mar 25, 2009 at 10:27 PM, niki wrote: René Dudfield w

Re: [pygame] multi-width aalines and aacircles

2009-03-25 Thread Lenard Lindstrom
Try the default Feather to 1.0, the default. But you are probably right. Lenard pymike wrote: Meh, doesn't look like aa to me, just a nice blur. Takes a while to load too :S Pre-rendered aa stuff is more or less useless. On Wed, Mar 25, 2009 at 4:02 PM, Lenard Lindstrom

Re: [pygame] multi-width aalines and aacircles

2009-03-25 Thread pymike
Meh, doesn't look like aa to me, just a nice blur. Takes a while to load too :S Pre-rendered aa stuff is more or less useless. On Wed, Mar 25, 2009 at 4:02 PM, Lenard Lindstrom wrote: > Ian Mallett wrote: > >> On Wed, Mar 25, 2009 at 11:47 AM, RB[0] > roeb...@gmail.com>> wrote: >> >>You coul

Re: [pygame] multi-width aalines and aacircles

2009-03-25 Thread Lenard Lindstrom
Ian Mallett wrote: On Wed, Mar 25, 2009 at 11:47 AM, RB[0] > wrote: You could do a filled polygon and then an aa one around it... My suggestion exactly. Too bad this doesn't work with circles... But I think then you'd be getting a lot slower... Well, here's

Re: [pygame] multi-width aalines and aacircles

2009-03-25 Thread Ian Mallett
You might want to try drawing in orthagonally, and then rotating it as a single surface.

Re: [pygame] multi-width aalines and aacircles

2009-03-25 Thread Lenard Lindstrom
That was what I saw when I first drew the filled polygon first. Reversing the operation cleaned it up some, removing the holes. The circle still has holes, but not so noticeable. But then this is just from two quick test programs with large shapes. Lenard pymike wrote: I've drawn aalines ove

Re: [pygame] multi-width aalines and aacircles

2009-03-25 Thread pymike
I've drawn aalines over polygons before, and it doesn't always look right. http://pymike.pynguins.com/downloads/Screenshot-GeoStrike.png Look closely at the edges :) On Wed, Mar 25, 2009 at 2:09 PM, Lenard Lindstrom wrote: > The results actually look good though, if one first draws the outline

Re: [pygame] multi-width aalines and aacircles

2009-03-25 Thread Lenard Lindstrom
The results actually look good though, if one first draws the outline, then the filled version. Circles not quit so good, but better than with no anti-aliasing. Lenard RB[0] wrote: You could do a filled polygon and then an aa one around it... But I think then you'd be getting a lot slower...

Re: [pygame] multi-width aalines and aacircles

2009-03-25 Thread Ian Mallett
On Wed, Mar 25, 2009 at 11:47 AM, RB[0] wrote: > You could do a filled polygon and then an aa one around it... My suggestion exactly. Too bad this doesn't work with circles... > But I think then you'd be getting a lot slower...

Re: [pygame] multi-width aalines and aacircles

2009-03-25 Thread RB[0]
You could do a filled polygon and then an aa one around it... But I think then you'd be getting a lot slower... On Wed, Mar 25, 2009 at 1:44 PM, Lenard Lindstrom wrote: > The aa polygon is not filled, and the filled polygon does no aa. > > Lenard > > > René Dudfield wrote: > >> good idea. >> >>

Re: [pygame] multi-width aalines and aacircles

2009-03-25 Thread Lenard Lindstrom
The aa polygon is not filled, and the filled polygon does no aa. Lenard René Dudfield wrote: good idea. there's an aa-polygon in sdl gfx On Wed, Mar 25, 2009 at 5:38 PM, Greg Ewing wrote: Lenard Lindstrom wrote: Yes, but we still need an aaline algorithm with line width.

Re: [pygame] multi-width aalines and aacircles

2009-03-25 Thread René Dudfield
c++ On Wed, Mar 25, 2009 at 10:27 PM, niki wrote: > René Dudfield wrote: >> >> good idea. >> >> there's an aa-polygon in sdl gfx > > Why not just use AGG? http://www.antigrain.com v2.4 is BSD (v2.5 is GPL but > dead) > It has AA for beziers too. > > Niki Spahiev > >

Re: [pygame] multi-width aalines and aacircles

2009-03-25 Thread niki
René Dudfield wrote: good idea. there's an aa-polygon in sdl gfx Why not just use AGG? http://www.antigrain.com v2.4 is BSD (v2.5 is GPL but dead) It has AA for beziers too. Niki Spahiev

Re: [pygame] multi-width aalines and aacircles

2009-03-24 Thread René Dudfield
good idea. there's an aa-polygon in sdl gfx On Wed, Mar 25, 2009 at 5:38 PM, Greg Ewing wrote: > Lenard Lindstrom wrote: > >> Yes, but we still need an aaline algorithm with line width. > > Find an aa polygon algorithm and then use it to > draw line-shaped polygons. > > -- > Greg > >

Re: [pygame] multi-width aalines and aacircles

2009-03-24 Thread Greg Ewing
Lenard Lindstrom wrote: Yes, but we still need an aaline algorithm with line width. Find an aa polygon algorithm and then use it to draw line-shaped polygons. -- Greg

Re: [pygame] multi-width aalines and aacircles

2009-03-24 Thread Ian Mallett
I agree. For that, I don't see any solution with the current functionality of pygame other than loading images or applying a blur at runtime...

Re: [pygame] multi-width aalines and aacircles

2009-03-24 Thread Lenard Lindstrom
Ian Mallett wrote: You could always just draw aalines in a circle... Yes, but we still need an aaline algorithm with line width. -- Lenard Lindstrom

Re: [pygame] multi-width aalines and aacircles

2009-03-24 Thread René Dudfield
hi, The best way to help would be to write some unittests for it. and possibly extend, or write an example program. How to compile pygame: http://www.pygame.org/wiki/Compilation tests/ examples/ That will make it way easier for someone to code it - and only requires some python coding. Or for

Re: [pygame] multi-width aalines and aacircles

2009-03-24 Thread Ian Mallett
You could always just draw aalines in a circle...

Re: [pygame] multi-width aalines and aacircles

2009-03-24 Thread Lenard Lindstrom
pymike wrote: > I am currently backporting Pygame Reloaded's SDL_gfx module into Pygame 1.9 Awesome, but it looks like pygame already has most of what's in the sdl_gfx library (rotozoom, aaline, etc.) :S And if SDL_gfx doesn't have line widths, how did pygame achieve it? Would it be possible to

Re: [pygame] multi-width aalines and aacircles

2009-03-24 Thread Ian Mallett
On Tue, Mar 24, 2009 at 11:25 AM, pymike wrote: > AA Bezier curves would be easy if they were just added in PADLib, which > uses lines() and aalines() to render bezier curves. That project is pretty old now, but if people need it, I could update it some. It *does *have AA support, though they ar

Re: [pygame] multi-width aalines and aacircles

2009-03-24 Thread pymike
> I am currently backporting Pygame Reloaded's SDL_gfx module into Pygame 1.9 Awesome, but it looks like pygame already has most of what's in the sdl_gfx library (rotozoom, aaline, etc.) :S And if SDL_gfx doesn't have line widths, how did pygame achieve it? Would it be possible to duplicate it for

Re: [pygame] multi-width aalines and aacircles

2009-03-24 Thread Lenard Lindstrom
pymike wrote: AA Bezier curves would be easy if they were just added in PADLib, which uses lines() and aalines() to render bezier curves. http://www.pygame.org/project/660/ And donuts look awful in pygame right now anyway :-P So really all that needs to be added is aaline width and aapolygons

Re: [pygame] multi-width aalines and aacircles

2009-03-24 Thread pymike
AA Bezier curves would be easy if they were just added in PADLib, which uses lines() and aalines() to render bezier curves. http://www.pygame.org/project/660/ And donuts look awful in pygame right now anyway :-P So really all that needs to be added is aaline width and aapolygons -- - pymike

Re: [pygame] multi-width aalines and aacircles

2009-03-24 Thread Lenard Lindstrom
: [pygame] multi-width aalines and aacircles None of the SDL_gfx functions has a line width argument that I could see. Sure, but at least SDL_gfx gives you the tools you need to get there for AA lines. A filled polygon, redraw the edges with an AA line, use some AA circles to draw caps, and

Re: [pygame] multi-width aalines and aacircles

2009-03-24 Thread RB[0]
:56:16AM -0600, John Krukoff wrote: > > > -Original Message- > > > From: owner-pygame-us...@seul.org [mailto:owner-pygame-us...@seul.org] > On > > > Behalf Of Lenard Lindstrom > > > Sent: Monday, March 23, 2009 6:07 PM > > > To: pygame-use

Re: [pygame] multi-width aalines and aacircles

2009-03-24 Thread Marius Gedminas
l.org > > Subject: Re: [pygame] multi-width aalines and aacircles > > > > None of the SDL_gfx functions has a line width argument that I could see. > > Sure, but at least SDL_gfx gives you the tools you need to get there for AA > lines. A filled polygon, redraw the edges

RE: [pygame] multi-width aalines and aacircles

2009-03-24 Thread John Krukoff
> -Original Message- > From: owner-pygame-us...@seul.org [mailto:owner-pygame-us...@seul.org] On > Behalf Of Lenard Lindstrom > Sent: Monday, March 23, 2009 6:07 PM > To: pygame-users@seul.org > Subject: Re: [pygame] multi-width aalines and aacircles > > None of t

Re: [pygame] multi-width aalines and aacircles

2009-03-23 Thread Lenard Lindstrom
None of the SDL_gfx functions has a line width argument that I could see. Lenard Forrest Voight wrote: One idea was to bind SDL_gfx ... there's a patch for a binding a few months back on this list. On Mon, Mar 23, 2009 at 12:41 PM, Thiago Chaves wrote: I'd be very happy to see those too,

Re: [pygame] multi-width aalines and aacircles

2009-03-23 Thread Forrest Voight
One idea was to bind SDL_gfx ... there's a patch for a binding a few months back on this list. On Mon, Mar 23, 2009 at 12:41 PM, Thiago Chaves wrote: > I'd be very happy to see those too, specially because I've been doing > lots of drawing with primitives on SSoF. =D > > -Thiago > > On Mon, Mar 2

Re: [pygame] multi-width aalines and aacircles

2009-03-23 Thread Thiago Chaves
I'd be very happy to see those too, specially because I've been doing lots of drawing with primitives on SSoF. =D -Thiago On Mon, Mar 23, 2009 at 6:32 PM, pymike wrote: > PyGame desperately needs multi-width aalines and aacircles. Are there any > plans to implement these during GSoC or the next

Re: [pygame] multi-width aalines and aacircles

2009-03-23 Thread RB[0]
I agree - I have wanted the aalines for a while now (for my lib)... Just wondering why this hasn't already been done, I saw some discussion on it a while back (like last year or further) about it being supported in SDL already and pygame just didn't make use of the API or something... Is that even

Re: [pygame] multi-width aalines and aacircles

2009-03-23 Thread RB[0]
Erm, sorry, meant having a width for aalines, I know aalines are already there LOL On Mon, Mar 23, 2009 at 11:36 AM, RB[0] wrote: > I agree - I have wanted the aalines for a while now (for my lib)... > Just wondering why this hasn't already been done, I saw some discussion on > it a while back (