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

Access Image in Plugin?

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.

Access Image in Plugin? Rob Antonishen 02 Jul 23:44
  Access Image in Plugin? Sven Neumann 03 Jul 20:41
Rob Antonishen
2009-07-02 23:44:54 UTC (over 15 years ago)

Access Image in Plugin?

Hi-

I'm trying to get (in order to modify) the active selection (channel) in a C plugin I am writing.

I assume I can simply use gimp_image_get_mask (image) but I can't see how to get the image object!

All the examples show accessing the drawable object using gimp_drawable_get (param[2].data.d_drawable)

I know I can access the image ID using param[1].data.d_image, but the only call seems to be gimp_image_get_by_ID which requires a first parameter *gimp which I can't determine how to get! (Oddly enough, I could image->gimp if I had the image object but that is a bit chicken and egg situation...)

Can anyone provide a pointer, or tell me if there is a better way to get the current selection (channel).

Thanks in advance...

-Rob A>

Sven Neumann
2009-07-03 20:41:40 UTC (over 15 years ago)

Access Image in Plugin?

Hi,

On Thu, 2009-07-02 at 17:44 -0400, Rob Antonishen wrote:

All the examples show accessing the drawable object using gimp_drawable_get (param[2].data.d_drawable)

I know I can access the image ID using param[1].data.d_image, but the only call seems to be gimp_image_get_by_ID which requires a first parameter *gimp which I can't determine how to get! (Oddly enough, I could image->gimp if I had the image object but that is a bit chicken and egg situation...)

I think you are mixing GIMP core API and GIMP plug-in API here. gimp_image_get_by_ID() is core API and not accessible to plug-ins. Same holds true for the Gimp object.

What's the problem about using param[1].data.d_image ? The plug-in API works with image IDs, there is no image struct or object in libgimp.

Sven