34 #include <Pt/Gfx/Api.h>
61 return _w == 0 || _h == 0;
123 _w = other._w; _h = other._h;
134 bool operator==(
const BasicSize& other)
const
135 {
return (_w == other._w && _h == other._h); }
137 bool operator!=(
const BasicSize& other)
const
138 {
return (_w != other._w || _h != other._h); }
140 bool operator>(
const BasicSize& other)
const
142 if ( _w < other._w || _h < other._h)
145 return ( (*
this) != other );
148 bool operator<(
const BasicSize& other)
const
150 if ( _w > other._w || _h > other._h )
153 return ( other != (*
this) );
161 typedef BasicSize<Pt::ssize_t> Size;
162 typedef BasicSize<double> SizeF;
164 inline Size round(
const SizeF& r)
166 return Size(
lround(r.width()),
T width() const
Returns the width.
Definition: Size.h:65
void setHeight(T h)
Sets the height.
Definition: Size.h:77
BasicSize(T w=0, T h=0)
Construct with width and height.
Definition: Size.h:49
const BasicSize & subWidth(T w)
Decrement the width of the BasicSize by the given value.
Definition: Size.h:95
Size with width and height.
Definition: Size.h:45
void setWidthHeight(T w, T h)
Sets the widht and height.
Definition: Size.h:81
Pt::int32_t lround(float x)
Rounds to nearest integer value.
Definition: Math.h:289
T height() const
Returns the height.
Definition: Size.h:69
void setWidth(T w)
Sets the width.
Definition: Size.h:73
const BasicSize & addWidth(T w)
Increment the width of the BasicSize by the given value.
Definition: Size.h:88
const BasicSize & addHeight(T h)
Increment the height of the BasicSize by the given value.
Definition: Size.h:102
const BasicSize & subHeight(T h)
Decrement the height of the BasicSize by the given value.
Definition: Size.h:109