| View previous topic :: View next topic |
| Author |
Message |
Shine
Joined: 03 Dec 2004 Posts: 728 Location: Germany
|
Posted: Sat Sep 03, 2005 8:23 pm Post subject: 2D vector graphics - Libart or cairo? |
|
|
I want to include some vector graphics capabilities to Lua Player. This may be useful for other programs as well, so what do you think, if I'll add it to PSPSDK?
There are at least two libraries, which looks like good candidates and which are used in other large projects. But I don't know the libs.
http://www.levien.com/libart/
This looks like a nice small lib, which does just vector graphics and some image scaling operation, with some low level operations, like creating vector paths from bezier paths.
http://cairographics.org/introduction
Looks like a big lib, with font support and nice high level functions, similiar to SVG or postscript. |
|
| Back to top |
|
 |
rinco
Joined: 21 Jan 2005 Posts: 255 Location: Canberra, Australia
|
Posted: Sat Sep 03, 2005 9:03 pm Post subject: |
|
|
I seriously doubt pspsdk is the place to put such a port.
Both libs look very cool, not that I've ever used them.
It's also probably worth mentioning that I have submitted a SDL_gfx port to svn. SDL_gfx can rotate/zoom images and draw antialiased gfx primitives, including bezier curves (and has framerate control, whoop!). |
|
| Back to top |
|
 |
holger
Joined: 18 Aug 2005 Posts: 204
|
Posted: Sat Sep 03, 2005 10:09 pm Post subject: |
|
|
Comparing cairo and libarts is a little unfair, the counterpart to libarts is more the GL rendering backend of cairo: glitz. If you compare these two, you'll get a slight advantage for glitz (in terms of lines of code) -- and hardware-accelerated graphics:
$ wc -l glitz-0.4.4/src/*.[hc] glitz-0.4.4/src/egl/*.[hc]
12423 total
$ wc -l libart_lgpl-2.3.3/*.[hc]
13434 total |
|
| Back to top |
|
 |
holger
Joined: 18 Aug 2005 Posts: 204
|
Posted: Sat Sep 03, 2005 10:26 pm Post subject: |
|
|
| note: glitz does the compositing, so if you are looking more for a vector primitive renderer you'll go probably better with libarts... |
|
| Back to top |
|
 |
Shine
Joined: 03 Dec 2004 Posts: 728 Location: Germany
|
Posted: Sat Sep 03, 2005 10:54 pm Post subject: |
|
|
| rinco wrote: | I seriously doubt pspsdk is the place to put such a port.
|
Yes, you are right, I really meant psp svn repository, parallel to PSPSDK, please move this thread to "PSP Software Development".
| rinco wrote: |
It's also probably worth mentioning that I have submitted a SDL_gfx port to svn. SDL_gfx can rotate/zoom images and draw antialiased gfx primitives, including bezier curves (and has framerate control, whoop!). |
SDL_gfx looks useful for the very low level side of such a library, but it is too limited, for example I can't set the line width and miter limit. And for bezier paths it is better to set the flatness instead of the number of steps. |
|
| Back to top |
|
 |
Shine
Joined: 03 Dec 2004 Posts: 728 Location: Germany
|
Posted: Thu Sep 22, 2005 10:47 am Post subject: |
|
|
The eyeGT thing is interesting, but looks like it is a commercial library, so I've compiled Libart for the PSP and wrote a sample program. The full source code with EBOOT.PBP for 1.00 and 1.50 firmware:
http://www.frank-buss.de/tmp/libart.zip
Conclusion: it is not usable (or I've done something very wrong), because it needs some 10 seconds for rendering a simple 512x512 bitmap. Now I try Cairo. |
|
| Back to top |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Thu Sep 22, 2005 4:28 pm Post subject: |
|
|
| Shine wrote: | | Conclusion: it is not usable (or I've done something very wrong), because it needs some 10 seconds for rendering a simple 512x512 bitmap. Now I try Cairo. |
I haven't looked at libart, but I can tell you that Cairo makes extensive use of doubles, everywhere. My guess is that it will run as slow as libart. |
|
| Back to top |
|
 |
Leviathan2040
Joined: 09 Jul 2005 Posts: 7
|
Posted: Thu Sep 22, 2005 4:56 pm Post subject: |
|
|
| Shine wrote: | | The eyeGT thing is interesting, but looks like it is a commercial library, so I've compiled Libart for the PSP and wrote a sample program. |
You're right, eyeGT is a commercial library but not for PSP. This is because unless we decide to become Tools & Middleware developers with Sony it can't be sold as it is to do any commercial development. eyeGT is not a Virtual Machine or a Player and it is more than just a graphic library a la Libart or Cairo, as eyeGT abstract the whole GUI concept and makes it independent from the underlying platform.
We having been toying with the idea of releasing it for free (of course for non-commercial use) for the LUA pplayer as it seems the perfect combination; of course in order to be compatible with our license it has to stay closed source.
I would like to hear your comments on this.
Cheers,
Lev |
|
| Back to top |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Thu Sep 22, 2005 11:03 pm Post subject: |
|
|
just wanted to put in the info that someone already brought eyeGT to psp
http://bareblogs.com/BB.php?itemid=8
maybe this helps? (maybe contact this guy)
greets
Lumo _________________ "Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com |
|
| Back to top |
|
 |
Leviathan2040
Joined: 09 Jul 2005 Posts: 7
|
Posted: Thu Sep 22, 2005 11:07 pm Post subject: |
|
|
He is the same guy that write in this forum under the Leviathan2040 nickname ;-)
Cheers,
Lev |
|
| Back to top |
|
 |
LuMo
Joined: 21 Aug 2005 Posts: 410 Location: Austria
|
Posted: Thu Sep 22, 2005 11:12 pm Post subject: |
|
|
could not know that ;)
good to know now :))
greets _________________ "Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com |
|
| Back to top |
|
 |
Leviathan2040
Joined: 09 Jul 2005 Posts: 7
|
Posted: Fri Sep 23, 2005 2:37 am Post subject: |
|
|
| Shine wrote: |
http://www.frank-buss.de/tmp/libart.zip
Conclusion: it is not usable (or I've done something very wrong), because it needs some 10 seconds for rendering a simple 512x512 bitmap. Now I try Cairo. |
I took the chance of converting your code to use eyeGT and yes, vector graphics can be fast. The PSP has a decent FPU but of course is not a PentiumIV running at 3.4GHz.
Have you tried to take out the alpha value out of the middle gradient color stop? Alpha values are killer for vector layered graphics, even if the libart rendering model seems to be incorect when draws over already drawn stuff.
Anyway grab the example from http://bareblogs.com/files/RandomStar_PSP.zip
I've included the modified source code.
Cheers,
Lev |
|
| Back to top |
|
 |
Ska
Joined: 10 Oct 2005 Posts: 4
|
Posted: Mon Oct 10, 2005 4:05 am Post subject: |
|
|
I've an alternative ! ;)
I'm one of the developers of Amanith (www.amanith.org), it's a crossplatform opensource framework of classes in ansi c++ for handle vector graphics with powerful modelling functions (like curves cut, joins, flatten, and so on) and in the near future also with a good rendering layer and gfx-vector file format support (SVG, SWF). Amanith is also very portable, we have used only Ansi C++ with STL, so it compile under many environments (linux, freebsd, windows, macosx, irix, solaris) with gcc or visualstudio, on several platforms/processor (we have tested x86 and x86_64 intel machines, g4&g5 mac, mips from sgi, and sparc workstations). Some cool guys are porting Amanith also on BeOs, AmigaOS and MorphOS. |
|
| Back to top |
|
 |
|