TuttleOFX
1
|
00001 #include <tuttle/plugin/ImageGilProcessor.hpp> 00002 #include <tuttle/plugin/exceptions.hpp> 00003 00004 #include <terry/globals.hpp> 00005 #include <terry/color.hpp> 00006 00007 namespace tuttle { 00008 namespace plugin { 00009 namespace colorspace { 00010 00011 using namespace boost::gil; 00012 00013 template<class View> 00014 ColorSpaceProcess<View>::ColorSpaceProcess( ColorSpacePlugin& instance ) 00015 : ImageGilFilterProcessor<View>( instance, eImageOrientationIndependant ) 00016 , _plugin( instance ) 00017 { 00018 } 00019 00020 template<class View> 00021 void ColorSpaceProcess<View>::setup( const OFX::RenderArguments& args ) 00022 { 00023 ImageGilFilterProcessor<View>::setup( args ); 00024 00025 _params = _plugin.getProcessParams(); 00026 } 00027 00028 00029 /** 00030 * @brief Function called by rendering thread each time a process must be done. 00031 * @param[in] procWindowRoW Processing window in RoW 00032 */ 00033 template<class View> 00034 void ColorSpaceProcess<View>::multiThreadProcessImages( const OfxRectI& procWindowRoW ) 00035 { 00036 OfxRectI procWindowOutput = this->translateRoWToOutputClipCoordinates( procWindowRoW ); 00037 OfxPointI procWindowSize = { 00038 procWindowRoW.x2 - procWindowRoW.x1, 00039 procWindowRoW.y2 - procWindowRoW.y1 00040 }; 00041 00042 View src = subimage_view( this->_srcView, procWindowOutput.x1, procWindowOutput.y1, 00043 procWindowSize.x, procWindowSize.y ); 00044 View dst = subimage_view( this->_dstView, procWindowOutput.x1, procWindowOutput.y1, 00045 procWindowSize.x, procWindowSize.y ); 00046 00047 /* 00048 terry::color::ColorSpaceAPI csAPI; 00049 csAPI.setGammaInProperties ( _params._sGammaIn ); 00050 csAPI.setCineonInProperties ( _params._sCineonIn ); 00051 csAPI.setGammaOutProperties ( _params._sGammaOut ); 00052 csAPI.setCineonOutProperties ( _params._sCineonOut ); 00053 00054 terry::colorspace_pixels_progress( &csAPI, _params._gradationIn, _params._layoutIn, _params._tempColorIn, _params._gradationOut, _params._layoutOut, _params._tempColorOut, src, dst, this ); 00055 */ 00056 } 00057 00058 } 00059 } 00060 }