TuttleOFX  1
RampProcess.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_PLUGIN_RAMP_PROCESS_HPP_
00002 #define _TUTTLE_PLUGIN_RAMP_PROCESS_HPP_
00003 
00004 #include <tuttle/plugin/ImageGilFilterProcessor.hpp>
00005 
00006 #include <terry/globals.hpp>
00007 #include <terry/generator/ramp.hpp>
00008 
00009 #include <ofxsImageEffect.h>
00010 #include <ofxsMultiThread.h>
00011 
00012 #include <boost/gil/gil_all.hpp>
00013 #include <boost/scoped_ptr.hpp>
00014 
00015 namespace tuttle {
00016 namespace plugin {
00017 namespace ramp {
00018 
00019 
00020 template<class View>
00021 struct RampProcessParams
00022 {
00023         typedef typename View::value_type Pixel;
00024         bool  direction;
00025         bool  color;
00026         Pixel colorStart;
00027         Pixel colorEnd;
00028 };
00029 
00030 /**
00031  * @brief Ramp process
00032  *
00033  */
00034 template<class View>
00035 class RampProcess : public ImageGilProcessor<View>
00036 {
00037 public:
00038         typedef typename View::value_type Pixel;
00039         typedef terry::generator::RampFunctor<Pixel> RampFunctorT;
00040         typedef typename RampFunctorT::point_t Point;
00041         typedef boost::gil::virtual_2d_locator<RampFunctorT, false> Locator;
00042         typedef boost::gil::image_view<Locator> RampVirtualView;
00043 
00044 protected:
00045         RampPlugin&     _plugin;   ///< Rendering plugin
00046         RampVirtualView _srcView;  ///< Source view
00047 
00048 public:
00049         RampProcess( RampPlugin& effect );
00050 
00051         void setup( const OFX::RenderArguments& args );
00052 
00053         RampProcessParams<View> getProcessParams( ) const;
00054         
00055         void multiThreadProcessImages( const OfxRectI& procWindowRoW );
00056 };
00057 
00058 }
00059 }
00060 }
00061 
00062 #include "RampProcess.tcc"
00063 
00064 #endif