22template<
class T,
class ENABLE =
void>
48 : left_(static_cast<T>(0))
49 , top_(static_cast<T>(0))
50 , right_(static_cast<T>(0))
51 , bottom_(static_cast<T>(0))
62 RectLT(T left, T top, T right, T bottom)
noexcept
169 return right_ - left_;
179 right_ = left_ + width;
189 return bottom_ - top_;
199 bottom_ = top_ + height;
240 right_ = location.X() +
Width();
241 bottom_ = location.Y() +
Height();
242 left_ = location.X();
254 return Width() >
static_cast<T
>(0.0)
255 &&
Height() >
static_cast<T
>(0.0);
267 return (point.X() >=
Left()) && (point.Y() >=
Top()) && (point.X() <=
Right()) && (point.Y() <=
Bottom());
289 return (top_ == rect.top_
290 && left_ == rect.left_
291 && bottom_ == rect.bottom_
292 && right_ == rect.right_);
304 return !(*
this == rect);
312 static_cast<C
>(
Left()),
313 static_cast<C
>(
Top()),
314 static_cast<C
>(
Right()),
340 return RectLT<int>(
static_cast<int>(std::round(rhs.Left())),
341 static_cast<int>(std::round(rhs.Top())),
342 static_cast<int>(std::round(rhs.Right())),
343 static_cast<int>(std::round(rhs.Bottom())));
Multi-purpose 2D vector class.
Definition: point_2d.hpp:20
Rectangle object.
Definition: rect_lt.hpp:24
T Bottom() const noexcept
Gets bottom of the rectangle.
Definition: rect_lt.hpp:147
bool Contains(Point2D< T > point) const noexcept
Checks if this rectangle contains a point.
Definition: rect_lt.hpp:265
RectLT(Point2D< T > location, Size2D< T > size) noexcept
Constructor for a rectangle.
Definition: rect_lt.hpp:76
T Height() const noexcept
Gets the height of the rectangle.
Definition: rect_lt.hpp:187
void SetRight(T right) noexcept
Sets rightmost point of the rectangle.
Definition: rect_lt.hpp:137
RectLT(T left, T top, T right, T bottom) noexcept
Constructor for a rectangle.
Definition: rect_lt.hpp:62
RectLT() noexcept
Default rectangle.
Definition: rect_lt.hpp:47
bool IsValid() const noexcept
Checks if the rectangle is valid.
Definition: rect_lt.hpp:252
void SetWidth(T width) noexcept
Sets the width of the rectangle.
Definition: rect_lt.hpp:177
void SetBottom(T bottom) noexcept
Sets bottom of the rectangle.
Definition: rect_lt.hpp:157
bool operator==(const RectLT< T > &rect) const noexcept
Compares to another rectangle.
Definition: rect_lt.hpp:287
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:276
Size2D< T > Size() const noexcept
Gets the size of the rectangle.
Definition: rect_lt.hpp:207
void SetLeft(T left) noexcept
Sets leftmost point of the rectangle.
Definition: rect_lt.hpp:97
void SetLocation(Point2D< T > location) noexcept
Sets the location of the top left corner of the rectangle.
Definition: rect_lt.hpp:238
T Top() const noexcept
Gets top of the rectangle.
Definition: rect_lt.hpp:107
T Right() const noexcept
Gets rightmost point of the rectangle.
Definition: rect_lt.hpp:127
T Left() const noexcept
Gets the leftmost point of the rectangle.
Definition: rect_lt.hpp:87
void SetHeight(T height) noexcept
Sets the height of the rectangle.
Definition: rect_lt.hpp:197
void SetTop(T top) noexcept
Sets top of the rectangle.
Definition: rect_lt.hpp:117
void SetSize(Size2D< T > size) noexcept
Gets the size of the rectangle.
Definition: rect_lt.hpp:217
T Width() const noexcept
Gets the width of the rectangle.
Definition: rect_lt.hpp:167
bool operator!=(const RectLT< T > &rect) const noexcept
Compares to another rectangle.
Definition: rect_lt.hpp:302
Point2D< T > Location() const noexcept
Gets the location of the top left corner of the rectangle.
Definition: rect_lt.hpp:228
Stores a pair of numbers that represents the width and the height of a subject, typically a rectangle...
Definition: size_2d.hpp:20
T Height() const noexcept
Gets the vertical component of the size.
Definition: size_2d.hpp:80
T Width() const noexcept
Gets the horizontal component of the size.
Definition: size_2d.hpp:60
Root namespace for the Image Manager interface.
Definition: c_barcode.h:15
CoordinateSystemType
Enumeration of the different available coordinate systems that an Area of interest may be defined in.
Definition: global.hpp:270
Point2D< int > Round(const Point2D< T > &rhs) noexcept
Round to an integer point.
Definition: point_2d.hpp:382