I need to implement an inpainting algorithm as a gimp plugin.

I am going to start coding very soon.

I read the plugin-template, and the plugin development tutorial, but I still have a problem figuring how selections are managed by the GIMP.

I experimented with the dummy plugin (blur) given in the tutorial, and it appears to work perfectly with complex (ie, non-square) selections, including complex selections. Still, the code is two for loops imbricated, which means it computes over a square. It never calls a test function to know if a given coordinate is selected or not.

The tutorial says that "thanks to the GIMP core, it already takes selection into account" but doesn't say how.

My primary hypothesis is that gimp gives the full image (or a square portion of it including all selections) when you call gimp_drawable_mask_bounds, and that when you write your results using gimp_drawable_update, it just updates the selected portion of this square.

There come my questions :
A) Have I figuret it correctly?
B) If not, how does it really work?
C) Is there a way to force writing outside the selection?
D) Is there a way to know if a given coordinate is selected or not?

Thanks to all for your kind advice.

Joel-Alexis Bialkiewicz
Gimp-developer mailing list

Reply via email to