//////////////////////////////////////////////////////////////////////////////// // The main function static OfxStatus pluginMain(const char *action, const void *handle, OfxPropertySetHandle inArgs, OfxPropertySetHandle outArgs) { // cast to appropriate type OfxImageEffectHandle effect = (OfxImageEffectHandle ) handle; if(strcmp(action, kOfxActionDescribe) == 0) { return describe(effect); } else if(strcmp(action, kOfxImageEffectActionDescribeInContext) == 0) { return describeInContext(effect, inArgs); } else if(strcmp(action, kOfxActionCreateInstance) == 0) { return createInstance(effect); } else if(strcmp(action, kOfxActionDestroyInstance) == 0) { return destroyInstance(effect); } else if(strcmp(action, kOfxImageEffectActionIsIdentity) == 0) { return isIdentity(effect, inArgs, outArgs); } else if(strcmp(action, kOfxImageEffectActionRender) == 0) { return render(effect, inArgs, outArgs); } else if(strcmp(action, kOfxImageEffectActionGetClipPreferences) == 0) { return getClipPreferences(effect, inArgs, outArgs); } // other actions to take the default value return kOfxStatReplyDefault; }
//////////////////////////////////////////////////////////////////////////////// // The main function static OfxStatus pluginMain(const char *action, const void *handle, OfxPropertySetHandle inArgs, OfxPropertySetHandle outArgs) { // cast to appropriate type OfxImageEffectHandle effect = (OfxImageEffectHandle) handle; if(strcmp(action, kOfxActionDescribe) == 0) { return describe(effect); } else if(strcmp(action, kOfxImageEffectActionDescribeInContext) == 0) { return describeInContext(effect, inArgs); } else if(strcmp(action, kOfxActionLoad) == 0) { return onLoad(); } else if(strcmp(action, kOfxActionUnload) == 0) { return onUnLoad(); } else if(strcmp(action, kOfxActionCreateInstance) == 0) { return createInstance(effect); } else if(strcmp(action, kOfxActionDestroyInstance) == 0) { return destroyInstance(effect); } else if(strcmp(action, kOfxImageEffectActionIsIdentity) == 0) { return isIdentity(effect, inArgs, outArgs); } else if(strcmp(action, kOfxImageEffectActionRender) == 0) { return render(effect, inArgs, outArgs); } else if(strcmp(action, kOfxImageEffectActionGetRegionOfDefinition) == 0) { return getSpatialRoD(effect, inArgs, outArgs); } else if(strcmp(action, kOfxImageEffectActionGetRegionsOfInterest) == 0) { return getSpatialRoI(effect, inArgs, outArgs); } else if(strcmp(action, kOfxImageEffectActionGetClipPreferences) == 0) { return getClipPreferences(effect, inArgs, outArgs); } else if(strcmp(action, kOfxActionInstanceChanged) == 0) { return instanceChanged(effect, inArgs, outArgs); } else if(strcmp(action, kOfxImageEffectActionGetTimeDomain) == 0) { return getTemporalDomain(effect, inArgs, outArgs); } // other actions to take the default value return kOfxStatReplyDefault; }
//////////////////////////////////////////////////////////////////////////////// // The main function static OfxStatus pluginMain(const char *action, const void *handle, OfxPropertySetHandle inArgs, OfxPropertySetHandle outArgs) { try { // cast to appropriate type OfxImageEffectHandle effect = (OfxImageEffectHandle) handle; if(strcmp(action, kOfxActionDescribe) == 0) { return describe(effect); } else if(strcmp(action, kOfxImageEffectActionDescribeInContext) == 0) { return describeInContext(effect, inArgs); } else if(strcmp(action, kOfxActionCreateInstance) == 0) { return createInstance(effect); } else if(strcmp(action, kOfxActionDestroyInstance) == 0) { return destroyInstance(effect); } else if(strcmp(action, kOfxImageEffectActionIsIdentity) == 0) { return isIdentity(effect, inArgs, outArgs); } else if(strcmp(action, kOfxImageEffectActionRender) == 0) { return render(effect, inArgs, outArgs); } } catch (std::bad_alloc) { // catch memory //std::cout << "OFX Plugin Memory error." << std::endl; return kOfxStatErrMemory; } catch ( const std::exception& e ) { // standard exceptions //std::cout << "OFX Plugin error: " << e.what() << std::endl; return kOfxStatErrUnknown; } catch (int err) { // ho hum, gone wrong somehow return err; } catch ( ... ) { // everything else //std::cout << "OFX Plugin error" << std::endl; return kOfxStatErrUnknown; } // other actions to take the default value return kOfxStatReplyDefault; }
//////////////////////////////////////////////////////////////////////////////// // The main entry point function static OfxStatus pluginMain(const char *action, const void *handle, OfxPropertySetHandle inArgs, OfxPropertySetHandle outArgs) { // cast to appropriate type OfxImageEffectHandle effect = (OfxImageEffectHandle) handle; if(strcmp(action, kOfxActionLoad) == 0) { return onLoad(); } else if(strcmp(action, kOfxActionDescribe) == 0) { return describe(effect); } else if(strcmp(action, kOfxImageEffectActionDescribeInContext) == 0) { return describeInContext(effect, inArgs); } else if(strcmp(action, kOfxImageEffectActionRender) == 0) { return render(effect, inArgs, outArgs); } // other actions to take the default value return kOfxStatReplyDefault; }