class ImageLoader
{
+public:
+ enum State
+ {
+ INITIAL,
+ HEADERS_LOADED,
+ FINISHED
+ };
+
protected:
class RegisterBase
{
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<typename T>
static void register_loader();