TuttleOFX  1
EXRReaderPlugin.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_PLUGIN_EXR_READER_PLUGIN_HPP_
00002 #define _TUTTLE_PLUGIN_EXR_READER_PLUGIN_HPP_
00003 
00004 #include <tuttle/plugin/context/ReaderPlugin.hpp>
00005 #include <ImfInputFile.h>
00006 
00007 namespace tuttle {
00008 namespace plugin {
00009 namespace exr {
00010 namespace reader {
00011 
00012 struct EXRReaderProcessParams
00013 {
00014         std::string _filepath;       ///< filepath
00015         int         _fileComponents; ///< File Component type
00016         int         _outComponents;  ///< Components type
00017         int         _redChannelIndex;
00018         int         _greenChannelIndex;
00019         int         _blueChannelIndex;
00020         int         _alphaChannelIndex;
00021         bool        _displayWindow;
00022 };
00023 
00024 /**
00025  * @brief Exr reader
00026  */
00027 class EXRReaderPlugin : public ReaderPlugin
00028 {
00029 public:
00030         EXRReaderPlugin( OfxImageEffectHandle handle );
00031         EXRReaderProcessParams getProcessParams( const OfxTime time );
00032 
00033 public:
00034         void changedParam         ( const OFX::InstanceChangedArgs& args, const std::string& paramName );
00035         void getClipPreferences   ( OFX::ClipPreferencesSetter& clipPreferences );
00036         bool getRegionOfDefinition( const OFX::RegionOfDefinitionArguments& args, OfxRectD& rod );
00037 
00038         void render( const OFX::RenderArguments& args );
00039 
00040         const std::vector<std::string>&       channelNames() const  { return _vChannelNames; }
00041         const std::vector<OFX::ChoiceParam*>& channelChoice() const { return _vChannelChoice; }
00042 
00043 private:
00044         void updateCombos();
00045 
00046 protected:
00047         std::vector<OFX::ChoiceParam*> _vChannelChoice;  ///< Channel choice
00048         std::vector<std::string>       _vChannelNames;   ///< Channel names
00049         OFX::ChoiceParam*              _outComponents;   ///< Components list
00050         OFX::ChoiceParam*              _redComponents;   ///< index of Red components
00051         OFX::ChoiceParam*              _greenComponents; ///< index of Green components
00052         OFX::ChoiceParam*              _blueComponents;  ///< index of Blue components
00053         OFX::ChoiceParam*              _alphaComponents; ///< index of Alpha components
00054         OFX::ChoiceParam*              _outputData;      ///< Output data
00055         int                            _channels;        ///< number of channels in file
00056         float                          _par;             ///< pixel aspect ratio
00057 };
00058 
00059 }
00060 }
00061 }
00062 }
00063 
00064 #endif
00065