/*] 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_ #include #include #include namespace Mf { class Image; typedef boost::shared_ptr ImageP; class Image : public Resource { public: static ImageP alloc(const std::string& name) { return ImageP(new Image(name)); } explicit Image(const std::string& name); bool isValid() const; int getWidth() const; int getHeight() const; unsigned getDepth() const; unsigned getPitch() const; GLuint getMode() const; std::string getComment() const; const char* getPixels() const; char* getPixels(); void flip(); void setAsIcon() const; static bool getPath(std::string& name); private: static FILE* openFile(std::string& name); class Impl; boost::shared_ptr mImpl; }; } // namespace Mf #endif // _MOOF_IMAGE_HH_