22template<
class T,
class ENABLE =
void>
46 : left_(static_cast<T>(0))
47 , top_(static_cast<T>(0))
48 , right_(static_cast<T>(0))
49 , bottom_(static_cast<T>(0))
60 RectLT(T left, T top, T right, T bottom)
noexcept
167 return right_ - left_;
177 right_ = left_ + width;
187 return bottom_ - top_;
197 bottom_ = top_ + height;
238 right_ = location.X() +
Width();
239 bottom_ = location.Y() +
Height();
240 left_ = location.X();
252 return Width() >
static_cast<T
>(0.0)
253 &&
Height() >
static_cast<T
>(0.0);
265 return (point.X() >=
Left()) && (point.Y() >=
Top()) && (point.X() <=
Right()) && (point.Y() <=
Bottom());
287 return (top_ == rect.top_
288 && left_ == rect.left_
289 && bottom_ == rect.bottom_
290 && right_ == rect.right_);
302 return !(*
this == rect);
310 static_cast<C
>(
Left()),
311 static_cast<C
>(
Top()),
312 static_cast<C
>(
Right()),
338 return RectLT<int>(
static_cast<int>(std::round(rhs.Left())),
339 static_cast<int>(std::round(rhs.Top())),
340 static_cast<int>(std::round(rhs.Right())),
341 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:145
bool Contains(Point2D< T > point) const noexcept
Checks if this rectangle contains a point.
Definition: rect_lt.hpp:263
RectLT(Point2D< T > location, Size2D< T > size) noexcept
Constructor for a rectangle.
Definition: rect_lt.hpp:74
T Height() const noexcept
Gets the height of the rectangle.
Definition: rect_lt.hpp:185
void SetRight(T right) noexcept
Sets rightmost point of the rectangle.
Definition: rect_lt.hpp:135
RectLT(T left, T top, T right, T bottom) noexcept
Constructor for a rectangle.
Definition: rect_lt.hpp:60
RectLT() noexcept
Default rectangle.
Definition: rect_lt.hpp:45
bool IsValid() const noexcept
Checks if the rectangle is valid.
Definition: rect_lt.hpp:250
void SetWidth(T width) noexcept
Sets the width of the rectangle.
Definition: rect_lt.hpp:175
void SetBottom(T bottom) noexcept
Sets bottom of the rectangle.
Definition: rect_lt.hpp:155
bool operator==(const RectLT< T > &rect) const noexcept
Compares to another rectangle.
Definition: rect_lt.hpp:285
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:274
Size2D< T > Size() const noexcept
Gets the size of the rectangle.
Definition: rect_lt.hpp:205
void SetLeft(T left) noexcept
Sets leftmost point of the rectangle.
Definition: rect_lt.hpp:95
void SetLocation(Point2D< T > location) noexcept
Sets the location of the top left corner of the rectangle.
Definition: rect_lt.hpp:236
T Top() const noexcept
Gets top of the rectangle.
Definition: rect_lt.hpp:105
T Right() const noexcept
Gets rightmost point of the rectangle.
Definition: rect_lt.hpp:125
T Left() const noexcept
Gets the leftmost point of the rectangle.
Definition: rect_lt.hpp:85
void SetHeight(T height) noexcept
Sets the height of the rectangle.
Definition: rect_lt.hpp:195
void SetTop(T top) noexcept
Sets top of the rectangle.
Definition: rect_lt.hpp:115
void SetSize(Size2D< T > size) noexcept
Gets the size of the rectangle.
Definition: rect_lt.hpp:215
T Width() const noexcept
Gets the width of the rectangle.
Definition: rect_lt.hpp:165
bool operator!=(const RectLT< T > &rect) const noexcept
Compares to another rectangle.
Definition: rect_lt.hpp:300
Point2D< T > Location() const noexcept
Gets the location of the top left corner of the rectangle.
Definition: rect_lt.hpp:226
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:79
T Width() const noexcept
Gets the horizontal component of the size.
Definition: size_2d.hpp:59
Root namespace for the Image Manager interface.
Definition: c_barcode.h:24
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:380