TuttleOFX
1
|
00001 #ifndef _TUTTLE_PLUGIN_NORMALIZE_PROCESS_HPP_ 00002 #define _TUTTLE_PLUGIN_NORMALIZE_PROCESS_HPP_ 00003 00004 #include <tuttle/plugin/ImageGilFilterProcessor.hpp> 00005 #include <boost/scoped_ptr.hpp> 00006 00007 #include <boost/gil/channel_algorithm.hpp> 00008 00009 namespace tuttle { 00010 namespace plugin { 00011 namespace normalize { 00012 00013 /** 00014 * @brief Normalize process 00015 * 00016 */ 00017 template<class View> 00018 class NormalizeProcess : public ImageGilFilterProcessor<View> 00019 { 00020 public: 00021 typedef typename View::value_type Pixel; 00022 typedef typename boost::gil::channel_type<View>::type Channel; 00023 00024 00025 typedef typename boost::gil::channel_type<View>::type d_channel_t; 00026 //typedef typename boost::gil::channel_convert_to_unsigned<d_channel_t>::type channel_t; 00027 00028 typedef boost::gil::pixel<boost::gil::bits32f, d_channel_t> Ratio_pixel_t; 00029 00030 typedef float Scalar; 00031 protected : 00032 NormalizePlugin& _plugin; ///< Rendering plugin 00033 NormalizeProcessParams<Scalar> _params; ///< parameters 00034 00035 /// @brief Processing datas 00036 /// @{ 00037 boost::gil::rgba32f_pixel_t _sMin; ///< min value in source image 00038 boost::gil::rgba32f_pixel_t _dMin; ///< min value in destination image 00039 boost::gil::rgba32f_pixel_t _ratio; ///< scale to go from source to dest 00040 /// @} 00041 /* 00042 template< class WorkView, typename LocalChannel > 00043 void processChannel( View& src, View& dst, bool process, Pixel& ratio, Pixel& sMin, Pixel& dMin );*/ 00044 00045 template< class WorkView, typename LocalChannel, typename P > 00046 void processChannel( View& src, View& dst, bool process, P& ratio, P& sMin, P& dMin ); 00047 00048 public: 00049 NormalizeProcess( NormalizePlugin& effect ); 00050 00051 void setup( const OFX::RenderArguments& args ); 00052 00053 void multiThreadProcessImages( const OfxRectI& procWindowRoW ); 00054 }; 00055 00056 } 00057 } 00058 } 00059 00060 #include "NormalizeProcess.tcc" 00061 00062 #endif