From cd66143de6e4d05bca1acba31955201b06d27cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Devernay?= Date: Thu, 11 Jan 2018 09:53:58 +0100 Subject: [PATCH] fix building without OFX_EXTENSIONS_NATRON --- ofxsGenerator.cpp | 20 +++++++++++++++----- ofxsTransform3x3.cpp | 6 ++---- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ofxsGenerator.cpp b/ofxsGenerator.cpp index cd99a3d..08c649c 100644 --- a/ofxsGenerator.cpp +++ b/ofxsGenerator.cpp @@ -33,6 +33,13 @@ // Some hosts (e.g. Resolve) may not support normalized defaults (setDefaultCoordinateSystem(eCoordinatesNormalised)) #define kParamDefaultsNormalised "defaultsNormalisedGenerator" +#ifdef OFX_EXTENSIONS_NATRON +#define OFX_COMPONENTS_OK(c) ((c)== ePixelComponentAlpha || (c) == ePixelComponentXY || (c) == ePixelComponentRGB || (c) == ePixelComponentRGBA) +#else +#define OFX_COMPONENTS_OK(c) ((c)== ePixelComponentAlpha || (c) == ePixelComponentRGB || (c) == ePixelComponentRGBA) +#endif + + using namespace OFX; using std::string; @@ -70,10 +77,7 @@ GeneratorPlugin::GeneratorPlugin(OfxImageEffectHandle handle, , _supportsAlpha(false) { _dstClip = fetchClip(kOfxImageEffectOutputClipName); - assert( _dstClip && (!_dstClip->isConnected() || _dstClip->getPixelComponents() == ePixelComponentRGBA || - _dstClip->getPixelComponents() == ePixelComponentRGB || - _dstClip->getPixelComponents() == ePixelComponentXY || - _dstClip->getPixelComponents() == ePixelComponentAlpha) ); + assert( _dstClip && (!_dstClip->isConnected() || OFX_COMPONENTS_OK(_dstClip->getPixelComponents())) ); _extent = fetchChoiceParam(kParamGeneratorExtent); _format = fetchChoiceParam(kParamGeneratorFormat); @@ -137,9 +141,11 @@ GeneratorPlugin::GeneratorPlugin(OfxImageEffectHandle handle, case ePixelComponentRGB: _supportsRGB = supported; break; - case ePixelComponentXY: +#ifdef OFX_EXTENSIONS_NATRON + case ePixelComponentXY: _supportsXY = supported; break; +#endif case ePixelComponentAlpha: _supportsAlpha = supported; break; @@ -838,9 +844,11 @@ generatorDescribeInContext(PageParamDescriptor *page, case ePixelComponentRGB: supportsRGB = supported; break; +#ifdef OFX_EXTENSIONS_NATRON case ePixelComponentXY: supportsXY = supported; break; +#endif case ePixelComponentAlpha: supportsAlpha = supported; break; @@ -895,12 +903,14 @@ generatorDescribeInContext(PageParamDescriptor *page, ++nOptions; } if (supportsXY) { +#ifdef OFX_EXTENSIONS_NATRON assert(outputComponentsMap[param->getNOptions()] == ePixelComponentXY); param->appendOption(kParamGeneratorOutputComponentsOptionXY); if (defaultComponents == ePixelComponentXY) { defIndex = nOptions; } ++nOptions; +#endif } if (supportsAlpha) { assert(outputComponentsMap[param->getNOptions()] == ePixelComponentAlpha); diff --git a/ofxsTransform3x3.cpp b/ofxsTransform3x3.cpp index fbaa2e2..76d87a7 100644 --- a/ofxsTransform3x3.cpp +++ b/ofxsTransform3x3.cpp @@ -1337,11 +1337,10 @@ Transform3x3DescribeInContextBegin(ImageEffectDescriptor &desc, srcClip->addSupportedComponent(ePixelComponentRGBA); srcClip->addSupportedComponent(ePixelComponentRGB); - srcClip->addSupportedComponent(ePixelComponentXY); - srcClip->addSupportedComponent(ePixelComponentAlpha); #ifdef OFX_EXTENSIONS_NATRON srcClip->addSupportedComponent(ePixelComponentXY); #endif + srcClip->addSupportedComponent(ePixelComponentAlpha); srcClip->setTemporalClipAccess(false); srcClip->setSupportsTiles(kSupportsTiles); srcClip->setIsMask(false); @@ -1368,11 +1367,10 @@ Transform3x3DescribeInContextBegin(ImageEffectDescriptor &desc, ClipDescriptor *dstClip = desc.defineClip(kOfxImageEffectOutputClipName); dstClip->addSupportedComponent(ePixelComponentRGBA); dstClip->addSupportedComponent(ePixelComponentRGB); - dstClip->addSupportedComponent(ePixelComponentXY); - dstClip->addSupportedComponent(ePixelComponentAlpha); #ifdef OFX_EXTENSIONS_NATRON dstClip->addSupportedComponent(ePixelComponentXY); #endif + dstClip->addSupportedComponent(ePixelComponentAlpha); dstClip->setSupportsTiles(kSupportsTiles);