TuttleOFX  1
ColorSuppressPlugin.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_PLUGIN_COLORSUPPRESS_PLUGIN_HPP_
00002 #define _TUTTLE_PLUGIN_COLORSUPPRESS_PLUGIN_HPP_
00003 
00004 
00005 #include <tuttle/plugin/ImageEffectGilPlugin.hpp>
00006 #include <tuttle/common/utils/global.hpp>
00007 
00008 #include "ColorSuppressDefinitions.hpp"
00009 
00010 
00011 namespace tuttle {
00012 namespace plugin {
00013 namespace colorSuppress {
00014 
00015 struct ColorSuppressProcessParams
00016 {
00017         EOutputType output;
00018         double red, green, blue, cyan, magenta, yellow;
00019         bool obeyAlpha;
00020         bool preserveLuma;
00021 };
00022 
00023 /**
00024  * @brief ColorSuppress plugin
00025  */
00026 class ColorSuppressPlugin : public ImageEffectGilPlugin
00027 {
00028 
00029 public:
00030         ColorSuppressPlugin( OfxImageEffectHandle handle );
00031 
00032 public:
00033         void render( const OFX::RenderArguments &args );
00034         void changedParam( const OFX::InstanceChangedArgs &args, const std::string &paramName );
00035 
00036         ColorSuppressProcessParams getProcessParams( ) const;
00037 
00038 public:
00039         OFX::ChoiceParam* _paramApplyOn;
00040         OFX::DoubleParam* _paramRedRate;
00041         OFX::DoubleParam* _paramGreenRate;
00042         OFX::DoubleParam* _paramBlueRate;
00043         OFX::DoubleParam* _paramCyanRate;
00044         OFX::DoubleParam* _paramMagentaRate;
00045         OFX::DoubleParam* _paramYellowRate;
00046         OFX::BooleanParam* _paramObeyAlpha;
00047         OFX::BooleanParam* _paramPreserveLuma;
00048 
00049         EOutputType getOutputType( ) const
00050         {
00051                 return static_cast<EOutputType> ( _paramApplyOn->getValue( ) );
00052         }
00053 };
00054 
00055 }
00056 }
00057 }
00058 
00059 #endif
00060