]> Dogcows Code - chaz/yoink/blobdiff - src/moof/image.hh
the massive refactoring effort
[chaz/yoink] / src / moof / image.hh
diff --git a/src/moof/image.hh b/src/moof/image.hh
new file mode 100644 (file)
index 0000000..9757270
--- /dev/null
@@ -0,0 +1,76 @@
+
+/*]  Copyright (c) 2009-2010, Charles McGarvey  [**************************
+**]  All rights reserved.
+*
+* vi:ts=4 sw=4 tw=75
+*
+* Distributable under the terms and conditions of the 2-clause BSD license;
+* see the file COPYING for a complete text of the license.
+*
+**************************************************************************/
+
+#ifndef _MOOF_IMAGE_HH_
+#define _MOOF_IMAGE_HH_
+
+/**
+ * \file image.hh
+ * Defines classes for loading and manipulating images.
+ */
+
+#include <boost/shared_ptr.hpp>
+
+#include <moof/opengl.hh>
+#include <moof/resource.hh>
+
+
+namespace moof {
+
+
+class image;
+typedef boost::shared_ptr<image> image_ptr;
+
+class image : public resource
+{
+public:
+
+       static image_ptr alloc(const std::string& name)
+       {
+               return image_ptr(new image(name));
+       }
+
+       explicit image(const std::string& name);
+
+       bool is_valid() const;
+
+       int width() const;
+       int height() const;
+
+       unsigned depth() const;
+       unsigned pitch() const;
+       GLuint mode() const;
+
+       std::string comment() const;
+
+       const char* pixels() const;
+       char* pixels();
+
+       void flip();
+
+       void set_as_icon() const;
+
+       static bool find_path(std::string& name);
+
+
+private:
+
+       static FILE* open_file(std::string& name);
+
+       class impl;
+       boost::shared_ptr<impl> impl_;
+};
+
+
+} // namespace moof
+
+#endif // _MOOF_IMAGE_HH_
+
This page took 0.023432 seconds and 4 git commands to generate.