00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <algorithm>
00020
00021 INLINE ChanViewport::ChanViewport(void) {}
00022
00023 INLINE ChanViewport::ChanViewport(float l, float r, float b, float t) :
00024 _left(l), _right(r), _bottom(b), _top(t) {
00025 if (_left > _right)
00026 swap(_left, _right);
00027 if (_bottom > _top)
00028 swap(_bottom, _top);
00029 }
00030
00031 INLINE ChanViewport::ChanViewport(const ChanViewport& c) : _left(c._left),
00032 _right(c._right),
00033 _bottom(c._bottom),
00034 _top(c._top) {}
00035
00036 INLINE ChanViewport::~ChanViewport(void) {}
00037
00038 INLINE ChanViewport& ChanViewport::operator=(const ChanViewport& c) {
00039 _left = c._left;
00040 _right = c._right;
00041 _bottom = c._bottom;
00042 _top = c._top;
00043 return *this;
00044 }
00045
00046 INLINE float ChanViewport::left(void) const { return _left; }
00047
00048 INLINE float ChanViewport::right(void) const { return _right; }
00049
00050 INLINE float ChanViewport::bottom(void) const { return _bottom; }
00051
00052 INLINE float ChanViewport::top(void) const { return _top; }