TuttleOFX  1
ImageStatisticsOverlayInteract.cpp
Go to the documentation of this file.
00001 #include "ImageStatisticsOverlayInteract.hpp"
00002 #include "ImageStatisticsDefinitions.hpp"
00003 #include "ImageStatisticsPlugin.hpp"
00004 #include "tuttle/plugin/interact/Frame.hpp"
00005 #include "tuttle/plugin/interact/ParamRectangleFromCenterSize.hpp"
00006 #include <tuttle/plugin/interact/ParamRectangleFromTwoCorners.hpp>
00007 #include <tuttle/plugin/opengl/gl.h>
00008 #include <tuttle/plugin/interact/interact.hpp>
00009 #include <tuttle/plugin/interact/overlay.hpp>
00010 
00011 #include <boost/gil/gil_all.hpp>
00012 
00013 namespace tuttle {
00014 namespace plugin {
00015 namespace imageStatistics {
00016 
00017 ImageStatisticsOverlayInteract::ImageStatisticsOverlayInteract( OfxInteractHandle handle, OFX::ImageEffect* effect )
00018         : OFX::OverlayInteract( handle )
00019         , _infos( effect )
00020         , _interactScene( *effect, _infos )
00021 {
00022         _effect = effect;
00023         _plugin = dynamic_cast<ImageStatisticsPlugin*>( _effect );
00024 
00025         interact::InteractObject* objCanonical  = new interact::ParamRectangleFromCenterSize<interact::FrameClip, eCoordinateSystemXY>( _infos, _plugin->_paramRectCenter, _plugin->_paramRectSize, interact::FrameClip( _plugin->_clipSrc ) );
00026         interact::InteractObject* objNormalized = new interact::ParamRectangleFromCenterSize<interact::FrameClip, eCoordinateSystemXYn>( _infos, _plugin->_paramRectCenter, _plugin->_paramRectSize, interact::FrameClip( _plugin->_clipSrc ) );
00027         _interactScene.push_back( objCanonical, new interact::IsActiveChoiceParamFunctor<>( _plugin->_paramCoordinateSystem ) );
00028         _interactScene.push_back( objNormalized, new interact::IsActiveChoiceParamFunctor<true>( _plugin->_paramCoordinateSystem ) );
00029 }
00030 
00031 bool ImageStatisticsOverlayInteract::draw( const OFX::DrawArgs& args )
00032 {
00033         return _interactScene.draw( args );
00034 }
00035 
00036 bool ImageStatisticsOverlayInteract::penMotion( const OFX::PenArgs& args )
00037 {
00038         return _interactScene.penMotion( args );
00039 }
00040 
00041 bool ImageStatisticsOverlayInteract::penDown( const OFX::PenArgs& args )
00042 {
00043         return _interactScene.penDown( args );
00044 }
00045 
00046 bool ImageStatisticsOverlayInteract::penUp( const OFX::PenArgs& args )
00047 {
00048         return _interactScene.penUp( args );
00049 }
00050 
00051 }
00052 }
00053 }