X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgraphics%2Fimageloader.h;h=fbfd4d66e0c3c647c5c2171d03da04d4ccc1848d;hb=7302a061c57602203895b616bf54d96269c677c6;hp=f0b8d52c36412ec6cf3e9901d5b2a43c51aefdd6;hpb=d3bc6c9c2cfaaedaabfd4b5b7bf4e1da2de51331;p=libs%2Fgui.git diff --git a/source/graphics/imageloader.h b/source/graphics/imageloader.h index f0b8d52..fbfd4d6 100644 --- a/source/graphics/imageloader.h +++ b/source/graphics/imageloader.h @@ -23,6 +23,14 @@ public: class ImageLoader { +public: + enum State + { + INITIAL, + HEADERS_LOADED, + FINISHED + }; + protected: class RegisterBase { @@ -56,18 +64,25 @@ protected: private: IO::Base *source; + State state; protected: ImageLoader(); public: virtual ~ImageLoader(); + static bool detect_signature(const std::string &); static ImageLoader *open_file(const std::string &); static ImageLoader *open_io(IO::Seekable &); virtual void load(Image::Data &); - virtual void load_headers(Image::Data &) { } - virtual void load_data(Image::Data &) { } + virtual void load_headers(Image::Data &); +protected: + virtual void load_headers_(Image::Data &) = 0; + virtual void load_pixels_(Image::Data &) = 0; + +public: + State get_state() const { return state; } template static void register_loader();