X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fimageloader.h;fp=source%2Fgraphics%2Fimageloader.h;h=06532753b3e535d152c84c6ad75abae80230167b;hb=cfd3548464e6424fc9decf0539d6cd04b031ba10;hp=0000000000000000000000000000000000000000;hpb=12df88ecf9787f4ed59051646775165b74301cf0;p=libs%2Fgui.git diff --git a/source/graphics/imageloader.h b/source/graphics/imageloader.h new file mode 100644 index 0000000..0653275 --- /dev/null +++ b/source/graphics/imageloader.h @@ -0,0 +1,43 @@ +#ifndef MSP_GRAPHICS_IMAGELOADER_H_ +#define MSP_GRAPHICS_IMAGELOADER_H_ + +#include "image.h" + +namespace Msp { +namespace Graphics { + +class unsupported_image_format: public std::runtime_error +{ +public: + unsupported_image_format(const std::string &w): std::runtime_error(w) { } + virtual ~unsupported_image_format() throw() { } +}; + +class bad_image_data: public std::runtime_error +{ +public: + bad_image_data(const std::string &w): std::runtime_error(w) { } + virtual ~bad_image_data() throw() { } +}; + + +class ImageLoader +{ +private: + IO::Base *source; +protected: + + ImageLoader(); +public: + virtual ~ImageLoader(); + + static ImageLoader *open_file(const std::string &); + static ImageLoader *open_io(IO::Base &); + + virtual void load(Image::Data &) = 0; +}; + +} // namespace Graphics +} // namespace Msp + +#endif