2D vector graphics - Libart or cairo?
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.
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.
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!).
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!).
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
$ 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
Yes, you are right, I really meant psp svn repository, parallel to PSPSDK, please move this thread to "PSP Software Development".rinco wrote:I seriously doubt pspsdk is the place to put such a port.
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.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!).
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.
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 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.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.
-
- Posts: 7
- Joined: Sat Jul 09, 2005 5:26 pm
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.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.
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
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
http://bareblogs.com/BB.php?itemid=8
maybe this helps? (maybe contact this guy)
greets
Lumo
-
- Posts: 7
- Joined: Sat Jul 09, 2005 5:26 pm
LuMo wrote: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
He is the same guy that write in this forum under the Leviathan2040 nickname ;-)
Cheers,
Lev
-
- Posts: 7
- Joined: Sat Jul 09, 2005 5:26 pm
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.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.
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
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.
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.