TuttleOFX  1
OpenImageIOWriterPlugin.cpp
Go to the documentation of this file.
00001 #include "OpenImageIOWriterDefinitions.hpp"
00002 #include "OpenImageIOWriterPlugin.hpp"
00003 #include "OpenImageIOWriterProcess.hpp"
00004 
00005 #include <imageio.h>
00006 
00007 namespace tuttle {
00008 namespace plugin {
00009 namespace openImageIO {
00010 namespace writer {
00011 
00012 OpenImageIOWriterPlugin::OpenImageIOWriterPlugin( OfxImageEffectHandle handle )
00013         : WriterPlugin( handle )
00014 {
00015         _components  = fetchChoiceParam( kTuttlePluginChannel );
00016         _orientation = fetchChoiceParam( kParamOutputOrientation );
00017         _quality     = fetchIntParam( kParamOutputQuality );
00018 }
00019 
00020 OpenImageIOWriterProcessParams OpenImageIOWriterPlugin::getProcessParams( const OfxTime time )
00021 {
00022         using namespace OpenImageIO;
00023         OpenImageIOWriterProcessParams params;
00024 
00025         params._filepath    = getAbsoluteFilenameAt( time );
00026         params._components  = static_cast<ETuttlePluginComponents>( this->_components->getValue() );
00027         params._bitDepth    = static_cast<ETuttlePluginBitDepth>( this->_paramBitDepth->getValue() );
00028         params._quality     = _quality->getValue();
00029         params._orientation = static_cast<int>( _orientation->getValue() );
00030         params._premultiply = this->_paramPremult->getValue();
00031         return params;
00032 }
00033 
00034 /**
00035  * @brief The overridden render function
00036  * @param[in]   args     Rendering parameters
00037  */
00038 void OpenImageIOWriterPlugin::render( const OFX::RenderArguments& args )
00039 {
00040         WriterPlugin::render( args );
00041 
00042         doGilRender<OpenImageIOWriterProcess>( *this, args );
00043 }
00044 
00045 }
00046 }
00047 }
00048 }