OFX APIs

An OFX plug-in API is a named set of actions, properties and suites to perform some specific set of tasks. The first such API that has been defined on the OFX core is the OFX Image Effect API. The set of actions, properties and suites that constitute the API makes up the major part of this document.

Various suites and actions have been defined for the OFX image effect API, however many are actually quite generic and could be reused by other APIs. The property suite definitely has to be used by all other APIs, while the memory allocation suite, the parameter suite and several others would propably be useful for all other APIs. For example the paramter suite could be re-used to specify user visible parameters to the other APIs.

Several types are common to all OFX APIs, and as such are defined in ofxCore.h . Most objects passed back to a plug-in are generally specified by blind data handles, for example the OfxPropertySetHandle . This allows for strong typing on functions but allows the implementation of the object to be hidden from the plug-in.

  • OfxStatus - used to define a set of status codes indicating the sucess or failure of an action or suite function,
  • OfxPropertySetHandle - a blind handle to a set of properties on an object or action,
  • OfxHost - a C struct that is used by a plug-in to get access to suites from a host and properties about the host,
  • OfxPluginEntryPoint - a typedef for functions used as main entry points for a plug-in (and several other objects),
  • OfxPlugin - a C struct that a plug-in fills in to describe itself to a host.

Several general assumptions have been made about how hosts and plug-ins communicate, which specific APIs are allowed to break. The main is the distinction between...

  • descriptors - which hosts and plug-ins use to define the general behaviour of an object, e.g. the object used to specify what bit depths an Image Effect Plug-in is willing to accept,
  • instances - which hosts and plug-ins use to control the behaviour of a specific 'live' object.

In most APIs descriptors are typically passed from a host to a plug-in during the kOfxActionDescribe action, whilst all other actions are passed an instance, e.g: the object passed to the kOfxActionCreateInstance action.