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; }
82 T rw = (s.ht * wd) / ht;
85 useHeight = (rw <= s.wd);
87 useHeight = (rw >= s.wd);
100 float ratio()
const {
return (
float)wd/ht; }
101 T
area()
const {
return wd*ht; }