Skip to content

Developer's guide to the Resynthesizer code and dependencies

Lloyd Konneker edited this page Mar 13, 2021 · 2 revisions

The major parts of the source code:

  • /lib Produces libresynthesizer.a, a convenience library implementing the algorithm.
  • /src/resynthesizer Produces resynthesizer, an executable GIMP plugin calling the library. Adapts GIMP data structures and calling conventions to the library. Statically linked with the library. The "base" or "engine" plugin.
  • /src/resynthesizer-gui Produces resynthesizer-gui, an executable GIMP plugin written in C, a control panel for and invoking resynthesizer engine plugin via GIMP PDB. Soon obsolete, to be replaced by a Python plugin.
  • /PluginScripts/plugin-*.py GIMP plugins written in Python, invoking the engine plugin via GIMP PDB

Run-time dependencies

The resynthesizer library is independent of GIMP. By default it does compile-time depend on Glib, but optionally can be built without Glib.

The GIMP PDB is the Procedural Data Base. Plugins register in the PDB, and call other plugins.

The C language "resynthesizer" plugin is the base, the engine plugin. It calls no other plugins. It does call the GIMP library (libgimp) because it is a GIMP plugin. It also calls the resynthesizer library.

All other resynthesizer Python plugins call the engine plugin, so there is a run-time dependency. Also, they have a run-time dependency on Python.

All plugins beside the engine plugin are optional, at the discretion of the user at install time.

Resynthesizer-gui is a control panel for the engine, offering the "Map>Resynthesize" menu item. Without it, all other plugins will still work.

Link-time, library dependencies

The resynthesizer library uses the C math library (libm) and optionally, when threaded, libgthreads.

The library also uses GLib (for things like gassert and g_uint) but the repository includes hacky, compile-time options to obviate that.

The resynthesizer engine plugin is linked with the GIMP library, libgimp, but the resynthesizer library does not.

Python dependencies

The resynthesizer Python plugins use Python 2, which is obsolete since January 2020.

The resynthesizer Python plugins use GimpFu (also called PyGimp) i.e. the Python module "gimpfu." That is, they "from gimpfu import *."

The resynthesizer Python plugins also import some Python standard modules, but no other modules that are not standard.

The GimpFu module is a feature of GIMP v2. The gimp.org has no plans to support it in GIMP v3. But there is a third party effort to support it as a third-party plugin (see https://github.com/bootchk/GimpFu-v3.git). For now, the future "deprecations" branch has Python plugins that use Python 3 and the third-party GimpFu.