TuttleOFX  1
TuttleOFX/libraries/tuttle/src/tuttle/host/ofx/OfxhImageEffectNodeBase.cpp
Go to the documentation of this file.
00001 #include "OfxhImageEffectNodeBase.hpp"
00002 
00003 namespace tuttle {
00004 namespace host {
00005 namespace ofx {
00006 namespace imageEffect {
00007 
00008 //
00009 // Base
00010 //
00011 OfxhImageEffectNodeBase::OfxhImageEffectNodeBase( const property::OfxhSet& set )
00012         : _properties( set )
00013 {}
00014 
00015 OfxhImageEffectNodeBase::OfxhImageEffectNodeBase( const property::OfxhPropSpec* propSpec )
00016         : _properties( propSpec )
00017 {}
00018 
00019 OfxhImageEffectNodeBase::~OfxhImageEffectNodeBase() {}
00020 
00021 bool OfxhImageEffectNodeBase::operator==( const OfxhImageEffectNodeBase& other ) const
00022 {
00023         return _properties == other._properties;
00024 }
00025 
00026 /**
00027  * obtain a handle on this for passing to the C api
00028  */
00029 OfxImageEffectHandle OfxhImageEffectNodeBase::getHandle() const
00030 {
00031         return ( OfxImageEffectHandle ) this;
00032 }
00033 
00034 /// name of the imageEffect
00035 const std::string& OfxhImageEffectNodeBase::getShortLabel() const
00036 {
00037         const std::string& s = _properties.getStringProperty( kOfxPropShortLabel );
00038 
00039         if( s == "" )
00040         {
00041                 const std::string& s2 = getLabel();
00042                 if( s2 == "" )
00043                 {
00044                         return getName();
00045                 }
00046         }
00047         return s;
00048 }
00049 
00050 /// name of the imageEffect
00051 const std::string& OfxhImageEffectNodeBase::getLabel() const
00052 {
00053         const std::string& s = _properties.getStringProperty( kOfxPropLabel );
00054 
00055         if( s == "" )
00056         {
00057                 return getName();
00058         }
00059         return s;
00060 }
00061 
00062 /// name of the imageEffect
00063 const std::string& OfxhImageEffectNodeBase::getName() const
00064 {
00065         return _properties.getStringProperty( kOfxPropName );
00066 }
00067 
00068 /// name of the imageEffect
00069 void OfxhImageEffectNodeBase::setName( const std::string& name )
00070 {
00071         _properties.setStringProperty( kOfxPropName, name );
00072 }
00073 
00074 const std::string& OfxhImageEffectNodeBase::getLongLabel() const
00075 {
00076         const std::string& s = _properties.getStringProperty( kOfxPropLongLabel );
00077 
00078         if( s == "" )
00079         {
00080                 const std::string& s2 = getLabel();
00081                 if( s2 == "" )
00082                 {
00083                         return getName();
00084                 }
00085         }
00086         return s;
00087 }
00088 
00089 /// is the given context supported
00090 
00091 bool OfxhImageEffectNodeBase::isContextSupported( const std::string& s ) const
00092 {
00093         return _properties.findStringPropValueIndex( kOfxImageEffectPropSupportedContexts, s ) != -1;
00094 }
00095 
00096 /// what is the name of the group the plug-in belongs to
00097 
00098 const std::string& OfxhImageEffectNodeBase::getPluginGrouping() const
00099 {
00100         return _properties.getStringProperty( kOfxImageEffectPluginPropGrouping );
00101 }
00102 
00103 /// is the effect single instance
00104 
00105 bool OfxhImageEffectNodeBase::isSingleInstance() const
00106 {
00107         return _properties.getIntProperty( kOfxImageEffectPluginPropSingleInstance ) != 0;
00108 }
00109 
00110 /// what is the thread safety on this effect
00111 
00112 const std::string& OfxhImageEffectNodeBase::getRenderThreadSafety() const
00113 {
00114         return _properties.getStringProperty( kOfxImageEffectPluginRenderThreadSafety );
00115 }
00116 
00117 /// should the host attempt to managed multi-threaded rendering if it can
00118 /// via tiling or some such
00119 
00120 bool OfxhImageEffectNodeBase::getHostFrameThreading() const
00121 {
00122         return _properties.getIntProperty( kOfxImageEffectPluginPropHostFrameThreading ) != 0;
00123 }
00124 
00125 /// get the overlay interact main entry if it exists
00126 
00127 OfxPluginEntryPoint* OfxhImageEffectNodeBase::getOverlayInteractMainEntry() const
00128 {
00129         return ( OfxPluginEntryPoint* )( _properties.getPointerProperty( kOfxImageEffectPluginPropOverlayInteractV1 ) );
00130 }
00131 
00132 /// does the effect support images of differing sizes
00133 
00134 bool OfxhImageEffectNodeBase::supportsMultiResolution() const
00135 {
00136         return _properties.getIntProperty( kOfxImageEffectPropSupportsMultiResolution ) != 0;
00137 }
00138 
00139 /// does the effect support tiled rendering
00140 
00141 bool OfxhImageEffectNodeBase::supportsTiles() const
00142 {
00143         return _properties.getIntProperty( kOfxImageEffectPropSupportsTiles ) != 0;
00144 }
00145 
00146 /// does this effect need random temporal access
00147 
00148 bool OfxhImageEffectNodeBase::temporalAccess() const
00149 {
00150         return _properties.getIntProperty( kOfxImageEffectPropTemporalClipAccess ) != 0;
00151 }
00152 
00153 /// is the given RGBA/A pixel depth supported by the effect
00154 
00155 bool OfxhImageEffectNodeBase::isBitDepthSupported( const std::string& s ) const
00156 {
00157         return _properties.findStringPropValueIndex( kOfxImageEffectPropSupportedPixelDepths, s ) != -1;
00158 }
00159 
00160 /// when field rendering, does the effect need to be called
00161 /// twice to render a frame in all Base::circumstances (with different fields)
00162 
00163 bool OfxhImageEffectNodeBase::fieldRenderTwiceAlways() const
00164 {
00165         return _properties.getIntProperty( kOfxImageEffectPluginPropFieldRenderTwiceAlways ) != 0;
00166 }
00167 
00168 /// does the effect support multiple clip depths
00169 
00170 bool OfxhImageEffectNodeBase::supportsMultipleClipDepths() const
00171 {
00172         return _properties.getIntProperty( kOfxImageEffectPropSupportsMultipleClipDepths ) != 0;
00173 }
00174 
00175 /// does the effect support multiple clip pixel aspect ratios
00176 
00177 bool OfxhImageEffectNodeBase::supportsMultipleClipPARs() const
00178 {
00179         return _properties.getIntProperty( kOfxImageEffectPropSupportsMultipleClipPARs ) != 0;
00180 }
00181 
00182 /// does changing the named param re-tigger a clip preferences action
00183 
00184 bool OfxhImageEffectNodeBase::isClipPreferencesSlaveParam( const std::string& s ) const
00185 {
00186         return _properties.findStringPropValueIndex( kOfxImageEffectPropClipPreferencesSlaveParam, s ) != -1;
00187 }
00188 
00189 }
00190 }
00191 }
00192 }
00193