Next: 4.1 Simple plugin example Up: appguide Previous: 3.8.6 Limitations Contents

# 4. Function dispatch and plug-ins

As image processing libraries increase in size, it becomes progressively more difficult to build applications which present the library facilities to the user. Every time a new function is added, every user interface needs to be adapted -- a job which can rapidly become unmanageable.

To address this problem, VIPS includes a simple database which stores an abstract description of every image processing function. User interfaces, rather than having special code wired into them for each function, can simply interrogate the database and present what they find to the user.

The function database is extensible. You can define new functions, and even new types, and add them to VIPS. These new functions will then automatically appear in all VIPS user interfaces with no extra programming effort. These new functions can be loadable modules, added to running programs on demand. These modules are called plug-ins.

Subsections

- 4.1 Simple plugin example
- 4.2 A more complicated example
- 4.3 Adding new types
- 4.4 Using function dispatch in your application
  - 4.4.1 Adding and removing functions
  - 4.4.2 Searching the function database
  - 4.4.3 Building argument structures and running commands