/*] 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 #include #include namespace moof { class image; typedef boost::shared_ptr 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; private: static FILE* open_file(std::string& name); class impl; boost::shared_ptr impl_; }; } // namespace moof #endif // _MOOF_IMAGE_HH_