aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/dimension.hpp
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/utils/dimension.hpp48
1 files changed, 40 insertions, 8 deletions
diff --git a/src/utils/dimension.hpp b/src/utils/dimension.hpp
index 4518fbb8..788adbf9 100644
--- a/src/utils/dimension.hpp
+++ b/src/utils/dimension.hpp
@@ -29,20 +29,52 @@
namespace usdx
{
+ template <class T>
class Dimension
{
private:
- unsigned int width;
- unsigned int height;
+ T width;
+ T height;
+
public:
- Dimension(unsigned int width, unsigned int height);
- Dimension(const Dimension& dimension);
+ Dimension(T width, T height) :
+ width(width), height(height)
+ {
+ }
+
+ Dimension(const Dimension& dimension) :
+ width(dimension.width), height(dimension.height)
+ {
+ }
+
+ Dimension<T>& operator=(const Dimension<T>& dimension)
+ {
+ width = dimension.width;
+ height = dimension.height;
+ return *this;
+ }
+
+
+
+ T get_width(void) const
+ {
+ return width;
+ }
+
+ void set_width(const T& value)
+ {
+ width = value;
+ }
- unsigned int get_width(void) const;
- void set_width(unsigned int width);
+ T get_height(void) const
+ {
+ return height;
+ }
- unsigned int get_height(void) const;
- void set_height(unsigned int height);
+ void set_height(const T& value)
+ {
+ height = value;
+ }
};
};