TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/host/ofx/OfxhImageEffectHost.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_HOST_OFX_IMAGEEFFECTHOST_HPP_
00002 #define _TUTTLE_HOST_OFX_IMAGEEFFECTHOST_HPP_
00003 
00004 #include "OfxhHost.hpp"
00005 #include "OfxhProgress.hpp"
00006 #include "OfxhTimeline.hpp"
00007 #include "OfxhMemory.hpp"
00008 #include "OfxhInteract.hpp"
00009 #include "attribute/OfxhParam.hpp"
00010 #include "attribute/OfxhClipImage.hpp"
00011 
00012 #include <ofxCore.h>
00013 #include <ofxImageEffect.h>
00014 
00015 #include <tuttle/host/exceptions.hpp>
00016 
00017 
00018 namespace tuttle {
00019 namespace host {
00020 namespace ofx {
00021 
00022 // forward declare
00023 class OfxhPlugin;
00024 
00025 namespace attribute {
00026 class OfxhClipDescriptor;
00027 class OfxhClip;
00028 }
00029 
00030 namespace imageEffect {
00031 
00032 // forward declare
00033 class OfxhImageEffectPlugin;
00034 class OfxhOverlayInstance;
00035 class OfxhImageEffectNode;
00036 class OfxhImageEffectNodeDescriptor;
00037 
00038 /**
00039  * An image effect host, passed to the setHost function of all image effect plugins
00040  */
00041 class OfxhImageEffectHost : public OfxhHost
00042 {
00043 public:
00044         OfxhImageEffectHost();
00045         virtual ~OfxhImageEffectHost() = 0;
00046 
00047         /// fetch a suite
00048         virtual void* fetchSuite( const char* suiteName, const int suiteVersion );
00049 
00050         #ifndef SWIG
00051         /**
00052          * Create a new instance of an image effect plug-in.
00053          *
00054          * It is called by ImageEffectPlugin::createInstance which the
00055          * client code calls when it wants to make a new instance.
00056          *
00057          * param: clientData - the clientData passed into the ImageEffectPlugin::createInstance (tuttle remove this parameter)
00058          *   @param plugin - the plugin being created
00059          *   @param desc - the descriptor for that plugin
00060          *   @param context - the context to be created in
00061          */
00062         virtual OfxhImageEffectNode* newInstance( OfxhImageEffectPlugin&         plugin,
00063                                                   OfxhImageEffectNodeDescriptor& desc,
00064                                                   const std::string&             context ) const = 0;
00065 
00066         /**
00067          * Function called as each plugin binary is found and loaded from disk
00068          *
00069          * Use this in any dialogue etc... showing progress
00070          */
00071         virtual void loadingStatus( const std::string& );
00072 
00073         /**
00074          * Override this to filter out plugins which the host can't support for whatever reason
00075          *
00076          *   @param plugin - the plugin to examine
00077          *   @param reason - set this to report the reason the plugin was not loaded
00078          */
00079         virtual bool pluginSupported( const OfxhImageEffectPlugin& plugin, std::string& reason ) const;
00080 
00081         /// Override this to create a descriptor, this makes the 'root' descriptor
00082         virtual OfxhImageEffectNodeDescriptor* makeDescriptor( OfxhImageEffectPlugin& plugin ) const = 0;
00083 
00084         /// used to construct a context description, rootContext is the main context
00085         virtual OfxhImageEffectNodeDescriptor* makeDescriptor( const OfxhImageEffectNodeDescriptor& rootContext, OfxhImageEffectPlugin& plug ) const = 0;
00086 
00087         /// used to construct populate the cache
00088         virtual OfxhImageEffectNodeDescriptor* makeDescriptor( const std::string& bundlePath, OfxhImageEffectPlugin& plug ) const = 0;
00089 
00090         /**
00091          *  Override this to initialise an image effect descriptor after it has been
00092          *  created.
00093          */
00094         virtual void initDescriptor( OfxhImageEffectNodeDescriptor& desc ) const;
00095         #endif
00096 };
00097 
00098 }
00099 }
00100 }
00101 }
00102 
00103 #endif
00104