24#include "rawspeedconfig.h"
44 return {
x + rhs.
x,
y + rhs.
y};
47 return {
x - rhs.
x,
y - rhs.
y};
60 return x == rhs.
x &&
y == rhs.
y;
64 return x > rhs.
x &&
y > rhs.
y;
67 return x < rhs.
x &&
y < rhs.
y;
71 return x >= rhs.
x &&
y >= rhs.
y;
74 return x <= rhs.
x &&
y <= rhs.
y;
82 using signed_area = std::make_signed_t<area_type>;
84 area_type x_abs = std::abs(
static_cast<signed_area
>(
x));
85 area_type y_abs = std::abs(
static_cast<signed_area
>(
y));
90 [[nodiscard]]
constexpr bool RAWSPEED_READONLY
115 :
pos({x_pos, y_pos}),
dim({w, h}) {}
117 [[nodiscard]]
constexpr int getTop()
const {
return pos.y; }
119 [[nodiscard]]
constexpr int getLeft()
const {
return pos.x; }
132 return (
dim.x > 0) && (
dim.y > 0);
135 [[nodiscard]]
constexpr bool RAWSPEED_READONLY
140 [[nodiscard]]
constexpr bool RAWSPEED_READONLY
145 [[nodiscard]]
constexpr bool RAWSPEED_READONLY
151 [[nodiscard]]
auto area()
const {
178 dim.x = std::max(0,
dim.x);
179 dim.y = std::max(0,
dim.y);
189 crop_pixels.
x = -(
pos.x);
193 crop_pixels.
y = -
pos.y;
205 std::max(
pos.y, other.
pos.
y), std::min(br1.
x, br2.
x),
206 std::min(br1.
y, br2.
y));
215 std::min(
pos.y, other.
pos.
y), std::max(br1.
x, br2.
x),
216 std::max(br2.
y, br2.
y));
226 return std::tie(a.
pos, a.
dim) == std::tie(b.
pos, b.
dim);
constexpr iPoint2D()=default
constexpr iPoint2D operator-(const iPoint2D &rhs) const
constexpr iPoint2D()=default
constexpr bool RAWSPEED_READONLY isThisInside(const iPoint2D &rhs) const
iPoint2D & operator+=(const iPoint2D &rhs)
constexpr bool RAWSPEED_READONLY operator<=(const iPoint2D &rhs) const
constexpr bool RAWSPEED_READONLY operator<(const iPoint2D &rhs) const
area_type RAWSPEED_READONLY area() const
constexpr bool RAWSPEED_READONLY operator>=(const iPoint2D &rhs) const
constexpr bool RAWSPEED_READONLY operator>(const iPoint2D &rhs) const
constexpr iPoint2D getSmallest(const iPoint2D &rhs) const
constexpr iPoint2D(value_type a, value_type b)
bool RAWSPEED_READONLY hasPositiveArea() const
iPoint2D & operator-=(const iPoint2D &rhs)
constexpr bool RAWSPEED_READONLY operator==(const iPoint2D &rhs) const
constexpr iPoint2D operator+(const iPoint2D &rhs) const
constexpr iRectangle2D(const iPoint2D &pos_, const iPoint2D &dim_)
constexpr bool RAWSPEED_READONLY isPointInsideInclusive(const iPoint2D &subPoint) const
void setTopLeft(const iPoint2D &top_left)
constexpr int getTop() const
constexpr iRectangle2D(int w, int h)
constexpr bool RAWSPEED_READONLY isPointInside(const iPoint2D &subPoint) const
constexpr bool RAWSPEED_READONLY isThisInside(const iRectangle2D &superRect) const
constexpr iPoint2D getTopRight() const
constexpr bool RAWSPEED_READONLY hasPositiveArea() const
iRectangle2D combine(const iRectangle2D &other) const
constexpr int getBottom() const
constexpr iRectangle2D(int x_pos, int y_pos, int w, int h)
void setBottomRightAbsolute(const iPoint2D &bottom_right)
constexpr iRectangle2D()=default
void setAbsolute(int x1, int y1, int x2, int y2)
constexpr int getHeight() const
constexpr int getRight() const
iRectangle2D getOverlap(const iRectangle2D &other) const
constexpr iPoint2D getBottomLeft() const
void offset(const iPoint2D &offset_)
constexpr iPoint2D getTopLeft() const
constexpr int getWidth() const
void setAbsolute(const iPoint2D &top_left, const iPoint2D &bottom_right)
constexpr int getLeft() const
void setSize(const iPoint2D &size)
constexpr iPoint2D getBottomRight() const
constexpr RAWSPEED_READNONE Ttgt implicit_cast(Tsrc value)
bool operator==(const AlignedAllocator< T1, A1 > &, const AlignedAllocator< T2, A2 > &)