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

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.pnghttp://rene.f0o.com/%7Erene/stuff/aapolygon.png ...the latter

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...

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

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-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 stdin, line 1, in module

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

Re: [pygame] multi-width aalines and aacircles

2009-03-25 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-25 Thread René Dudfield
good idea. there's an aa-polygon in sdl gfx On Wed, Mar 25, 2009 at 5:38 PM, Greg Ewing greg.ew...@canterbury.ac.nz 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. --

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 greg.ew...@canterbury.ac.nz wrote: Lenard Lindstrom wrote: Yes, but we still need an aaline

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 le...@telus.net 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 Ian Mallett
On Wed, Mar 25, 2009 at 11:47 AM, RB[0] roeb...@gmail.com 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 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 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 le...@telus.net wrote: The results actually look good though, if one first

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

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
Ian Mallett wrote: On Wed, Mar 25, 2009 at 11:47 AM, RB[0] roeb...@gmail.com mailto:roeb...@gmail.com 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

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 le...@telus.net wrote: Ian Mallett wrote: On Wed, Mar 25, 2009 at 11:47 AM, RB[0] roeb...@gmail.com mailto:

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 le...@telus.net

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 n...@vintech.bg wrote:

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.

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

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 the SDL_gfx functions has a line

Re: [pygame] multi-width aalines and aacircles

2009-03-24 Thread Marius Gedminas
On Tue, Mar 24, 2009 at 08: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-users@seul.org Subject: Re: [pygame] multi-width

Re: [pygame] multi-width aalines and aacircles

2009-03-24 Thread RB[0]
, 2009 at 08: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-users@seul.org Subject: Re: [pygame] multi-width aalines

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

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
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

Re: [pygame] multi-width aalines and aacircles

2009-03-24 Thread Ian Mallett
On Tue, Mar 24, 2009 at 11:25 AM, pymike pymik...@gmail.com 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

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 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

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 le...@telus.net

[pygame] multi-width aalines and aacircles

2009-03-23 Thread pymike
PyGame desperately needs multi-width aalines and aacircles. Are there any plans to implement these during GSoC or the next PyGame release? It'd really open up possibilities for pretty apps, vector art, and even SVG libraries. -- - pymike Python eggs me on.

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] roeb...@gmail.com 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

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 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 pymik...@gmail.com wrote: PyGame desperately needs multi-width aalines and aacircles. Are there any plans to implement these during

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 shundr...@gmail.com 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

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 shundr...@gmail.com wrote: I'd be very