TuttleOFX  1
LensDistortProcess.hpp
Go to the documentation of this file.
00001 #ifndef LENSDISTORTPROCESS_HPP
00002 #define LENSDISTORTPROCESS_HPP
00003 
00004 #include "lensDistortAlgorithm.hpp"
00005 #include <terry/sampler/sampler.hpp>
00006 
00007 #include <tuttle/plugin/global.hpp>
00008 #include <tuttle/plugin/ImageGilFilterProcessor.hpp>
00009 #include <tuttle/plugin/exceptions.hpp>
00010 #include <terry/globals.hpp>
00011 
00012 #include <ofxsImageEffect.h>
00013 #include <ofxsMultiThread.h>
00014 #include <boost/gil/gil_all.hpp>
00015 #include <boost/scoped_ptr.hpp>
00016 
00017 namespace tuttle {
00018 namespace plugin {
00019 namespace lens {
00020 
00021 namespace bgil = boost::gil;
00022 
00023 /**
00024  * @brief Plugin rendering
00025  */
00026 template<class View>
00027 class LensDistortProcess : public ImageGilFilterProcessor<View>
00028 {
00029 typedef double Scalar;     // calculations are in double
00030 
00031 protected:
00032         LensDistortPlugin&               _plugin;
00033         LensDistortProcessParams<Scalar> _p;
00034 
00035         LensDistortParams                _params;
00036 
00037 public:
00038         LensDistortProcess( LensDistortPlugin& instance );
00039 
00040         void setup( const OFX::RenderArguments& args );
00041 
00042         void multiThreadProcessImages( const OfxRectI& procWindowRoW );
00043 
00044 private:
00045         template<class Sampler>
00046         void lensDistort( View& srcView, View& dstView, const OfxRectI& procWindow, const Sampler& sampler=Sampler() );
00047 };
00048 
00049 }
00050 }
00051 }
00052 
00053 #include "LensDistortProcess.tcc"
00054 
00055 #endif