TuttleOFX  1
Jpeg2000ReaderPlugin.hpp
Go to the documentation of this file.
00001 #ifndef _TUTTLE_PLUGIN_JPEG2000_READER_PLUGIN_HPP_
00002 #define _TUTTLE_PLUGIN_JPEG2000_READER_PLUGIN_HPP_
00003 
00004 #include <tuttle/plugin/context/ReaderPlugin.hpp>
00005 #include "openjpeg/J2KReader.hpp"
00006 
00007 namespace tuttle {
00008 namespace plugin {
00009 namespace jpeg2000 {
00010 namespace reader {
00011 
00012 struct Jpeg2000ReaderProcessParams
00013 {
00014         std::string _paramFilepath; ///< filepath
00015 };
00016 
00017 /**
00018  * @brief Jpeg2000 plugin
00019  */
00020 class Jpeg2000ReaderPlugin : public ReaderPlugin
00021 {
00022 public:
00023     Jpeg2000ReaderPlugin( OfxImageEffectHandle handle );
00024         ~Jpeg2000ReaderPlugin();
00025 
00026 public:
00027         Jpeg2000ReaderProcessParams getProcessParams(const OfxTime time);
00028         void render( const OFX::RenderArguments &args );
00029         void changedParam( const OFX::InstanceChangedArgs& args, const std::string& paramName );
00030         bool getRegionOfDefinition( const OFX::RegionOfDefinitionArguments& args, OfxRectD& rod );
00031         void getClipPreferences( OFX::ClipPreferencesSetter& clipPreferences );
00032 
00033         struct FileInfo
00034         {
00035             FileInfo()
00036                 : _time(0)
00037                 , _failed(true)
00038                 , _width(0)
00039                 , _height(0)
00040                 , _components(0)
00041                 , _precision(0)
00042                 , _precisionType(OFX::eBitDepthNone)
00043             {}
00044                 OfxTime _time;
00045                 bool _failed;
00046                 std::size_t _width;
00047                 std::size_t _height;
00048                 std::size_t _components;
00049                 std::size_t _precision;
00050                 OFX::EBitDepth _precisionType;
00051         };
00052 
00053         FileInfo retrieveFileInfo( const OfxTime time );
00054 public:
00055         tuttle::io::J2KReader          _reader;
00056 private:
00057         mutable FileInfo _fileInfos;
00058 };
00059 
00060 
00061 }
00062 }
00063 }
00064 }
00065 
00066 #endif