Access Image in Plugin?

ForumsFor GIMP developers (read-only) ► Access Image in Plugin?

Sent: 2009-07-02 23:44:54 UTC (over 2 years ago)

From: Rob Antonishen

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>

_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Sent: 2009-07-03 20:41:40 UTC (over 2 years ago)

From: Sven Neumann

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

_______________________________________________
Gimp-developer mailing list
Gimp-developer@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Welcome!


Lost password?

Not a member? Sign up!

Random tutorials | Latest tutorials

  1. Creating a simple Company Logo Creating a simple Company Logo 24
  2. Smoke and Flames Smoke and Flames 21
  3. Creating a bloody splatter texture Creating a bloody splatter texture 36
  4. Create sparkle on any object! Create sparkle on any object! 25

Latest comments

2.6.12 crashes on startup in windows xp. 2.6.11 works fine. (2 days ago in Last stable 2.6 release: 2.6.12 has arrived)

Thank you! You really helped! The tutorial went great for me! Tha... (5 days ago in [AVATAR] Become a real Na'Vi using GIMP!)

maybe you still selected a channel or so? explicitly click a layer ... (5 days ago in Create cool rifts with translucent lights!)

Poll

Is GIMP an adequate application for you to create printed graphics like flyers, advertisments etc?

Latest forum activities

Your Ad Here

facts & numbers

gimpusers.com RSS feed

48 identi.ca followers
748 Twitter followers

powered by bitfire it services