]> Dogcows Code - chaz/yoink/blob - src/Moof/Image.hh
more explicit constructors
[chaz/yoink] / src / Moof / Image.hh
1
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
4 *
5 * vi:ts=4 sw=4 tw=75
6 *
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
9 *
10 **************************************************************************/
11
12 #ifndef _MOOF_IMAGE_HH_
13 #define _MOOF_IMAGE_HH_
14
15 #include <boost/shared_ptr.hpp>
16
17 #include <Moof/OpenGL.hh>
18 #include <Moof/Resource.hh>
19
20
21 namespace Mf {
22
23
24 class Image;
25 typedef boost::shared_ptr<Image> ImageP;
26
27 class Image : public Resource
28 {
29 public:
30
31 static ImageP alloc(const std::string& name)
32 {
33 return ImageP(new Image(name));
34 }
35
36 explicit Image(const std::string& name);
37
38 bool isValid() const;
39
40 int getWidth() const;
41 int getHeight() const;
42
43 unsigned getDepth() const;
44 unsigned getPitch() const;
45 GLuint getMode() const;
46
47 std::string getComment() const;
48
49 const char* getPixels() const;
50 char* getPixels();
51
52 void flip();
53
54 void setAsIcon() const;
55
56 static bool getPath(std::string& name);
57
58 private:
59
60 static FILE* openFile(std::string& name);
61
62 class Impl;
63 boost::shared_ptr<Impl> mImpl;
64 };
65
66
67 } // namespace Mf
68
69 #endif // _MOOF_IMAGE_HH_
70
This page took 0.03324 seconds and 4 git commands to generate.