TuttleOFX  1
ColorGradationPlugin.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_PLUGIN_COLORGRADATION_PLUGIN_HPP_
00002 #define _TUTTLE_PLUGIN_COLORGRADATION_PLUGIN_HPP_
00003 
00004 #include "ColorGradationDefinitions.hpp"
00005 #include <tuttle/plugin/ImageEffectGilPlugin.hpp>
00006 
00007 namespace tuttle {
00008 namespace plugin {
00009 namespace colorGradation {
00010 
00011 template<typename Scalar>
00012 struct ColorGradationProcessParams
00013 {
00014         EParamGradation   _in;
00015         EParamGradation   _out;
00016 
00017         double            _GammaValueIn;
00018         double            _BlackPointIn;
00019         double            _WhitePointIn;
00020         double            _GammaSensitoIn;
00021 
00022         double            _GammaValueOut;
00023         double            _BlackPointOut;
00024         double            _WhitePointOut;
00025         double            _GammaSensitoOut;
00026 
00027         bool              _processAlpha;
00028 };
00029 
00030 /**
00031  * @brief ColorGradation plugin
00032  */
00033 class ColorGradationPlugin : public ImageEffectGilPlugin
00034 {
00035 public:
00036         typedef float Scalar;
00037 
00038 public:
00039         ColorGradationPlugin( OfxImageEffectHandle handle );
00040 
00041 public:
00042         ColorGradationProcessParams<Scalar> getProcessParams( const OfxPointD& renderScale = OFX::kNoRenderScale ) const;
00043 
00044         void changedParam( const OFX::InstanceChangedArgs& args, const std::string& paramName );
00045 
00046         bool isIdentity( const OFX::RenderArguments& args, OFX::Clip*& identityClip, double& identityTime );
00047 
00048         void render( const OFX::RenderArguments& args );
00049 
00050 private:
00051         void updateParameters();
00052 
00053 public:
00054         OFX::ChoiceParam*       _paramIn;
00055         OFX::ChoiceParam*       _paramOut;
00056 
00057         OFX::DoubleParam*       _paramInGamma;
00058         OFX::DoubleParam*       _paramOutGamma;
00059         OFX::DoubleParam*       _paramInBlackPoint;
00060         OFX::DoubleParam*       _paramOutBlackPoint;
00061         OFX::DoubleParam*       _paramInWhitePoint;
00062         OFX::DoubleParam*       _paramOutWhitePoint;
00063         OFX::DoubleParam*       _paramInGammaSensito;
00064         OFX::DoubleParam*       _paramOutGammaSensito;
00065 
00066         OFX::BooleanParam*      _paramProcessAlpha;
00067 };
00068 
00069 }
00070 }
00071 }
00072 
00073 #endif