TuttleOFX  1
ColorWheelProcess.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_PLUGIN_COLORWHEEL_PROCESS_HPP_
00002 #define _TUTTLE_PLUGIN_COLORWHEEL_PROCESS_HPP_
00003 
00004 #include <tuttle/plugin/ImageGilFilterProcessor.hpp>
00005 
00006 #include <terry/globals.hpp>
00007 #include <terry/generator/colorwheel.hpp>
00008 #include <terry/generator/rainbow.hpp>
00009 
00010 #include <ofxsImageEffect.h>
00011 #include <ofxsMultiThread.h>
00012 
00013 #include <boost/gil/gil_all.hpp>
00014 #include <boost/scoped_ptr.hpp>
00015 
00016 namespace tuttle {
00017 namespace plugin {
00018 namespace colorWheel {
00019 
00020 /**
00021  * @brief ColorWheel process
00022  *
00023  */
00024 template<class View>
00025 class ColorWheelProcess : public ImageGilProcessor<View>
00026 {
00027 public:
00028         typedef typename View::value_type Pixel;
00029         typedef terry::generator::ColorWheelFunctor<Pixel> ColorWheelFunctorT;
00030     typedef typename ColorWheelFunctorT::point_t ColorWheelPoint;
00031     typedef boost::gil::virtual_2d_locator<ColorWheelFunctorT, false> ColorWheelLocator;
00032     typedef boost::gil::image_view<ColorWheelLocator> ColorWheelVirtualView;
00033         
00034     typedef terry::generator::RainbowFunctor<Pixel> RainbowFunctorT;
00035     typedef typename RainbowFunctorT::point_t RainbowPoint;
00036     typedef boost::gil::virtual_2d_locator<RainbowFunctorT, false> RainbowLocator;
00037     typedef boost::gil::image_view<RainbowLocator> RainbowVirtualView;
00038 
00039 protected:
00040         ColorWheelPlugin&     _plugin;   ///< Rendering plugin
00041     ColorWheelVirtualView _srcColorWheelView;  ///< Source view
00042     RainbowVirtualView    _srcRainbowView;  ///< Source view
00043 
00044     ColorWheelProcessParams _params;
00045 
00046 public:
00047         ColorWheelProcess( ColorWheelPlugin& effect );
00048 
00049         void setup( const OFX::RenderArguments& args );
00050 
00051         void multiThreadProcessImages( const OfxRectI& procWindowRoW );
00052 };
00053 
00054 }
00055 }
00056 }
00057 
00058 #include "ColorWheelProcess.tcc"
00059 
00060 #endif