TuttleOFX  1
CheckerboardProcess.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_PLUGIN_CHECKERBOARD_PROCESS_HPP_
00002 #define _TUTTLE_PLUGIN_CHECKERBOARD_PROCESS_HPP_
00003 
00004 #include <terry/globals.hpp>
00005 #include <terry/generator/checkerboard.hpp>
00006 
00007 #include <tuttle/plugin/ImageGilProcessor.hpp>
00008 #include <tuttle/plugin/exceptions.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 checkerboard {
00019 
00020 template<class View>
00021 struct CheckerboardParams
00022 {
00023         typedef typename View::value_type Pixel;
00024         boost::gil::point2<int> _boxes;
00025         Pixel _color1;
00026         Pixel _color2;
00027 };
00028 
00029 template<class View>
00030 class CheckerboardProcess : public ImageGilProcessor<View>
00031 {
00032 public:
00033         typedef typename View::value_type Pixel;
00034         typedef terry::generator::CheckerboardFunctor<Pixel> CheckerboardFunctorT;
00035         typedef typename CheckerboardFunctorT::point_t Point;
00036         typedef boost::gil::virtual_2d_locator<CheckerboardFunctorT, false> Locator;
00037         typedef boost::gil::image_view<Locator> CheckerboardVirtualView;
00038 
00039 protected:
00040         CheckerboardPlugin&     _plugin;        ///< Rendering plugin
00041         CheckerboardVirtualView _srcView;       ///< Source view
00042 
00043 public:
00044         CheckerboardProcess( CheckerboardPlugin& instance );
00045 
00046         void setup( const OFX::RenderArguments& args );
00047 
00048         CheckerboardParams<View> getParams();
00049 
00050         void multiThreadProcessImages( const OfxRectI& procWindowRoW );
00051 };
00052 
00053 }
00054 }
00055 }
00056 
00057 #include "CheckerboardProcess.tcc"
00058 
00059 #endif