4 #define MIN(a,b) (a < b ? a : b)
5 #define MAX(a,b) (a > b ? a : b)
11 eSize(
int w,
int h );
64 {
return wd==0 && ht==0; }
67 {
return wd<1 || ht<1; }
70 {
return wd>=0 && ht>=0; }
91 { wd+=s.wd; ht+=s.ht;
return *
this; }
94 { wd-=s.wd; ht-=s.ht;
return *
this; }
97 { wd*=c; ht*=c;
return *
this; }
100 { wd=(int)(wd*c); ht=(int)(ht*c);
return *
this; }
103 {
return s1.wd == s2.wd && s1.ht == s2.ht; }
106 {
return s1.wd != s2.wd || s1.ht != s2.ht; }
109 {
return eSize(s1.wd+s2.wd, s1.ht+s2.ht); }
112 {
return eSize(s1.wd-s2.wd, s1.ht-s2.ht); }
115 {
return eSize(s.wd*c, s.ht*c); }
118 {
return eSize(s.wd*c, s.ht*c); }
121 {
return eSize((
int)(s.wd*c), (
int)(s.ht*c)); }
124 {
return eSize((
int)(s.wd*c), (
int)(s.ht*c)); }
134 wd=(int)(wd/c); ht=(int)(ht/c);
140 return eSize(s.wd/c, s.ht/c);
145 return eSize((
int)(s.wd/c), (
int)(s.ht/c));
150 return eSize(
MAX(wd,otherSize.wd),
MAX(ht,otherSize.ht) );
155 return eSize(
MIN(wd,otherSize.wd),
MIN(ht,otherSize.ht) );
void setWidth(int w)
Definition: esize.h:78
eSize & operator/=(int c)
Definition: esize.h:126
int width() const
Definition: esize.h:72
eSize & operator-=(const eSize &)
Definition: esize.h:93
void setHeight(int h)
Definition: esize.h:81
eSize boundedTo(const eSize &) const
Definition: esize.h:153
int & rheight()
Definition: esize.h:87
int & rwidth()
Definition: esize.h:84
eSize & operator*=(int c)
Definition: esize.h:96
eSize expandedTo(const eSize &) const
Definition: esize.h:148
friend eSize operator-(const eSize &, const eSize &)
Definition: esize.h:111
friend eSize operator*(const eSize &, int)
Definition: esize.h:114
friend eSize operator/(const eSize &, int)
Definition: esize.h:138
void transpose()
Definition: esize.h:158
bool isEmpty() const
Definition: esize.h:66
bool isNull() const
Definition: esize.h:63
friend bool operator!=(const eSize &, const eSize &)
Definition: esize.h:105
int height() const
Definition: esize.h:75
bool isValid() const
Definition: esize.h:69
eSize & operator+=(const eSize &)
Definition: esize.h:90
friend eSize operator+(const eSize &, const eSize &)
Definition: esize.h:108
eSize()
Definition: esize.h:57
friend bool operator==(const eSize &, const eSize &)
Definition: esize.h:102
eSize operator-(const eSize &s1, const eSize &s2)
Definition: esize.h:111
bool operator!=(const eSize &s1, const eSize &s2)
Definition: esize.h:105
#define MIN(a, b)
Definition: esize.h:4
bool operator==(const eSize &s1, const eSize &s2)
Definition: esize.h:102
eSize operator*(const eSize &s, int c)
Definition: esize.h:114
eSize operator/(const eSize &s, int c)
Definition: esize.h:138
eSize operator+(const eSize &s1, const eSize &s2)
Definition: esize.h:108
#define MAX(a, b)
Definition: esize.h:5