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

C plugin writer wannabe(more like newbie) has questions...

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.

2 of 2 messages available
Toggle history

Please log in to manage your subscriptions.

C plugin writer wannabe(more like newbie) has questions... Kenny Law 10 Jun 17:56
  C plugin writer wannabe(more like newbie) has questions... Sven Neumann 10 Jun 18:55
Kenny Law
2003-06-10 17:56:50 UTC (almost 21 years ago)

C plugin writer wannabe(more like newbie) has questions...

Hi all,

I am now moving from script-fu/perl-fu scripting and entering the world of C plugin writing for GIMP. Only reason I am doing this is because I need to get information about pixels on the drawable(quite a significant number of pixels)

I have read the good tutorial "Essentials Of a Plug-in" by Kevin Turner, and I have a few things that I just want to ask about plug-in writing in general.

a) Where do I find plug-ins with the C code instead of the executable ones in the plugin directory? I like learning by reading other source codes and could anyone tell me which one is well commented so that I get what's going on?

b) I have read the online documentation on libgimp http://gimp-plug-ins.sourceforge.net/doc/libgimp/html/

Unfortunately, I find it hard to use because not everything in there is documented, as in I have no idea what some of the functions do(although most function names are pretty well defined) and I have no idea what sort of parameters it wants me to pass in. Can anyone tell me if there is a source of help that will explain the functions in detail?

c) Basically, I just want to get information in a pixel? Thing is, if i use this function:
void gimp_pixel_rgn_get_pixel (GimpPixelRgn *pr, guchar *buf, gint x, gint y);

Only thing I don't understand is what is the datatype guchar, and how much memory do we allocate to the buf pointer? And in this buf pointer, what information is actually being returned? Basically, I just need to know what color the pixel is. Will that information be returned?

There you go..newbie with tons of questions. I hope you understood what I was trying to ask because I have 0 experience in writing gimp plugins.

Thanks all in advance!

Kenny

Sven Neumann
2003-06-10 18:55:52 UTC (almost 21 years ago)

C plugin writer wannabe(more like newbie) has questions...

Hi,

"Kenny Law" writes:

a) Where do I find plug-ins with the C code instead of the executable ones in the plugin directory? I like learning by reading other source codes.

There are more than hundred plug-ins included in the GIMP tarball. I suggest you start looking there.

b) I have read the online documentation on libgimp http://gimp-plug-ins.sourceforge.net/doc/libgimp/html/

This documentation, or actually a more uptodate version of it, is also included in the source tarball. Have a look at the devel-docs directory.

Unfortunately, I find it hard to use because not everything in there is documented, as in I have no idea what some of the functions do (although most function names are pretty well defined) and I have no idea what sort of parameters it wants me to pass in.

If you installed the GIMP API reference next to the GLib and GTK+ API references, you could click on most data types and get to the relevant documentation that way. Here's an online version of the GIMP-1.3 API reference which is properly cross-linked:

http://developer.gimp.org/api/1.3/

However you will need some more docs than the API reference can give you. Simon Budig wrote an excellent paper for last year's Guadec:

http://www.home.unix-ag.org/simon/gimp/guadec2002/gimp-plugin/html/

Sven