]> Dogcows Code - chaz/yoink/blob - src/moof/image.hh
97572708379ba76210422f5adc708c8c8175b65e
[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 /**
16 * \file image.hh
17 * Defines classes for loading and manipulating images.
18 */
19
20 #include <boost/shared_ptr.hpp>
21
22 #include <moof/opengl.hh>
23 #include <moof/resource.hh>
24
25
26 namespace moof {
27
28
29 class image;
30 typedef boost::shared_ptr<image> image_ptr;
31
32 class image : public resource
33 {
34 public:
35
36 static image_ptr alloc(const std::string& name)
37 {
38 return image_ptr(new image(name));
39 }
40
41 explicit image(const std::string& name);
42
43 bool is_valid() const;
44
45 int width() const;
46 int height() const;
47
48 unsigned depth() const;
49 unsigned pitch() const;
50 GLuint mode() const;
51
52 std::string comment() const;
53
54 const char* pixels() const;
55 char* pixels();
56
57 void flip();
58
59 void set_as_icon() const;
60
61 static bool find_path(std::string& name);
62
63
64 private:
65
66 static FILE* open_file(std::string& name);
67
68 class impl;
69 boost::shared_ptr<impl> impl_;
70 };
71
72
73 } // namespace moof
74
75 #endif // _MOOF_IMAGE_HH_
76
This page took 0.031127 seconds and 3 git commands to generate.