Boost.UI
User Interface Boost library
image.hpp
Go to the documentation of this file.
1 // Copyright (c) 2017 Kolya Kosenko
2 
3 // Distributed under the Boost Software License, Version 1.0.
4 // See http://www.boost.org/LICENSE_1_0.txt
5 
7 
8 #ifndef BOOST_UI_IMAGE_HPP
9 #define BOOST_UI_IMAGE_HPP
10 
11 #include <boost/ui/config.hpp>
12 
13 #ifdef BOOST_HAS_PRAGMA_ONCE
14 #pragma once
15 #endif
16 
17 #include <boost/ui/coord.hpp>
18 
19 #include <istream>
20 
21 namespace boost {
22 namespace ui {
23 
27 
28 class BOOST_UI_DECL image
29 {
30  class impl;
31 
32 public:
33  image();
34 #ifndef DOXYGEN
35  image(const image& other);
36  image& operator=(const image& other);
37 #endif
38  ~image();
39 
43  image& load(std::istream& s);
44 
48  static image xdg(const char* name, coord_type width, coord_type height);
49 
52  coord_type width() const;
53 
56  coord_type height() const;
57 
60  size dimensions() const
61  { return size(width(), height()); }
62 
64  bool valid() const BOOST_NOEXCEPT;
65 
67  typedef void* native_handle_type;
68 
70  native_handle_type native_handle() { return m_impl; }
71  const native_handle_type native_handle() const { return m_impl; }
73 
74 private:
75  impl* m_impl;
76 };
77 
78 } // namespace ui
79 } // namespace boost
80 
81 #endif // BOOST_UI_IMAGE_HPP
boost::ui::image::dimensions
size dimensions() const
Returns image size.
Definition: image.hpp:60
config.hpp
Configuration options.
boost
Boost C++ libraries namespace.
Definition: window.hpp:19
boost::ui::size
basic_size< coord_type > size
2D size coordinates
Definition: coord.hpp:416
boost::ui::coord_type
int coord_type
Widget coordinates signed number type.
Definition: coord.hpp:412
boost::ui::image::native_handle_type
void * native_handle_type
Implementation-defined image type.
Definition: image.hpp:67
boost::ui::image::native_handle
const native_handle_type native_handle() const
Returns the implementation-defined underlying image handle.
Definition: image.hpp:71
boost::ui::basic_size
2D size of object data structure with custom coordinates type
Definition: coord.hpp:48
boost::ui::image
Image class.
Definition: image.hpp:28
coord.hpp
Coordinates classes.