36 const Size Size::Invalid(std::numeric_limits<
SDst>::lowest(),
37 std::numeric_limits<
SDst>::lowest());
40 const Rect Rect::Invalid(Size::Invalid);
45 return Width > 0 && Height > 0 && IsInInterval<int>(px -
X,
Width)
46 && IsInInterval<int>(py -
Y, Height);
55 Rect::ContainsStrict(
int px,
int py)
const ynothrow
57 return Width > 1 && Height > 1 && IsInOpenInterval<int>(px -
X,
58 Width - 1) && IsInOpenInterval<int>(py -
Y, Height - 1);
61 Rect::ContainsStrict(
const Rect& r)
const ynothrow
63 return ContainsStrict(r.GetPoint())
64 && ContainsStrict(r.GetPoint() + r.GetSize());
70 const SPos x1(max(
X, r.X)), x2(min(
X +
Width, r.X + r.Width)),
71 y1(max(
Y, r.Y)), y2(min(
Y + Height, r.Y + r.Height));
73 return *
this = x2 < x1 || y2 < y1 ?
Rect() : Rect(x1, y1, x2 - x1, y2 - y1);
84 const SPos mx(min(
X, r.X)), my(min(
Y, r.Y));
86 return *
this =
Rect(mx, my, max(
X +
Width, r.X + r.Width) - mx,
87 max(
Y + Height, r.Y + r.Height) - my);
103 const Graphics Graphics::Invalid;
108 YAssert(pBuffer,
"Null pointer found.");
109 YAssert(r < size.Height,
"Access out of range.");
111 return pBuffer + r * size.Width;
119 throw std::out_of_range(
"Access out of range.");
121 return pBuffer + r * size.Width;