MCPcopy Create free account
hub / github.com/NatronGitHub/openfx-misc / TestPositionPlugin

Method TestPositionPlugin

Test/TestPosition.cpp:59–101  ·  view source on GitHub ↗

@brief ctor */

Source from the content-addressed store, hash-verified

57public:
58 /** @brief ctor */
59 TestPositionPlugin(OfxImageEffectHandle handle)
60 : Transform3x3Plugin(handle, /*masked=*/ true, eTransform3x3ParamsTypeMotionBlur) // plugin is masked because it cannot be composed downwards
61 , _translate(NULL)
62 {
63 // NON-GENERIC
64 _translate = fetchDouble2DParam(kParamPositionTranslate);
65 assert(_translate);
66#if defined(OFX_EXTENSIONS_NUKE) && defined(TEST_SETTINGS)
67 NukeOfxGlobalSettingsSuiteV1* gGlobalSettingsSuite = (NukeOfxGlobalSettingsSuiteV1*)fetchSuite(kNukeOfxGlobalSettingsSuite, 1, true);
68 if (gGlobalSettingsSuite) {
69 // enumerate all settings
70 int settingsCount;
71 OfxStatus stat;
72 stat = gGlobalSettingsSuite->getSettingsCount(handle, &settingsCount);
73 if (stat != kOfxStatOK) {
74 std::cout << "Could not get settings count\n";
75 } else {
76 std::cout << "Found " << settingsCount << " settings:\n";
77 for (int i = 0; i < settingsCount; ++i) {
78 char* settingsName;
79 stat = gGlobalSettingsSuite->getSettingsName(handle, i, &settingsName);
80 throwSuiteStatusException(stat);
81 std::cout << "Name: " << settingsName << std::endl;
82 char* strvalue = NULL;
83 stat = gGlobalSettingsSuite->getSettingStringValue(handle, settingsName, &strvalue);
84 if (stat == kOfxStatOK && strvalue != NULL) {
85 std::cout << "Value=" << strvalue << std::endl;
86 free(strvalue);
87 } else {
88 for (int d = 0; d < 4; ++d) {
89 double value = -1;
90 stat = gGlobalSettingsSuite->getSettingDoubleValue(handle, settingsName, d, &value);
91 if (stat == kOfxStatOK) {
92 std::cout << "Value[" << d << "]=" << value << std::endl;
93 }
94 }
95 }
96 free(settingsName);
97 }
98 }
99 }
100#endif
101 }
102
103private:
104 virtual bool isIdentity(double time) OVERRIDE FINAL;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected