LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 09-17-2004, 05:27 AM   #1
spuzzzzzzz
Member
 
Registered: Sep 2003
Location: Australia
Distribution: Gentoo
Posts: 465

Rep: Reputation: 30
A fast library for drawing in C


...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.
 
Old 09-17-2004, 06:10 AM   #2
huibert.alblas
Member
 
Registered: Jan 2004
Location: Duesseldorf /Germany
Distribution: Gentoo amd64 / Debian
Posts: 226

Rep: Reputation: 30
imlib2

HI,

imlib2 has come to my mind imediatly,
it has been in development in the enleightenment project for a couple of years.

E17 is based on it, it was one of the first libraries released for the project.

I don't know Rasterman that well, but I've heard he is an awsome (graphics-) programmer.

Imlib2 should be a dropin replacement for imlib,
it is _very_ fast.....

Loko into it, and loko through the e17 devel maillinglinsts.
 
Old 09-17-2004, 06:14 AM   #3
kev82
Senior Member
 
Registered: Apr 2003
Location: Lancaster, England
Distribution: Debian Etch, OS X 10.4
Posts: 1,263

Rep: Reputation: 51
try gd

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.
 
Old 09-17-2004, 06:34 AM   #4
spuzzzzzzz
Member
 
Registered: Sep 2003
Location: Australia
Distribution: Gentoo
Posts: 465

Original Poster
Rep: Reputation: 30
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.
 
Old 09-19-2004, 06:03 PM   #5
spuzzzzzzz
Member
 
Registered: Sep 2003
Location: Australia
Distribution: Gentoo
Posts: 465

Original Poster
Rep: Reputation: 30
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...
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FAST (Mega fast Mirror) SUSE 10 beta 4 download 1kyle SUSE / openSUSE 2 09-07-2005 10:13 AM
KDE 3.4 Beta 1 - Fast, Fast, very nice linchat SUSE / openSUSE 0 01-25-2005 11:42 PM
Drawing Program? ZingSter SUSE / openSUSE 1 12-26-2004 11:31 PM
howto compile bin with my library using all-static and shared linked standart library stpg Programming 4 06-29-2004 04:20 AM
what is the function library of the basic graphics library in rethat9.0? zerwolve Red Hat 0 04-29-2004 09:18 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:57 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration