RSS/Atom feed Twitter
Site is read-only, email is disabled

[maybe OT?] Code excerpts from the GIMP

This discussion is connected to the gimp-developer-list.gnome.org mailing list which is provided by the GIMP developers and not related to gimpusers.com.

This is a read-only list on gimpusers.com so this discussion thread is read-only, too.

6 of 6 messages available
Toggle history

Please log in to manage your subscriptions.

[maybe OT?] Code excerpts from the GIMP Tom Copeland 02 May 23:23
  [maybe OT?] Code excerpts from the GIMP Simon Budig 03 May 00:06
   [maybe OT?] Code excerpts from the GIMP Tom Copeland 03 May 02:18
  [maybe OT?] Code excerpts from the GIMP Sven Neumann 03 May 00:47
  [maybe OT?] Code excerpts from the GIMP Sven Neumann 03 May 01:17
  [maybe OT?] Code excerpts from the GIMP Tom Copeland 30 Jun 20:53
Tom Copeland
2005-05-02 23:23:01 UTC (almost 19 years ago)

[maybe OT?] Code excerpts from the GIMP

Howdy -

Here's a bit of GIMP "code publicity" I thought folks might be interested in. I'm working on a tutorial for IBM's developerWorks site on the GLib collections - GSList, GHashTable, GTree, and all that. As part of the tutorial, I'm picking out excerpts of various collection type usages from a couple of nice open source apps - like the GIMP.

Here's a list of the references to the GIMP that I've currently got in the article:

http://infoether.com/~tom/gimp_snippets.html

If anyone has any suggestions/corrections to the descriptions of these usages, please email me at tom@infoether.com (or here if you think it's on-topic enough).

Many thanks,

Tom Copeland tom@infoether.com

Simon Budig
2005-05-03 00:06:05 UTC (almost 19 years ago)

[maybe OT?] Code excerpts from the GIMP

Tom Copeland (tom@infoether.com) wrote:

Here's a list of the references to the GIMP that I've currently got in the article:

http://infoether.com/~tom/gimp_snippets.html

If anyone has any suggestions/corrections to the descriptions of these usages, please email me at tom@infoether.com (or here if you think it's on-topic enough).

I just want to make you aware that the example in gimp-2.2.4/app/base/boundary.c does not actually get used currently. If you're curious: this algorithm is a modified version of the douglas peucker algorithm for line simplification. A discussion why this code is currently unused can be found here: http://bugzilla.gnome.org/show_bug.cgi?id=50730

Feel free to ask me about this code and the vector-related stuff in your examples.

Bye,
Simon

Sven Neumann
2005-05-03 00:47:56 UTC (almost 19 years ago)

[maybe OT?] Code excerpts from the GIMP

Sven Neumann
2005-05-03 01:17:40 UTC (almost 19 years ago)

[maybe OT?] Code excerpts from the GIMP

Hi,

Tom Copeland writes:

Here's a bit of GIMP "code publicity" I thought folks might be interested in. I'm working on a tutorial for IBM's developerWorks site on the GLib collections - GSList, GHashTable, GTree, and all that. As part of the tutorial, I'm picking out excerpts of various collection type usages from a couple of nice open source apps - like the GIMP.

Here's a list of the references to the GIMP that I've currently got in the article:

http://infoether.com/~tom/gimp_snippets.html

gimp-2.2.4/app/core/gimppreviewcache.c uses a GSList as a sort of size-based queue; it holds image previews in a GSList and uses g_slist_insert_sorted to insert the smaller images first. Oddly, another function in the same file trims the cache by iterating over the same GSList and comparing each item to find the smallest one to remove. Might be a possibility for some optimization there.

The function preview_cache_remove_smallest() which is used to trim the cache actually uses a different comparison than what is used to keep the list sorted. Whether this is what the author intended, I don't know.

It might be of interest to your readers to also include GimpList as an implementation of the GimpContainer class.

Sven

Tom Copeland
2005-05-03 02:18:40 UTC (almost 19 years ago)

[maybe OT?] Code excerpts from the GIMP

On Tue, 2005-05-03 at 00:06 +0200, Simon Budig wrote:

Tom Copeland (tom@infoether.com) wrote:

Here's a list of the references to the GIMP that I've currently got in the article:

http://infoether.com/~tom/gimp_snippets.html

If anyone has any suggestions/corrections to the descriptions of these usages, please email me at tom@infoether.com (or here if you think it's on-topic enough).

I just want to make you aware that the example in gimp-2.2.4/app/base/boundary.c does not actually get used currently. If you're curious: this algorithm is a modified version of the douglas peucker algorithm for line simplification. A discussion why this code is currently unused can be found here: http://bugzilla.gnome.org/show_bug.cgi?id=50730

That's very interesting, thank you! I understand your comment about "failing in a predictable way"; such are the vagaries of programming....

But it sounds like it may well be used at some point, and it illustrates the GArray nicely, so I think I'll leave it in there for the tutorial.

Feel free to ask me about this code and the vector-related stuff in your examples.

Thanks very much indeed!

Yours,

Tom

Tom Copeland
2005-06-30 20:53:58 UTC (almost 19 years ago)

[maybe OT?] Code excerpts from the GIMP

On Mon, 2005-05-02 at 17:23 -0400, Tom Copeland wrote:

Howdy -

Here's a bit of GIMP "code publicity" I thought folks might be interested in. I'm working on a tutorial for IBM's developerWorks site on the GLib collections - GSList, GHashTable, GTree, and all that. As part of the tutorial, I'm picking out excerpts of various collection type usages from a couple of nice open source apps - like the GIMP.

This tutorial, complete with Gimp Glib API usage code samples, is up on the IBM developerWorks web site now:

http://www-130.ibm.com/developerworks/linux

IBM has redone their tutorial format, so there's not as much clicking from slide to slide as there used to be, which is nice.

Hope folks find it interesting!

Yours,

Tom