Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Porting C plugin (xsane) to GIMP 3
#1
Hi,
I am engaged in porting the xsane GIMP plugin code to the new GIMP 3 API. So far it has been a bit of a struggle since the doc is still pretty sparse. So I am looking for some hints.

xsane doesn't have a very complex relationship with GIMP, so I don't believe that there is much left to do. However, I do have some specific questions that I hope I can get some help with.

What I have so far is the infrastructure and new boilerplate to register the menu items. All of that works fine. 

Now I am looking at image creation.

I have the following sequence to get a new image with an attached layer:

gimp_image_new()
gimp_layer_new()
gimp_image_insert_layer()

Now, in order to get a buffer onto which to draw the scanned image, the GIMP 2 code used:

buffer = gimp_drawable_get_buffer(layer_ID);

However, this function does not take a layer in GIMP 3. It takes a GimpDrawable. What do I need to do to draw to a layer or is there a different method not recommended? There doesn't seem to be a function to get a drawable from a layer.

Cheers, and thanks in advance.
skelband
Reply


Messages In This Thread
Porting C plugin (xsane) to GIMP 3 - by skelband - 05-28-2025, 05:27 AM

Forum Jump: