Go to the documentation of this file.
39 bool isNull()
const {
return wd==0 && ht==0; }
40 bool isEmpty()
const {
return wd<1 || ht<1; }
41 bool isValid()
const {
return wd>=0 && ht>=0; }
43 int width()
const {
return wd; }
46 void resize(T w, T h) { wd = w; ht = h; }
60 TSize<T>&
operator*=(
const float v) { wd=
static_cast<T
>(wd)*v; ht=
static_cast<T
>(ht)*v;
return *
this; }
82 T rw = (s.ht * wd) / ht;
85 useHeight = (rw <= s.wd);
87 useHeight = (rw >= s.wd);
100 float ratio()
const {
return static_cast<float>(wd)/ht; }
101 T
area()
const {
return wd*ht; }
bool operator>=(const TSize< T > &other) const
TSize< T > & operator*=(const TSize< T > &other)
TSize< T > operator/(const TSize< T > &other) const
TSize< T > expandedTo(const TSize< T > &other) const
TSize< T > operator*(const TSize< T > &other) const
void scale(const TSize< T > &s, Fw::AspectRatioMode mode)
TSize< T > & operator-=(const TSize< T > &other)
bool operator>(const TSize< T > &other) const
TSize(const TSize< T > &other)
bool operator==(const TSize< T > &other) const
TSize< T > operator/(const float v) const
bool operator!=(const TSize< T > &other) const
void scale(int w, int h, Fw::AspectRatioMode mode)
TSize< T > & operator=(const TSize< T > &other)
TSize< T > operator-() const
TSize< T > & operator/=(const TSize< T > &other)
TSize< T > operator+(const TSize< T > &other) const
TSize< T > boundedTo(const TSize< T > &other) const
TSize< T > & operator*=(const float v)
TSize< T > & operator/=(const float v)
TSize< T > & operator+=(const TSize< T > &other)
TSize< T > operator-(const TSize< T > &other) const
TPoint< T > toPoint() const
std::istream & operator>>(std::istream &in, TSize< T > &size)
bool operator<=(const TSize< T > &other) const
std::ostream & operator<<(std::ostream &out, const TSize< T > &size)
bool operator<(const TSize< T > &other) const
TSize< T > operator*(const float v) const