TuttleOFX  1
tuttle::plugin::lens::LensDistortPlugin Class Reference

Main class of the lens distortion. More...

#include <LensDistortPlugin.hpp>

Inheritance diagram for tuttle::plugin::lens::LensDistortPlugin:
Collaboration diagram for tuttle::plugin::lens::LensDistortPlugin:

Public Types

typedef double Scalar
typedef boost::gil::point2
< double > 
Point2

Public Member Functions

 LensDistortPlugin (OfxImageEffectHandle handle)
void render (const OFX::RenderArguments &args)
 The overridden render function.
void changedParam (const OFX::InstanceChangedArgs &args, const std::string &paramName)
 called when a param has just had its value changed
bool isIdentity (const OFX::RenderArguments &args, OFX::Clip *&identityClip, double &identityTime)
 client is identity function, returns the clip and time for the identity function
bool getRegionOfDefinition (const OFX::RegionOfDefinitionArguments &args, OfxRectD &rod)
 The get RoD action.
void getRegionsOfInterest (const OFX::RegionsOfInterestArguments &args, OFX::RegionOfInterestSetter &rois)
 the get region of interest action
LensDistortProcessParams< ScalargetProcessParams (const OfxRectD &inputRod, const OfxRectD &outputRod, const OfxRectD &optionalInputRod, const double pixelAspectRatio, const bool reverse=false) const
LensDistortProcessParams< ScalargetProcessParams (const OfxRectD &inputRod, const OfxRectD &outputRod, const double pixelAspectRatio, const bool reverse=false) const
LensDistortParams getProcessParams () const
const EParamLensType getLensType () const
const EParamCenterType getCenterType () const
const EParamResizeRod getResizeRod () const

Data Fields

OFX::Clip_srcRefClip
OFX::BooleanParam_reverse
 reverse the effect
OFX::BooleanParam_displaySource
 do nothing (so host displays input)
OFX::ChoiceParam_lensType
 choice to select lens type
OFX::DoubleParam_coef1
 distortion coeffiscient
OFX::DoubleParam_coef2
 distortion coeffiscient for fish-eye lens
OFX::DoubleParam_squeeze
 squeeze coefficient horizontally/vertically (not implemented yet)
OFX::Double2DParam_asymmetric
 lens distortion is asymmetric horizontally/vertically (not implemented yet)
OFX::Double2DParam_center
 center coordonnates
OFX::BooleanParam_centerOverlay
 lens center overlay
OFX::ChoiceParam_centerType
 centered the lens distortion on source RoD or image size (not implemented yet)
OFX::DoubleParam_postScale
 scale after applying the lens distortion
OFX::DoubleParam_preScale
 scale before applying the lens distortion
OFX::ChoiceParam_resizeRod
 Choice how to resize the RoD (default 'no' resize)
OFX::DoubleParam_resizeRodManualScale
 scale the output RoD
OFX::GroupParam_groupDisplayParams
 group of all overlay options (don't modify the output image)
OFX::BooleanParam_gridOverlay
 grid overlay
OFX::Double2DParam_gridCenter
 grid center
OFX::BooleanParam_gridCenterOverlay
 grid center overlay
OFX::Double2DParam_gridScale
 grid scale
OFX::BooleanParam_debugDisplayRoi
 debug display options

Static Public Attributes

static OfxRectD _dstRoi = { 0, 0, 0, 0 }
static OfxRectD _srcRoi = { 0, 0, 0, 0 }
static OfxRectD _srcRealRoi = { 0, 0, 0, 0 }

Private Member Functions

void initParamsProps ()

Detailed Description

Main class of the lens distortion.

Definition at line 28 of file LensDistortPlugin.hpp.


Member Typedef Documentation

typedef boost::gil::point2<double> tuttle::plugin::lens::LensDistortPlugin::Point2

Definition at line 32 of file LensDistortPlugin.hpp.

Definition at line 31 of file LensDistortPlugin.hpp.


Constructor & Destructor Documentation

tuttle::plugin::lens::LensDistortPlugin::LensDistortPlugin ( OfxImageEffectHandle  handle)

Definition at line 20 of file LensDistortPlugin.cpp.

References _asymmetric, _center, _centerOverlay, _centerType, _coef1, _coef2, _debugDisplayRoi, _displaySource, _gridCenter, _gridCenterOverlay, _gridOverlay, _gridScale, _groupDisplayParams, _lensType, _postScale, _preScale, _resizeRod, _resizeRodManualScale, _reverse, _squeeze, _srcRefClip, OFX::ParamSet::fetchBooleanParam(), OFX::ParamSet::fetchChoiceParam(), OFX::ImageEffect::fetchClip(), OFX::ParamSet::fetchDouble2DParam(), OFX::ParamSet::fetchDoubleParam(), OFX::ParamSet::fetchGroupParam(), initParamsProps(), tuttle::plugin::lens::kClipOptionalSourceRef(), tuttle::plugin::lens::kParamAsymmetric(), tuttle::plugin::lens::kParamCenter(), tuttle::plugin::lens::kParamCenterOverlay(), tuttle::plugin::lens::kParamCenterType(), tuttle::plugin::lens::kParamCoef1(), tuttle::plugin::lens::kParamCoef2(), tuttle::plugin::lens::kParamDebugDisplayRoi(), tuttle::plugin::lens::kParamDisplayOptions(), tuttle::plugin::lens::kParamDisplaySource(), tuttle::plugin::lens::kParamGridCenter(), tuttle::plugin::lens::kParamGridCenterOverlay(), tuttle::plugin::lens::kParamGridOverlay(), tuttle::plugin::lens::kParamGridScale(), tuttle::plugin::lens::kParamLensType(), tuttle::plugin::lens::kParamPostScale(), tuttle::plugin::lens::kParamPreScale(), tuttle::plugin::lens::kParamResizeRod(), tuttle::plugin::lens::kParamResizeRodManualScale(), tuttle::plugin::lens::kParamReverse(), and tuttle::plugin::lens::kParamSqueeze().

Here is the call graph for this function:


Member Function Documentation

void tuttle::plugin::lens::LensDistortPlugin::changedParam ( const OFX::InstanceChangedArgs args,
const std::string &  paramName 
) [virtual]
const EParamCenterType tuttle::plugin::lens::LensDistortPlugin::getCenterType ( ) const [inline]

Definition at line 97 of file LensDistortPlugin.hpp.

References _centerType, and OFX::ChoiceParam::getValue().

Referenced by getProcessParams().

Here is the call graph for this function:

const EParamLensType tuttle::plugin::lens::LensDistortPlugin::getLensType ( ) const [inline]

Definition at line 96 of file LensDistortPlugin.hpp.

References _lensType, and OFX::ChoiceParam::getValue().

Referenced by tuttle::plugin::lens::LensDistortOverlayInteract::draw(), getRegionOfDefinition(), and getRegionsOfInterest().

Here is the call graph for this function:

LensDistortProcessParams< LensDistortPlugin::Scalar > tuttle::plugin::lens::LensDistortPlugin::getProcessParams ( const OfxRectD inputRod,
const OfxRectD outputRod,
const OfxRectD optionalInputRod,
const double  pixelAspectRatio,
const bool  reverse = false 
) const
Todo:
pixelRatio !

Definition at line 327 of file LensDistortPlugin.cpp.

References _asymmetric, tuttle::plugin::lens::AdvancedLensDistortParams< F >::_asymmetric, _center, _coef1, tuttle::plugin::lens::NormalLensDistortParams< F >::_coef1, _coef2, tuttle::plugin::lens::FisheyeLensDistortParams< F >::_coef2, tuttle::plugin::lens::NormalLensDistortParams< F >::_distort, tuttle::plugin::lens::CoordonatesSystemParams< F >::_imgCenterDst, tuttle::plugin::lens::CoordonatesSystemParams< F >::_imgCenterSrc, tuttle::plugin::lens::CoordonatesSystemParams< F >::_imgHalfDiagonal, tuttle::plugin::lens::CoordonatesSystemParams< F >::_imgSizeSrc, tuttle::plugin::lens::NormalLensDistortParams< F >::_lensCenterDst, tuttle::plugin::lens::NormalLensDistortParams< F >::_lensCenterSrc, tuttle::plugin::lens::CoordonatesSystemParams< F >::_pixelRatio, _postScale, tuttle::plugin::lens::NormalLensDistortParams< F >::_postScale, _preScale, tuttle::plugin::lens::NormalLensDistortParams< F >::_preScale, _reverse, _squeeze, tuttle::plugin::lens::AdvancedLensDistortParams< F >::_squeeze, tuttle::plugin::lens::eParamCenterTypeRoW, tuttle::plugin::lens::eParamCenterTypeSource, getCenterType(), OFX::DoubleParam::getValue(), OFX::Double2DParam::getValue(), OFX::BooleanParam::getValue(), tuttle::plugin::ofxToGil(), tuttle::plugin::pointNormalizedXXcToCanonicalXY(), OfxRectD::x1, OfxRectD::x2, OfxRectD::y1, and OfxRectD::y2.

Referenced by tuttle::plugin::lens::LensDistortOverlayInteract::draw().

Here is the call graph for this function:

LensDistortProcessParams<Scalar> tuttle::plugin::lens::LensDistortPlugin::getProcessParams ( const OfxRectD inputRod,
const OfxRectD outputRod,
const double  pixelAspectRatio,
const bool  reverse = false 
) const [inline]

Definition at line 87 of file LensDistortPlugin.hpp.

References getProcessParams().

Here is the call graph for this function:

void tuttle::plugin::lens::LensDistortPlugin::getRegionsOfInterest ( const OFX::RegionsOfInterestArguments args,
OFX::RegionOfInterestSetter rois 
) [virtual]

the get region of interest action

the get RoI action

If the effect wants change its region of interest on any input clip from the default values (which is the same as the RoI in the arguments) it should do so by calling the OFX::RegionOfInterestSetter::setRegionOfInterest function on the rois argument.

Note, everything is in cannonical coordinates.

Reimplemented from OFX::ImageEffect.

Definition at line 241 of file LensDistortPlugin.cpp.

References tuttle::plugin::ImageEffectGilPlugin::_clipDst, tuttle::plugin::ImageEffectGilPlugin::_clipSrc, _debugDisplayRoi, _dstRoi, _srcRealRoi, _srcRefClip, _srcRoi, terry::sampler::eParamFilterBC, terry::sampler::eParamFilterBicubic, terry::sampler::eParamFilterBilinear, terry::sampler::eParamFilterCatrom, terry::sampler::eParamFilterGaussian, terry::sampler::eParamFilterKeys, terry::sampler::eParamFilterLanczos, terry::sampler::eParamFilterLanczos12, terry::sampler::eParamFilterLanczos3, terry::sampler::eParamFilterLanczos4, terry::sampler::eParamFilterLanczos6, terry::sampler::eParamFilterMitchell, terry::sampler::eParamFilterNearest, terry::sampler::eParamFilterParzen, terry::sampler::eParamFilterRifman, terry::sampler::eParamFilterSimon, OFX::Clip::getCanonicalRod(), tuttle::plugin::SamplerPlugin::getInterpolation(), getLensType(), OFX::Clip::getPixelAspectRatio(), getProcessParams(), OFX::BooleanParam::getValue(), OFX::Clip::isConnected(), tuttle::rectanglesIntersection(), OFX::RegionsOfInterestArguments::regionOfInterest, OFX::RegionOfInterestSetter::setRegionOfInterest(), OFX::RegionsOfInterestArguments::time, tuttle::plugin::lens::transformValues(), OfxRectD::x1, OfxRectD::x2, OfxRectD::y1, and OfxRectD::y2.

Here is the call graph for this function:

const EParamResizeRod tuttle::plugin::lens::LensDistortPlugin::getResizeRod ( ) const [inline]

Definition at line 98 of file LensDistortPlugin.hpp.

References _resizeRod, and OFX::ChoiceParam::getValue().

Here is the call graph for this function:

void tuttle::plugin::lens::LensDistortPlugin::initParamsProps ( ) [private]

Definition at line 49 of file LensDistortPlugin.cpp.

References changedParam(), tuttle::plugin::kParamFilter, tuttle::plugin::lens::kParamLensType(), and tuttle::plugin::lens::kParamResizeRod().

Referenced by LensDistortPlugin().

Here is the call graph for this function:

bool tuttle::plugin::lens::LensDistortPlugin::isIdentity ( const OFX::RenderArguments args,
OFX::Clip *&  identityClip,
double &  identityTime 
) [virtual]

client is identity function, returns the clip and time for the identity function

If the effect would do no processing for the given param set and render arguments, then this function should return true and set the identityClip pointer to point to the clip that is the identity and identityTime to be the time at which to access the clip for the identity operation.

Reimplemented from OFX::ImageEffect.

Definition at line 124 of file LensDistortPlugin.cpp.

References _asymmetric, tuttle::plugin::ImageEffectGilPlugin::_clipSrc, _coef1, _coef2, _displaySource, _postScale, _preScale, _squeeze, OFX::DoubleParam::getDefault(), OFX::Double2DParam::getDefault(), OFX::Param::getIsEnable(), OFX::DoubleParam::getValue(), OFX::Double2DParam::getValue(), OFX::BooleanParam::getValue(), and OFX::RenderArguments::time.

Here is the call graph for this function:

void tuttle::plugin::lens::LensDistortPlugin::render ( const OFX::RenderArguments args) [virtual]

The overridden render function.

Parameters:
[in]argsRendering parameters

Implements OFX::ImageEffect.

Definition at line 62 of file LensDistortPlugin.cpp.


Field Documentation

lens distortion is asymmetric horizontally/vertically (not implemented yet)

Definition at line 46 of file LensDistortPlugin.hpp.

Referenced by changedParam(), getProcessParams(), isIdentity(), and LensDistortPlugin().

centered the lens distortion on source RoD or image size (not implemented yet)

Definition at line 49 of file LensDistortPlugin.hpp.

Referenced by getCenterType(), getProcessParams(), and LensDistortPlugin().

distortion coeffiscient for fish-eye lens

Definition at line 44 of file LensDistortPlugin.hpp.

Referenced by changedParam(), getProcessParams(), isIdentity(), and LensDistortPlugin().

can't use static because it's common to all plugin instances... so it's not perfect but it's just here for debug purpose (used in overlay)

Definition at line 68 of file LensDistortPlugin.hpp.

Referenced by tuttle::plugin::lens::LensDistortOverlayInteract::draw(), and getRegionsOfInterest().

group of all overlay options (don't modify the output image)

Definition at line 55 of file LensDistortPlugin.hpp.

Referenced by LensDistortPlugin().

scale after applying the lens distortion

Definition at line 50 of file LensDistortPlugin.hpp.

Referenced by getProcessParams(), isIdentity(), and LensDistortPlugin().

scale before applying the lens distortion

Definition at line 51 of file LensDistortPlugin.hpp.

Referenced by getProcessParams(), isIdentity(), and LensDistortPlugin().

Choice how to resize the RoD (default 'no' resize)

Definition at line 52 of file LensDistortPlugin.hpp.

Referenced by changedParam(), getRegionOfDefinition(), getResizeRod(), and LensDistortPlugin().

squeeze coefficient horizontally/vertically (not implemented yet)

Definition at line 45 of file LensDistortPlugin.hpp.

Referenced by changedParam(), getProcessParams(), isIdentity(), and LensDistortPlugin().


The documentation for this class was generated from the following files: