]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/bmploader.h
Implement a loader for BMP images
[libs/gui.git] / source / graphics / bmploader.h
diff --git a/source/graphics/bmploader.h b/source/graphics/bmploader.h
new file mode 100644 (file)
index 0000000..db9af1d
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef MSP_GRAPHICS_BMPLOADER_H_
+#define MSP_GRAPHICS_BMPLOADER_H_
+
+#include <msp/graphics/imageloader.h>
+
+namespace Msp {
+namespace Graphics {
+
+class BmpLoader: public RegisteredImageLoader<BmpLoader>
+{
+private:
+       IO::Base &io;
+       unsigned sig_bytes;
+
+public:
+       BmpLoader(IO::Base &, unsigned = 0);
+
+       static unsigned get_signature_size() { return 2; }
+       static bool detect(const std::string &);
+
+       virtual void load(Image::Data &);
+};
+
+} // namespace Graphics
+} // namespace Msp
+
+#endif