-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathrect.h
More file actions
37 lines (31 loc) · 707 Bytes
/
rect.h
File metadata and controls
37 lines (31 loc) · 707 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
//
// libembryo
//
// Copyright Stanley Cen 2013
// Released under the MIT License
//
#ifndef libembryo_rect_h
#define libembryo_rect_h
#include <libembryo/point.h>
#include <libembryo/size.h>
namespace embryo
{
template<typename _T>
class rect
{
public:
rect() : m_pos(), m_size() {}
rect(const point<_T> &pt, const size<_T> &sz) : m_pos(pt), m_size(sz) {}
point<_T> pos() const { return m_pos; }
size<_T> size() const { return m_size; }
protected:
point<_T> m_pos;
embryo::size<_T> m_size;
};
template<typename _T>
rect<_T> makerect(point<_T> pos, size<_T> sz)
{
return rect<_T>(pos, sz);
}
}
#endif