TuttleOFX
1
|
#include <CropPlugin.hpp>
Definition at line 25 of file CropPlugin.hpp.
tuttle::plugin::crop::CropPlugin::CropPlugin | ( | OfxImageEffectHandle | handle | ) |
Definition at line 20 of file CropPlugin.cpp.
References _changedArgs, _paramAxis, _paramCropRegion, _paramFillColor, _paramFixedRatio, _paramMode, _paramOverlay, _paramPreset, _paramRatio, _paramSymmetric, _paramXMax, _paramXMin, _paramYMax, _paramYMin, changedParam(), OFX::ParamSet::fetchBooleanParam(), OFX::ParamSet::fetchChoiceParam(), OFX::ParamSet::fetchDoubleParam(), OFX::ParamSet::fetchGroupParam(), OFX::ParamSet::fetchIntParam(), OFX::ParamSet::fetchRGBAParam(), tuttle::plugin::crop::kParamAxis, tuttle::plugin::crop::kParamFillColor, tuttle::plugin::crop::kParamFixedRatio, tuttle::plugin::crop::kParamGroupCropRegion, tuttle::plugin::crop::kParamMode, tuttle::plugin::crop::kParamOverlay, tuttle::plugin::crop::kParamPreset, tuttle::plugin::crop::kParamRatio, tuttle::plugin::crop::kParamSymmetric, tuttle::plugin::crop::kParamXMax, tuttle::plugin::crop::kParamXMin, tuttle::plugin::crop::kParamYMax, and tuttle::plugin::crop::kParamYMin.
void tuttle::plugin::crop::CropPlugin::changedClip | ( | const OFX::InstanceChangedArgs & | args, |
const std::string & | clipName | ||
) | [virtual] |
called when a clip has just been changed in some way (a rewire maybe)
Reimplemented from OFX::ImageEffect.
Definition at line 181 of file CropPlugin.cpp.
References _changedArgs, changedParam(), kOfxImageEffectSimpleSourceClipName, and tuttle::plugin::crop::kParamRatio.
void tuttle::plugin::crop::CropPlugin::changedParam | ( | const OFX::InstanceChangedArgs & | args, |
const std::string & | paramName | ||
) | [virtual] |
called when a param has just had its value changed
Reimplemented from OFX::ImageEffect.
Definition at line 192 of file CropPlugin.cpp.
References _paramAxis, _paramFixedRatio, _paramPreset, _paramRatio, _paramSymmetric, _paramXMax, _paramXMin, _paramYMax, _paramYMin, computeCropRegion(), tuttle::plugin::crop::eParamAxisX, tuttle::plugin::crop::eParamAxisXY, tuttle::plugin::crop::eParamAxisY, tuttle::plugin::crop::eParamPreset_1_33, tuttle::plugin::crop::eParamPreset_1_77, tuttle::plugin::crop::eParamPreset_1_85, tuttle::plugin::crop::eParamPreset_2_35, tuttle::plugin::crop::eParamPreset_2_40, tuttle::plugin::crop::eParamPreset_custom, tuttle::plugin::crop::eParamSymmetricX, tuttle::plugin::crop::eParamSymmetricXY, tuttle::plugin::crop::eParamSymmetricY, getCropRegionValue(), OFX::DoubleParam::getValue(), OFX::ChoiceParam::getValue(), OFX::BooleanParam::getValue(), tuttle::plugin::crop::kParamAxis, tuttle::plugin::crop::kParamFixedRatio, tuttle::plugin::crop::kParamPreset, tuttle::plugin::crop::kParamRatio, tuttle::plugin::crop::kParamSymmetric, tuttle::plugin::crop::kParamXMax, tuttle::plugin::crop::kParamXMin, tuttle::plugin::crop::kParamYMax, tuttle::plugin::crop::kParamYMin, OFX::Param::setEnabled(), OFX::Param::setIsSecretAndDisabled(), OFX::IntParam::setValue(), OFX::DoubleParam::setValue(), OFX::ChoiceParam::setValue(), OFX::InstanceChangedArgs::time, OfxRectI::x1, OfxRectI::x2, OfxRectI::y1, and OfxRectI::y2.
Referenced by changedClip(), and CropPlugin().
OfxRectI tuttle::plugin::crop::CropPlugin::computeCropRegion | ( | const OfxTime | time, |
const bool | fromRatio = false |
||
) | const |
Definition at line 67 of file CropPlugin.cpp.
References tuttle::plugin::ImageEffectGilPlugin::_clipSrc, _paramAxis, _paramFixedRatio, _paramRatio, _paramSymmetric, tuttle::plugin::crop::eParamAxisX, tuttle::plugin::crop::eParamAxisXY, tuttle::plugin::crop::eParamAxisY, tuttle::plugin::crop::eParamSymmetricNone, tuttle::plugin::crop::eParamSymmetricX, tuttle::plugin::crop::eParamSymmetricXY, tuttle::plugin::crop::eParamSymmetricY, getCropRegionValue(), OFX::Clip::getPixelRod(), OFX::Clip::getPixelRodSize(), OFX::DoubleParam::getValue(), OFX::ChoiceParam::getValue(), OFX::BooleanParam::getValue(), OFX::Clip::isConnected(), safeModulo(), std::swap(), OfxPointI::x, OfxRectI::x1, OfxRectI::x2, OfxPointI::y, OfxRectI::y1, and OfxRectI::y2.
Referenced by changedParam(), and getProcessParams().
OfxRectI tuttle::plugin::crop::CropPlugin::getCropRegionValue | ( | ) | const |
Definition at line 45 of file CropPlugin.cpp.
References _paramXMax, _paramXMin, _paramYMax, _paramYMin, OFX::IntParam::getValue(), OfxRectI::x1, OfxRectI::x2, OfxRectI::y1, and OfxRectI::y2.
Referenced by changedParam(), and computeCropRegion().
CropProcessParams< Pixel > tuttle::plugin::crop::CropPlugin::getProcessParams | ( | const OfxTime | time, |
const OfxPointD & | renderScale = OFX::kNoRenderScale |
||
) | const |
Definition at line 64 of file CropPlugin.hpp.
References tuttle::plugin::crop::CropProcessParams< Pixel >::_color, tuttle::plugin::crop::CropProcessParams< Pixel >::_cropRegion, tuttle::plugin::crop::CropProcessParams< Pixel >::_mode, _paramFillColor, _paramMode, boost::gil::color_convert(), computeCropRegion(), OFX::RGBAParam::getValue(), OFX::ChoiceParam::getValue(), tuttle::plugin::ofxToGil(), OfxPointD::x, OfxRectI::x1, OfxRectI::x2, OfxPointD::y, OfxRectI::y1, and OfxRectI::y2.
Referenced by getRegionOfDefinition().
bool tuttle::plugin::crop::CropPlugin::getRegionOfDefinition | ( | const OFX::RegionOfDefinitionArguments & | args, |
OfxRectD & | rod | ||
) | [virtual] |
The get RoD action.
If the effect wants change the rod from the default value (which is the union of RoD's of all input clips) it should set the rod argument and return true.
This is all in cannonical coordinates.
Reimplemented from OFX::ImageEffect.
Definition at line 374 of file CropPlugin.cpp.
References tuttle::plugin::crop::CropProcessParams< Pixel >::_cropRegion, _paramMode, tuttle::plugin::crop::eParamModeCrop, tuttle::plugin::crop::eParamModeFillColor, getProcessParams(), OFX::ChoiceParam::getValue(), OFX::RegionOfDefinitionArguments::time, OfxRectI::x1, OfxRectD::x1, OfxRectI::x2, OfxRectD::x2, OfxRectI::y1, OfxRectD::y1, OfxRectI::y2, and OfxRectD::y2.
void tuttle::plugin::crop::CropPlugin::render | ( | const OFX::RenderArguments & | args | ) | [virtual] |
The overridden render function.
[in] | args | Rendering parameters |
Implements OFX::ImageEffect.
Definition at line 404 of file CropPlugin.cpp.
int tuttle::plugin::crop::CropPlugin::safeModulo | ( | const int & | cropValue, |
const int & | rodValue | ||
) | [static, private] |
Definition at line 56 of file CropPlugin.cpp.
Referenced by computeCropRegion().
Definition at line 59 of file CropPlugin.hpp.
Referenced by changedClip(), and CropPlugin().
Definition at line 46 of file CropPlugin.hpp.
Referenced by changedParam(), computeCropRegion(), and CropPlugin().
Definition at line 52 of file CropPlugin.hpp.
Referenced by CropPlugin().
Definition at line 45 of file CropPlugin.hpp.
Referenced by CropPlugin(), and getProcessParams().
Definition at line 48 of file CropPlugin.hpp.
Referenced by changedParam(), computeCropRegion(), and CropPlugin().
Definition at line 44 of file CropPlugin.hpp.
Referenced by CropPlugin(), getProcessParams(), and getRegionOfDefinition().
Definition at line 51 of file CropPlugin.hpp.
Referenced by CropPlugin().
Definition at line 50 of file CropPlugin.hpp.
Referenced by changedParam(), and CropPlugin().
Definition at line 49 of file CropPlugin.hpp.
Referenced by changedParam(), computeCropRegion(), and CropPlugin().
Definition at line 47 of file CropPlugin.hpp.
Referenced by changedParam(), computeCropRegion(), and CropPlugin().
Definition at line 55 of file CropPlugin.hpp.
Referenced by changedParam(), CropPlugin(), and getCropRegionValue().
Definition at line 53 of file CropPlugin.hpp.
Referenced by changedParam(), CropPlugin(), and getCropRegionValue().
Definition at line 56 of file CropPlugin.hpp.
Referenced by changedParam(), CropPlugin(), and getCropRegionValue().
Definition at line 54 of file CropPlugin.hpp.
Referenced by changedParam(), CropPlugin(), and getCropRegionValue().