diff --git a/HostSupport/include/ofxhClip.h b/HostSupport/include/ofxhClip.h index 692de9434..250798996 100755 --- a/HostSupport/include/ofxhClip.h +++ b/HostSupport/include/ofxhClip.h @@ -107,17 +107,10 @@ namespace OFX { bool supportsTiles() const; #ifdef OFX_EXTENSIONS_NUKE - /// can a matrix be attached to images on this clip - // This is deprecated but maintained for compat with older plug-ins. - // canDistort should be preferred for newer plug-ins. + /// can a kFnOfxPropMatrix2D be attached to images on this clip bool canTransform() const; #endif -#ifdef OFX_EXTENSIONS_NATRON - // can a distorsion be attached to images on this clip - bool canDistort() const; -#endif - /// get property set, const version const Property::Set &getProps() const; diff --git a/HostSupport/include/ofxhImageEffect.h b/HostSupport/include/ofxhImageEffect.h index dd6937e50..2bbd9240c 100755 --- a/HostSupport/include/ofxhImageEffect.h +++ b/HostSupport/include/ofxhImageEffect.h @@ -42,10 +42,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #include "ofxhMemory.h" #include "ofxhInteract.h" -#ifdef OFX_EXTENSIONS_NATRON -#include "ofxNatron.h" -#endif - #ifdef _MSC_VER //Use visual studio extension #define __PRETTY_FUNCTION__ __FUNCSIG__ @@ -272,8 +268,6 @@ namespace OFX { #ifdef OFX_EXTENSIONS_NUKE /// does this effect handle transform effects - // This is deprecated but maintained for compat with older plug-ins. - // canDistort should be preferred for newer plug-ins. bool canTransform() const; /// Indicates that a host or plugin can fetch more than a type of image from a clip @@ -303,10 +297,6 @@ namespace OFX { #endif #ifdef OFX_EXTENSIONS_NATRON - - /// does this effect handle distorsion effects - bool canDistort() const; - /// is this effect deprecated bool isDeprecated() const; @@ -760,8 +750,6 @@ namespace OFX { ); #ifdef OFX_EXTENSIONS_NUKE - // This is deprecated but maintained for compat with older plug-ins. - // getDistorsionAction should be preferred for newer plug-ins. virtual OfxStatus getTransformAction(OfxTime time, const std::string& field, OfxPointD renderScale, @@ -770,23 +758,10 @@ namespace OFX { double transform[9]); #endif -#ifdef OFX_EXTENSIONS_NATRON - virtual OfxStatus getDistorsionAction(OfxTime time, - const std::string& field, - OfxPointD renderScale, - int view, - std::string& clip, - double transform[9], - OfxDistorsionFunctionV1* distorsionFunc, - void** distorsionFunctionData, - int* distorsionFunctionDataSize, - OfxDistorsionFreeDataFunctionV1* freeDataFunction); -#endif - /// Call the region of definition action the plugin at the given time /// and with the given render scales. The value is returned in rod. /// Note that if the plugin does not trap the action the default - /// RoD is calculated and returned. + /// RoD is calculated and returned. virtual OfxStatus getRegionOfDefinitionAction(OfxTime time, OfxPointD renderScale, #ifdef OFX_EXTENSIONS_NUKE diff --git a/HostSupport/src/ofxhClip.cpp b/HostSupport/src/ofxhClip.cpp index 3faf0a597..4c931cdf6 100755 --- a/HostSupport/src/ofxhClip.cpp +++ b/HostSupport/src/ofxhClip.cpp @@ -75,10 +75,7 @@ namespace OFX { { kOfxImageClipPropFieldExtraction, Property::eString, 1, false, kOfxImageFieldDoubled }, { kOfxImageEffectPropSupportsTiles, Property::eInt, 1, false, "1" }, #ifdef OFX_EXTENSIONS_NUKE - { kFnOfxImageEffectCanTransform, Property::eInt, 1, false, "0" }, // can a matrix be attached to images on this clip -#endif -#ifdef OFX_EXTENSIONS_NATRON - { kOfxImageEffectPropCanDistort, Property::eInt, 1, false, "0" }, // can a distorsion be attached to images on this clip + { kFnOfxImageEffectCanTransform, Property::eInt, 1, false, "0" }, // can a kFnOfxPropMatrix2D be attached to images on this clip #endif Property::propSpecEnd, }; @@ -195,27 +192,19 @@ namespace OFX { } #ifdef OFX_EXTENSIONS_NUKE - /// can a matrix be attached to images on this clip + /// can a kFnOfxPropMatrix2D be attached to images on this clip bool ClipBase::canTransform() const { return _properties.getIntProperty(kFnOfxImageEffectCanTransform) != 0; } #endif -#ifdef OFX_EXTENSIONS_NATRON - /// can a distorsion be attached to images on this clip - bool ClipBase::canDistort() const - { - return _properties.getIntProperty(kOfxImageEffectPropCanDistort) != 0; - } -#endif - const Property::Set& ClipBase::getProps() const { return _properties; } - Property::Set& ClipBase::getProps() + Property::Set& ClipBase::getProps() { return _properties; } @@ -663,11 +652,7 @@ namespace OFX { { kOfxImagePropField, Property::eString, 1, true, "", }, { kOfxImagePropUniqueIdentifier, Property::eString, 1, true, "" }, #ifdef OFX_EXTENSIONS_NUKE - { kFnOfxPropMatrix2D, Property::eDouble, 9, true, "0" }, // If the clip descriptor has kFnOfxImageEffectCanTransform set to 1, this property contains a 3x3 matrix corresponding to a transform, going from the source image to the destination, defaults to the identity matrix. A matrix filled with zeroes is considered as the identity matrix (i.e. no transform). -#endif -#ifdef OFX_EXTENSIONS_NATRON - { kOfxPropDistorsionFunction, Property::ePointer, 1, true, NULL }, // If the clip descriptor has kOfxImageEffectPropCanDistort set to 1, this property contains a pointer to a distorsion function going from the source image to the destination that should be applied on any pixel. If the effect that called clipGetImage on the clip is also kOfxImageEffectPropCanDistort set to 1, it's distorsion function is already concatenated in the function pointed to by this property and does not need to be applied after this distorsion function. - { kOfxPropDistorsionFunctionData, Property::ePointer, 1, true, NULL }, // if kOfxPropDistorsionFunction is set, this a pointer to the data that must be passed to the distorsion function + { kFnOfxPropMatrix2D, Property::eDouble, 9, true, "0" }, // If the clip descriptor has kFnOfxImageEffectCanTransform set to 1, this property contains a 3x3 matrix corresponding to a transform in pixel coordinate space, going from the source image to the destination, defaults to the identity matrix. A matrix filled with zeroes is considered as the identity matrix (i.e. no transform) #endif Property::propSpecEnd }; diff --git a/HostSupport/src/ofxhImageEffect.cpp b/HostSupport/src/ofxhImageEffect.cpp index d57452eef..0729ce7f6 100644 --- a/HostSupport/src/ofxhImageEffect.cpp +++ b/HostSupport/src/ofxhImageEffect.cpp @@ -145,7 +145,6 @@ namespace OFX { { kNatronOfxImageEffectPropInViewerContextShortcutHasAltModifier, Property::eInt, 0, true, "" }, { kNatronOfxImageEffectPropInViewerContextShortcutHasMetaModifier, Property::eInt, 0, true, "" }, { kNatronOfxPropNativeOverlays, Property::eString, 0, false, ""}, - { kOfxImageEffectPropCanDistort, Property::eInt, 1, false, "0" }, #endif Property::propSpecEnd }; @@ -382,12 +381,6 @@ namespace OFX { #endif #ifdef OFX_EXTENSIONS_NATRON - - bool Base::canDistort() const - { - return _properties.getIntProperty(kOfxImageEffectPropCanDistort) != 0; - } - /// does this effect handle transform effects bool Base::isDeprecated() const { @@ -1562,77 +1555,6 @@ namespace OFX { } #endif // OFX_EXTENSIONS_NUKE -#ifdef OFX_EXTENSIONS_NATRON - OfxStatus Instance::getDistorsionAction(OfxTime time, - const std::string& field, - OfxPointD renderScale, - int view, - std::string& clip, - double transform[9], - OfxDistorsionFunctionV1* distorsionFunc, - void** distorsionFunctionData, - int* distorsionFunctionDataSize, - OfxDistorsionFreeDataFunctionV1* freeDataFunction) - { - if (time != time) { - // time is NaN - return kOfxStatFailed; - } - static const Property::PropSpec inStuff[] = { - { kOfxPropTime, Property::eDouble, 1, true, "0" }, - { kOfxImageEffectPropFieldToRender, Property::eString, 1, true, "" }, - { kOfxImageEffectPropRenderScale, Property::eDouble, 2, true, "0" }, - { kFnOfxImageEffectPropView, Property::eInt, 1, true, "0" }, - Property::propSpecEnd - }; - - static const Property::PropSpec outStuff[] = { - { kOfxPropName, Property::eString, 1, false, "" }, - { kOfxPropMatrix3x3, Property::eDouble, 9, false, "0.0" }, - { kOfxPropDistorsionFunction, Property::ePointer, 1, false, NULL }, - { kOfxPropDistorsionFunctionData, Property::ePointer, 1, false, NULL }, - { kOfxPropDistorsionFunctionDataSize, Property::eInt, 1, false, "0" }, - { kOfxPropDistorsionFreeDataFunction, Property::ePointer, 1, false, NULL }, - Property::propSpecEnd - }; - - Property::Set inArgs(inStuff); - Property::Set outArgs(outStuff); - - inArgs.setStringProperty(kOfxImageEffectPropFieldToRender,field); - inArgs.setDoubleProperty(kOfxPropTime,time); - inArgs.setDoublePropertyN(kOfxImageEffectPropRenderScale, &renderScale.x, 2); - inArgs.setIntProperty(kFnOfxImageEffectPropView, view); - for(std::map::iterator it=_clips.begin(); - it!=_clips.end(); - ++it) { - it->second->setView(view); - } - -# ifdef OFX_DEBUG_ACTIONS - OfxPlugin *ofxp = _plugin->getPluginHandle()->getOfxPlugin(); - const char* id = ofxp->pluginIdentifier; - std::cout << "OFX: "<"<getHandle(), &inArgs, &outArgs); -# ifdef OFX_DEBUG_ACTIONS - std::cout << "OFX: "<"<"<