20 template <
class T,
class ENABLE =
void>
25 static_assert(IsNumeric<T>::value,
"CVB: Unsupported data type - must be numeric!");
29 class RectLT<T, typename EnableIfNumeric<T>::type> final
43 : left_(static_cast<T>(0))
44 , top_(static_cast<T>(0))
45 , right_(static_cast<T>(0))
46 , bottom_(static_cast<T>(0)) {};
56 RectLT(T left, T top, T right, T bottom)
noexcept
56 RectLT(T left, T top, T right, T bottom)
noexcept {
…}
163 return right_ - left_;
173 right_ = left_ + width;
183 return bottom_ - top_;
193 bottom_ = top_ + height;
234 right_ = location.X() +
Width();
235 bottom_ = location.Y() +
Height();
236 left_ = location.X();
247 return Width() >
static_cast<T
>(0.0) &&
Height() >
static_cast<T
>(0.0);
258 return (point.X() >=
Left()) && (point.Y() >=
Top()) && (point.X() <=
Right()) && (point.Y() <=
Bottom());
280 return (top_ == rect.top_ && left_ == rect.left_ && bottom_ == rect.bottom_ && right_ == rect.right_);
291 return !(*
this == rect);
299 static_cast<C
>(
Bottom()));
320 static_assert(IsNumeric<T>::value,
"CVB: Unsupported data type - must be numeric!");
Multi-purpose 2D vector class.
Definition point_2d.hpp:20
Rectangle object.
Definition rect_lt.hpp:22
T Bottom() const noexcept
Gets bottom of the rectangle.
Definition rect_lt.hpp:141
bool Contains(Point2D< T > point) const noexcept
Checks if this rectangle contains a point.
Definition rect_lt.hpp:256
RectLT(Point2D< T > location, Size2D< T > size) noexcept
Constructor for a rectangle.
Definition rect_lt.hpp:70
T Height() const noexcept
Gets the height of the rectangle.
Definition rect_lt.hpp:181
void SetRight(T right) noexcept
Sets rightmost point of the rectangle.
Definition rect_lt.hpp:131
RectLT(T left, T top, T right, T bottom) noexcept
Constructor for a rectangle.
Definition rect_lt.hpp:56
RectLT() noexcept
Default rectangle.
Definition rect_lt.hpp:42
bool IsValid() const noexcept
Checks if the rectangle is valid.
Definition rect_lt.hpp:245
void SetWidth(T width) noexcept
Sets the width of the rectangle.
Definition rect_lt.hpp:171
void SetBottom(T bottom) noexcept
Sets bottom of the rectangle.
Definition rect_lt.hpp:151
bool operator==(const RectLT< T > &rect) const noexcept
Compares to another rectangle.
Definition rect_lt.hpp:278
CoordinateSystemType CoordinateSystem() const noexcept
Indicates the coordinate system in which this object is being measured (when used as an area of inter...
Definition rect_lt.hpp:267
Size2D< T > Size() const noexcept
Gets the size of the rectangle.
Definition rect_lt.hpp:201
void SetLeft(T left) noexcept
Sets leftmost point of the rectangle.
Definition rect_lt.hpp:91
void SetLocation(Point2D< T > location) noexcept
Sets the location of the top left corner of the rectangle.
Definition rect_lt.hpp:232
T Top() const noexcept
Gets top of the rectangle.
Definition rect_lt.hpp:101
T Right() const noexcept
Gets rightmost point of the rectangle.
Definition rect_lt.hpp:121
T Left() const noexcept
Gets the leftmost point of the rectangle.
Definition rect_lt.hpp:81
void SetHeight(T height) noexcept
Sets the height of the rectangle.
Definition rect_lt.hpp:191
void SetTop(T top) noexcept
Sets top of the rectangle.
Definition rect_lt.hpp:111
void SetSize(Size2D< T > size) noexcept
Gets the size of the rectangle.
Definition rect_lt.hpp:211
T Width() const noexcept
Gets the width of the rectangle.
Definition rect_lt.hpp:161
bool operator!=(const RectLT< T > &rect) const noexcept
Compares to another rectangle.
Definition rect_lt.hpp:289
Point2D< T > Location() const noexcept
Gets the location of the top left corner of the rectangle.
Definition rect_lt.hpp:222
Stores a pair of numbers that represents the width and the height of a subject, typically a rectangle...
Definition size_2d.hpp:20
Root namespace for the Image Manager interface.
Definition c_bayer_to_rgb.h:17
CoordinateSystemType
Enumeration of the different available coordinate systems that an Area of interest may be defined in.
Definition global.hpp:290
@ PixelCoordinates
Definition global.hpp:298
Point2D< int > Round(const Point2D< T > &rhs) noexcept
Round to an integer point.
Definition point_2d.hpp:371