Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

ImageLoader.h

Go to the documentation of this file.
00001 
00037 #ifndef _AMIRE_COMMON_IMAGE_LOADER_H
00038 #define _AMIRE_COMMON_IMAGE_LOADER_H
00039 
00040 #include <amire/common/Defines.h>
00041 #include <amire/common/Image.h>
00042 
00043 namespace amire {
00044   namespace common {
00048     class AMIRE_EXPORT_API ImageLoader : public virtual osg::Referenced {
00049     private:
00050       static std::vector<osg::ref_ptr<const ImageLoader> > loaders;
00051 
00052     public:
00056       static bool isImage(const std::string &filename);
00057 
00061       static osg::ref_ptr<Image> load(const std::string &filename, bool manageUnbind = true);
00062 
00066       static void registerLoader(const osg::ref_ptr<const ImageLoader> &loader);
00067 
00068       virtual ~ImageLoader();
00069 
00073       virtual bool supportsFile(const std::string &filename) const = 0;
00074 
00078       virtual osg::ref_ptr<Image> loadFile(const std::string &filename, bool manageUnbind) const = 0;
00079     };
00080 
00084     class CantLoadImageException : public virtual AMIREException {
00085     public:
00086       CantLoadImageException(const std::string &file, int line, const std::string &message1, const std::string &message2);
00087     };
00088 
00089     #define CANT_LOAD_IMAGE_EXCEPTION(message1, message2) amire::common::CantLoadImageException(__FILE__, __LINE__, (message1), (message2))
00090   }
00091 }
00092 
00093 #endif

Generated on Tue May 20 17:23:53 2003 for AMIRE-Framework by doxygen1.3