TuttleOFX
1
|
00001 #ifndef _TUTTLE_PLUGIN_OCIOLutPlugin_HPP_ 00002 #define _TUTTLE_PLUGIN_OCIOLutPlugin_HPP_ 00003 00004 #include "OCIOLutDefinitions.hpp" 00005 #include <tuttle/plugin/ImageEffectGilPlugin.hpp> 00006 #include <OpenColorIO/OpenColorIO.h> 00007 00008 namespace OCIO = OCIO_NAMESPACE; 00009 00010 namespace tuttle { 00011 namespace plugin { 00012 namespace ocio { 00013 namespace lut { 00014 00015 struct OCIOLutProcessParams 00016 { 00017 std::string _filename; 00018 OCIO::Interpolation _interpolationType; 00019 00020 }; 00021 00022 /** 00023 * @brief OCIO LUT plugin 00024 * 00025 */ 00026 class OCIOLutPlugin : public ImageEffectGilPlugin 00027 { 00028 00029 public: 00030 OCIOLutPlugin( OfxImageEffectHandle handle ); 00031 00032 public: 00033 void render( const OFX::RenderArguments& args ); 00034 00035 public: 00036 OFX::StringParam* _paramFilename; 00037 OFX::ChoiceParam* _paramInterpolationType; 00038 00039 OCIOLutProcessParams getProcessParams( const OfxPointD& renderScale = OFX::kNoRenderScale ) const; 00040 00041 EInterpolationType getInterpolationType( ) const 00042 { 00043 return static_cast<EInterpolationType> ( _paramInterpolationType->getValue( ) ); 00044 } 00045 00046 OCIO_NAMESPACE::Interpolation getOCIOInterpolationType( EInterpolationType tuttleInterpolationType ) const 00047 { 00048 switch( tuttleInterpolationType ) 00049 { 00050 case eInterpolationTypeNearest: 00051 return OCIO_NAMESPACE::INTERP_NEAREST; 00052 case eInterpolationTypeTetrahedral: 00053 return OCIO_NAMESPACE::INTERP_TETRAHEDRAL; 00054 case eInterpolationTypeLinear: 00055 return OCIO_NAMESPACE::INTERP_LINEAR; 00056 } 00057 BOOST_ASSERT(false); 00058 return OCIO_NAMESPACE::INTERP_LINEAR; 00059 } 00060 }; 00061 00062 } 00063 } 00064 } 00065 } 00066 #endif