ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
...preferably also threadsafe. I've been using gdk in a little project which involves drawing stuff and saving it to disk (I don't need to display the drawings). Gdk has become a huge bottleneck, however, and it also doesn't seem to be threadsafe (I had to mutex/lock the function that did the drawing, or it would crash with errors from gdk/xlib).
Can anyone recommend a good, fast library for drawing stuff? I need to be able to draw lines and polygons, and then I need to save a file (preferably in some compressed format). I'm happy to use libpng or something to compress the files, but if the library has a built-in function to do it, so much the better
EDIT: I've been looking at the enlightenment site and imlib2 looks pretty good. Does anyone have any experience with it?
Last edited by spuzzzzzzz; 09-17-2004 at 05:29 AM.
i have very limited experience with imlib2, just loading images of various formats and manipulating their data, i had no problems with it other than limited docs, but i think gd has more support for drawing primatives than imlib2 does.
I've had a quick look through the APIs for imlib2 and gd. They both have all the drawing primitives I need. Imlib looks very non-thread-safe, however, what with all those functions to set the active image, but that might not matter if its very fast...
Maybe I'll try them both and see which I like better. The code is pretty short, anyway. Thanks for the help.
OK, I've tried gd. I really like the API. It's very simple and easy to use. It also appears to be threadsafe (the docs don't mention it, but I've been using it in a fairly heavily threaded app and I haven't seen anything abnormal). It is, however, quite slow. So I don't think I'll be using it for this project, where speed is very important, but it might be useful in the future. Now to try out imlib...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.