]> git.tdb.fi Git - libs/gui.git/blobdiff - source/graphics/quartz/quartzloader.h
Support for using Quartz to load images on OS X
[libs/gui.git] / source / graphics / quartz / quartzloader.h
diff --git a/source/graphics/quartz/quartzloader.h b/source/graphics/quartz/quartzloader.h
new file mode 100644 (file)
index 0000000..d3bef7b
--- /dev/null
@@ -0,0 +1,33 @@
+#ifndef MSP_GRAPHICS_QUARTZLOADER_H_
+#define MSP_GRAPHICS_QUARTZLOADER_H_
+
+#include <msp/graphics/imageloader.h>
+
+namespace Msp {
+namespace Graphics {
+
+class QuartzLoader: public ImageLoader
+{
+private:
+       struct Private;
+
+       Private *priv;
+
+       static Register<QuartzLoader> reg;
+
+public:
+       QuartzLoader(IO::Seekable &);
+       virtual ~QuartzLoader();
+
+       /* Experimentally found value, works for png and jpeg at least.  8 bytes
+       is not enough for Quartz to recognize png. */
+       static unsigned get_signature_size() { return 12; }
+       static bool detect(const std::string &);
+
+       virtual void load(Image::Data &);
+};
+
+} // namespace Graphics
+} // namespace Msp
+
+#endif