digit_t is now unsigned, asm division for 1 digit
[ipdf/code.git] / src / rect.h
1 #ifndef _RECT_H
2 #define _RECT_H
3
4 #include "common.h"
5 #include "real.h"
6
7 namespace IPDF
8 {
9         struct Rect
10         {
11                 Real x; Real y; Real w; Real h;
12                 Rect() = default; // Needed so we can fread/fwrite this struct
13                 Rect(Real _x, Real _y, Real _w, Real _h) : x(_x), y(_y), w(_w), h(_h) {}
14                 std::string Str() const
15                 {
16                         std::stringstream s;
17                         // float conversion needed because it is fucking impossible to get ostreams working with template classes
18                         s << "{" << Float(x) << ", " << Float(y) << ", " << Float(w) << ", " << Float(h) << "}";
19                         return s.str();
20                 }
21         };
22 }
23
24 #endif //_RECT_H

UCC git Repository :: git.ucc.asn.au