71 return (
x == rhs.
x) && (
y == rhs.
y);
225 DsPoint r(lhs.
x * multiplier, lhs.
y * multiplier);
240 DsPoint r(lhs.
x / divisor, lhs.
y / divisor);
255 DsPoint r(round(lhs.
x / divisor), round(lhs.
y / divisor));
316 else if (rv.
x > max.
x)
321 else if (rv.
y > max.
y)
337 const int32_t dx = p.
x -
x;
338 const int32_t dy = p.
y -
y;
340 return sqrt(dx * dx + dy * dy);
380 const int32_t dx = p1.
x - p2.
x;
381 const int32_t dy = p1.
y - p2.
y;
383 return sqrt(dx * dx + dy * dy);
460 return (
x == rhs.
x) && (
y == rhs.
y);
614 DsFPoint r(lhs.
x * multiplier, lhs.
y * multiplier);
690 else if (rv.
x > max.
x)
695 else if (rv.
y > max.
y)
711 const int32_t dx = p.
x -
x;
712 const int32_t dy = p.
y -
y;
714 return sqrt(dx * dx + dy * dy);
753 const float dx = p1.
x - p2.
x;
754 const float dy = p1.
y - p2.
y;
756 return sqrt(dx * dx + dy * dy);
818 return (
w == rhs.
w) && (
h == rhs.
h);
829 return (
w != rhs.
w) || (
h != rhs.
h);
978 DsSize r(round(lhs.
w * multiplier), round(lhs.
h * multiplier));
993 DsSize r(round(lhs.
w / divisor), round(lhs.
h / divisor));
1068 else if (rv.
w > max.
w)
1073 else if (rv.
h > max.
h)
1168 return (
w == rhs.
w) && (
h == rhs.
h);
1179 return (
w != rhs.
w) || (
h != rhs.
h);
1328 return DsFSize(lhs.
w * multiplier, lhs.
h * multiplier);
1370 return DsFSize(lhs.
w / divisor, lhs.
h / divisor);
1442 else if (rv.
w > max.
w)
1447 else if (rv.
h > max.
h)
1497 virtual DsFRect getRect(
void)
const = 0;
1499 virtual void rotate(
const DsSurface& surface) = 0;
1605 center.
x =
x +
w / 2.0;
1606 center.
y =
y +
h / 2.0;
1632 return (p.
x >=
x) && (p.
x < (
x +
w)) &&
1633 (p.
y >=
y) && (p.
y < (
y +
h));
1646 const int32_t xx = max(
x, r.
x);
1647 const int32_t yy = max(
y, r.
y);
1649 int32_t ww = min(
x +
w, r.
x + r.
w);
1650 int32_t hh = min(
y +
h, r.
y + r.
h);
1652 ww = max(ww - xx, 0);
1653 hh = max(hh - yy, 0);
1655 return DsRect(xx, yy, ww, hh);
1698 w = max(
x +
w, r.
x + r.
w);
1699 h = max(
y +
h, r.
y + r.
h);
1724 result.
w = max(lhs.
x + lhs.
w, rhs.
x + rhs.
w);
1725 result.
h = max(lhs.
y + lhs.
h, rhs.
y + rhs.
h);
1727 result.
x = min(lhs.
x, rhs.
x);
1728 result.
y = min(lhs.
y, rhs.
y);
1730 result.
w -= result.
x;
1731 result.
h -= result.
y;
1961 rect.
w = min(split_line, rect.
w);
1976 rect.
x += min(split_line, rect.
w);
1977 rect.
w -= min(split_line, rect.
w);
1992 rect.
h = min(split_line, rect.
h);
2007 rect.
y += min(split_line, rect.
h);
2008 rect.
h -= min(split_line, rect.
h);
2025 y = boundary.
y + boundary.
h -
h - offset.y;
2027 y = boundary.
y + ((boundary.
h -
h) >> 1) + offset.y;
2029 y = boundary.
y + offset.y;
2032 x = boundary.
x + boundary.
w -
w - offset.x;
2034 x = boundary.
x + ((boundary.
w -
w) >> 1) + offset.x;
2036 x = boundary.
x + offset.x;
2043 DsFRect getRect(
void)
const override final;
2044 void rotate(
const DsSurface& surface)
override final;
2155 center.
x =
x +
w / 2.0;
2156 center.
y =
y +
h / 2.0;
2182 return (p.
x >=
x) && (p.
x < (
x +
w)) &&
2183 (p.
y >=
y) && (p.
y < (
y +
h));
2196 const float xx = max(
x, r.
x);
2197 const float yy = max(
y, r.
y);
2199 float ww = min(
x +
w, r.
x + r.
w);
2200 float hh = min(
y +
h, r.
y + r.
h);
2202 ww = max(ww - xx, 0);
2203 hh = max(hh - yy, 0);
2205 return DsFRect(xx, yy, ww, hh);
2240 w = max(
x +
w, r.
x + r.
w);
2241 h = max(
y +
h, r.
y + r.
h);
2266 result.
w = max(lhs.
x + lhs.
w, rhs.
x + rhs.
w);
2267 result.
h = max(lhs.
y + lhs.
h, rhs.
y + rhs.
h);
2269 result.
x = min(lhs.
x, rhs.
x);
2270 result.
y = min(lhs.
y, rhs.
y);
2272 result.
w -= result.
x;
2273 result.
h -= result.
y;
2529 rect.
w = min(split_line, rect.
w);
2544 rect.
x += min(split_line, rect.
w);
2545 rect.
w -= min(split_line, rect.
w);
2560 rect.
h = min(split_line, rect.
h);
2575 rect.
y += min(split_line, rect.
h);
2576 rect.
h -= min(split_line, rect.
h);
2593 y = boundary.
y + boundary.
h -
h - offset.y;
2595 y = boundary.
y + ((boundary.
h -
h) / 2.0) + offset.y;
2597 y = boundary.
y + offset.y;
2600 x = boundary.
x + boundary.
w -
w - offset.x;
2602 x = boundary.
x + ((boundary.
w -
w) / 2.0) + offset.x;
2604 x = boundary.
x + offset.x;
2615 return DsRect(round(
x), round(
y), round(
w), round(
h));
2621 DsFRect getRect(
void)
const override final;
2622 void rotate(
const DsSurface& surface)
override final;
2654 mRhRh(rx * rx), mRvRv(ry * ry),
2655 mRhRhDivRyRy(mRhRh / mRvRv), mRvRvDivRxRx(mRvRv / mRhRh)
2668 mRhRhDivRyRy(mRhRh / mRvRv), mRvRvDivRxRx(mRvRv / mRhRh)
2681 mRhRhDivRyRy(mRhRh / mRvRv), mRvRvDivRxRx(mRvRv / mRhRh)
2694 mRhRhDivRyRy(mRhRh / mRvRv), mRvRvDivRxRx(mRvRv / mRhRh)
2707 mRhRhDivRyRy(mRhRh / mRvRv), mRvRvDivRxRx(mRvRv / mRhRh)
2727 DsFRect getRect(
void)
const override final;
2728 void rotate(
const DsSurface& surface)
override final;
2731 void setRect(
const DsFRect &rect);
2733 float getRadiusAtAngle(
float angle);
2734 DsFPoint getPointAtAngle(
float angle);
2736 static void computeArcBoundary(
float start_angle,
float end_angle,
bool include_center,
float &left,
float &right,
float &top,
float &bottom);
2737 DsFRect computeArcBoundary(
float start_angle,
float end_angle,
bool include_center);
DsAlignment is a class representing both horizontal and vertical alignment type.
Definition ds_types.h:130
bool isRight(void) const
Is the horizontal alignment right?
Definition ds_types.h:205
bool isBottom(void) const
Is the vertical alignment bottom?
Definition ds_types.h:232
bool isCenterH(void) const
Is the horizontal alignment center?
Definition ds_types.h:196
bool isCenterV(void) const
Is the vertical alignment center?
Definition ds_types.h:223
DsEllipse is a class that represents a 2D ellipse (Xc, Yc, Rx, Ry)
Definition ds_geometry.h:2636
DsEllipse(DsFPoint center, float radius)
Creates a DsEllipse object initialized to a circle (horizontal and vertical radius are equal)
Definition ds_geometry.h:2705
DsEllipse(DsFPoint center, DsFSize radius)
Creates a DsEllipse object.
Definition ds_geometry.h:2666
DsEllipse(DsFSize radius)
Creates a DsEllipse object initialized to a circle (horizontal and vertical radius are equal)
Definition ds_geometry.h:2679
DsFRect move(const DsFPoint &offset) override final
Moves the current DsEllipse object by a specified 2D offset.
Definition ds_geometry.h:2718
DsFSize radius
ellipse radius
Definition ds_geometry.h:2740
DsEllipse(float radius)
Creates a DsEllipse object initialized to a circle (horizontal and vertical radius are equal)
Definition ds_geometry.h:2692
DsEllipse(float xc, float yc, float rx, float ry)
Creates a DsEllipse object.
Definition ds_geometry.h:2653
DsEllipse()
Creates a DsEllipse object initialized to (center = (0, 0), radius = (0, 0)).
Definition ds_geometry.h:2641
DsFPoint center
ellipse center coordinates
Definition ds_geometry.h:2739
DsFPoint is a class that represents the X and Y 2D coordinates of a point as floating point numbers.
Definition ds_geometry.h:397
friend DsFPoint operator+(const DsFPoint &lhs, const DsFPoint &rhs)
Addition operator - adds two DsFPoint objects.
Definition ds_geometry.h:488
bool operator==(const DsFPoint &rhs)
Comparison operator.
Definition ds_geometry.h:458
DsFPoint(float x, float y)
Creates a DsFPoint object initialized to (x, y).
Definition ds_geometry.h:413
friend DsFPoint operator+(const DsFPoint &lhs, float rhs)
Addition operator - adds a number to both the X and Y coordinates of a DsFPoint object.
Definition ds_geometry.h:503
DsFPoint(const DsPoint &rhs)
Assignment operator from a DsFPoint object.
Definition ds_geometry.h:423
float distance(const DsFPoint &p) const
Calculates the Euclidian distance between the current DsFPoint object and a second DsFPoint object.
Definition ds_geometry.h:709
friend DsFPoint operator-(const DsFPoint &lhs, float rhs)
Subtraction operator - subtracts a number from a DsFPoint object.
Definition ds_geometry.h:565
DsFPoint saturateMin(const DsFPoint &min)
Saturates the current DsFPoint object coordinates to the minimum specified.
Definition ds_geometry.h:641
DsFPoint & operator+=(float rhs)
Addition operator - adds a number to both the X and Y coordinates of the current DsFPoint object.
Definition ds_geometry.h:533
friend float distance(const DsFPoint &p1, const DsFPoint &p2)
Calculates the Euclidian distance between two DsFPoint objects.
Definition ds_geometry.h:751
DsFPoint & operator-=(const DsFPoint &rhs)
Subtraction operator - subtracts a DsFPoint object from the current DsFPoint object.
Definition ds_geometry.h:579
friend DsFPoint operator-(const DsFPoint &lhs, const DsFPoint &rhs)
Subtraction operator - subtracts two DsFPoint objects.
Definition ds_geometry.h:550
DsFPoint saturateMax(const DsFPoint &max)
Saturates the current DsFPoint object coordinates to the maximum specified.
Definition ds_geometry.h:662
DsFPoint & operator+=(const DsFPoint &rhs)
Addition operator - adds a DsFPoint object to the current DsFPoint object.
Definition ds_geometry.h:517
DsFPoint operator-() const
Unary minus operator. Reverses the signs of both the X and Y coordinates of the current DsFPoint obje...
Definition ds_geometry.h:469
friend DsFPoint operator/(const DsFPoint &lhs, float divisor)
Floating point division operator - divides both X and Y coordinates of a DsFPoint object by the same ...
Definition ds_geometry.h:627
float distanceY(const DsFPoint &p) const
Calculates the Y component of the Euclidian distance between the current DsFPoint object and a second...
Definition ds_geometry.h:738
DsFPoint & operator-=(float rhs)
Subtraction operator - subtracts a number from the current DsFPoint object.
Definition ds_geometry.h:595
DsFPoint()
Creates a DsFPoint object initialized to (0, 0).
Definition ds_geometry.h:402
void swap(void)
Swaps the X and Y coordinates of the current DsFPoint object.
Definition ds_geometry.h:445
friend DsFPoint operator*(const DsFPoint &lhs, float multiplier)
Multiplication operator - multiplies both X and Y coordinates of a DsFPoint object with the same mult...
Definition ds_geometry.h:612
DsFPoint & operator=(const DsPoint &rhs)
Assignment operator from a DsPoint object.
Definition ds_geometry.h:433
float distanceX(const DsFPoint &p) const
Calculates the X component of the Euclidian distance between the current DsFPoint object and a second...
Definition ds_geometry.h:725
float y
Y component.
Definition ds_geometry.h:771
DsFPoint saturate(const DsFPoint &min, const DsFPoint &max)
Saturates the current DsFPoint object coordinates to the minimum and maximum specified.
Definition ds_geometry.h:684
float x
X component.
Definition ds_geometry.h:770
DsFRect is a class that represents a 2D rectangle (X, Y, W, H) using floating point coordiantes and s...
Definition ds_geometry.h:2059
DsFRect()
Creates a DsRect object initialized to (0, 0, 0, 0).
Definition ds_geometry.h:2065
DsFRect erodeTop(float size) const
Erodes the current DsRect object by a specific size on the top side only.
Definition ds_geometry.h:2387
DsFRect(const DsFPoint &pos, const DsFSize &size)
Creates a DsPoint object initialized to (x, y, w, h).
Definition ds_geometry.h:2097
DsFRect dilateLeft(float size)
Dilates the current DsRect object by a specific size on the left side only.
Definition ds_geometry.h:2487
DsFRect erodeBottom(float size) const
Erodes the current DsRect object by a specific size on the bottom side only.
Definition ds_geometry.h:2408
DsFRect getRightRegion(float split_line)
Splits the rectangle in two using a vertical line and returns the right rectangle.
Definition ds_geometry.h:2541
friend DsFRect operator+(const DsFRect &lhs, const DsFRect &rhs)
Addition operator - concatenates two DsRect objects.
Definition ds_geometry.h:2262
DsFRect & cat(const DsFRect &r)
Concatenates the current DsRect object with another rectangle.
Definition ds_geometry.h:2232
float x
X coordinate of the top left corner.
Definition ds_geometry.h:2624
DsFPoint getCenter(void) const
Gets the position of the center of the rectangle.
Definition ds_geometry.h:2151
DsFRect & align(const DsFRect &boundary, const DsAlignment &alignment, const DsFPoint &offset=DsFPoint())
Changes the X and Y components of the current rectangle to align it in the specified parent rectangle...
Definition ds_geometry.h:2590
void setPosition(const DsFPoint &pos)
Sets the position of the rectangle (top left corner).
Definition ds_geometry.h:2117
float area(void) const
Gets the area of rectangle.
Definition ds_geometry.h:2167
void setSize(const DsFSize &size)
Sets the size of the rectangle.
Definition ds_geometry.h:2139
float y
Y coordinate of the top left corner.
Definition ds_geometry.h:2625
DsFPoint getPosition(void) const
Gets the position of the rectangle (top left corner).
Definition ds_geometry.h:2107
DsFSize getSize(void) const
Gets the size of the rectangle.
Definition ds_geometry.h:2129
DsFRect dilateTop(float size)
Dilates the current DsRect object by a specific size on the top side only.
Definition ds_geometry.h:2448
DsFRect dilateBotom(float size)
Dilates the current DsRect object by a specific size on the bottom side only.
Definition ds_geometry.h:2469
DsFRect getBottomRegion(float split_line)
Splits the rectangle in two using a horizontal line and returns the bottom rectangle.
Definition ds_geometry.h:2572
DsFRect move(const DsFPoint &offset) override final
Moves the current DsRect object by a specified 2D offset.
Definition ds_geometry.h:2216
DsFRect dilateRight(float size)
Dilates the current DsRect object by a specific size on the right side only.
Definition ds_geometry.h:2508
float h
Height of the rectangle in pixels.
Definition ds_geometry.h:2627
DsFRect erodeLeft(float size) const
Erodes the current DsRect object by a specific size on the left side only.
Definition ds_geometry.h:2329
DsFRect getTopRegion(float split_line)
Splits the rectangle in two using a horizontal line and returns the top rectangle.
Definition ds_geometry.h:2557
DsFRect dilate(float size)
Dilates the current DsRect object by a specific size.
Definition ds_geometry.h:2426
DsFRect intersect(const DsFRect &r) const
Gets the intersection rectangle of the current DsRect object with another rectangle.
Definition ds_geometry.h:2194
float w
Width of the rectangle in pixels.
Definition ds_geometry.h:2626
DsFRect erode(float size) const
Erodes the current DsRect object by a specific size.
Definition ds_geometry.h:2286
DsFRect erodeVertical(float size) const
Erodes the current DsRect object by a specific size in the vertical direction only.
Definition ds_geometry.h:2367
DsFRect(float x, float y, float w, float h)
Creates a DsPoint object initialized to (x, y, w, h).
Definition ds_geometry.h:2087
DsFRect erodeHorizontal(float size) const
Erodes the current DsRect object by a specific size in the horizontal direction.
Definition ds_geometry.h:2309
DsFRect erodeRight(float size) const
Erodes the current DsRect object by a specific size on the right side only.
Definition ds_geometry.h:2349
DsFRect getLeftRegion(float split_line)
Splits the rectangle in two using a vertical line and returns the left rectangle.
Definition ds_geometry.h:2526
bool contains(const DsFPoint &p) const
Does the rectangle contain a specific point?
Definition ds_geometry.h:2180
DsFRect(const DsRect &r)
Creates a DsFRect object from a DsRect object.
Definition ds_geometry.h:2075
DsFSize is class that represents the 2D size of a graphic object (width, height) as floating point va...
Definition ds_geometry.h:1110
DsFSize(const DsSize &s)
Creates a DsFSize object from a DsSize object.
Definition ds_geometry.h:1156
bool operator!=(const DsFSize &rhs) const
Comparison operator.
Definition ds_geometry.h:1177
DsFSize swap(void)
Returns a DsFSize object with the width and height swapped.
Definition ds_geometry.h:1379
DsFSize(const DsFPoint &p)
Creates a DsFSize object using the X and Y coordinates of a point as width and height.
Definition ds_geometry.h:1146
DsFSize saturateMin(const DsFSize &min)
Saturates the current DsFSize object components to the minimum specified.
Definition ds_geometry.h:1393
DsFSize saturateMax(const DsFSize &max)
Saturates the current DsFSize object components to the maximum specified.
Definition ds_geometry.h:1414
DsFSize(const DsPoint &p)
Creates a DsFSize object using the X and Y coordinates of a point as width and height.
Definition ds_geometry.h:1136
DsFSize saturate(const DsFSize &min, const DsFSize &max)
Saturates the current DsFSize object components to the minimum and maximum specified.
Definition ds_geometry.h:1436
bool operator==(const DsFSize &rhs) const
Comparison operator.
Definition ds_geometry.h:1166
DsFSize(float w, float h)
Creates a DsFSize object of size (w, h).
Definition ds_geometry.h:1126
DsFSize operator-() const
Unary minus operator. Reverses the signs of both the W and H of the current DsFSize object.
Definition ds_geometry.h:1188
friend DsFSize operator/(const DsFSize &lhs, const DsFSize &rhs)
Division operator - divides both W and H components of a DsFSize object by the same divisor.
Definition ds_geometry.h:1354
float w
Width component.
Definition ds_geometry.h:1484
DsFSize & operator-=(const DsFSize &rhs)
Subtraction operator - subtracts a DsFSize object from the current DsFSize object.
Definition ds_geometry.h:1295
friend DsFSize operator*(const DsFSize &lhs, const DsFSize &rhs)
Multiplication operator - multiplies both W and H components of a DsFSize object with the (W,...
Definition ds_geometry.h:1340
friend DsFSize operator+(const DsFSize &lhs, float rhs)
Addition operator - adds two DsFSize objects.
Definition ds_geometry.h:1221
DsFSize()
Creates a DsFSize object of size (0, 0).
Definition ds_geometry.h:1115
float h
Height component.
Definition ds_geometry.h:1485
friend DsFSize operator*(const DsFSize &lhs, float multiplier)
Multiplication operator - multiplies both W and H components of a DsFSize object with the same multip...
Definition ds_geometry.h:1326
DsFSize & operator+=(const DsFSize &rhs)
Addition operator - adds a DsFSize object to the current DsFSize object.
Definition ds_geometry.h:1235
friend DsFSize operator-(const DsFSize &lhs, const DsFSize &rhs)
Subtraction operator - subtracts two DsFSize objects.
Definition ds_geometry.h:1266
DsFSize & operator-=(float rhs)
Subtraction operator - subtracts an integer from the current DsFSize object.
Definition ds_geometry.h:1310
friend DsFSize operator-(const DsFSize &lhs, float rhs)
Subtraction operator - subtracts an integer from a DsFSize object.
Definition ds_geometry.h:1281
friend DsFSize operator+(const DsFSize &lhs, const DsFSize &rhs)
Addition operator - adds two DsFSize objects.
Definition ds_geometry.h:1206
DsFSize & operator+=(float rhs)
Addition operator - adds an integer to the current DsFSize object (add to both w and h).
Definition ds_geometry.h:1250
friend DsFSize operator/(const DsFSize &lhs, float divisor)
Division operator - divides both W and H components of a DsFSize object by the (W,...
Definition ds_geometry.h:1368
DsPoint is a class that represents the X and Y 2D coordinates of a point as integer numbers.
Definition ds_geometry.h:24
DsPoint & operator=(const DsFPoint &rhs)
Assignment operator from a DsFPoint object.
friend DsPoint operator/(const DsPoint &lhs, int32_t divisor)
Integer division operator - divides both X and Y coordinates of a DsPoint object by the same divisor.
Definition ds_geometry.h:238
friend float distance(const DsPoint &p1, const DsPoint &p2)
Calculates the Euclidian distance between two DsPoint objects.
Definition ds_geometry.h:378
int32_t y
Y component.
Definition ds_geometry.h:387
int32_t x
X component.
Definition ds_geometry.h:386
DsPoint operator-() const
Unary minus operator. Reverses the signs of both the X and Y coordinates of the current DsPoint objec...
Definition ds_geometry.h:80
bool operator==(const DsPoint &rhs)
Comparison operator.
Definition ds_geometry.h:69
DsPoint saturateMax(const DsPoint &max)
Saturates the current DsPoint object coordinates to the maximum specified.
Definition ds_geometry.h:288
DsPoint & operator-=(int32_t rhs)
Subtraction operator - subtract a number from the current DsPoint object.
Definition ds_geometry.h:206
DsPoint & operator+=(const DsPoint &rhs)
Addition operator - adds a DsPoint object to the current DsPoint object.
Definition ds_geometry.h:128
friend DsPoint operator-(const DsPoint &lhs, int32_t rhs)
Subtraction operator - subtract a number from a DsPoint object.
Definition ds_geometry.h:176
float distance(const DsPoint &p) const
Calculates the Euclidian distance between the current DsPoint object and a second DsPoint object.
Definition ds_geometry.h:335
friend DsPoint operator+(const DsPoint &lhs, int32_t rhs)
Addition operator - adds a number to both the X and Y coordinates of a DsPoint object.
Definition ds_geometry.h:114
DsPoint & operator-=(const DsPoint &rhs)
Subtraction operator - subtract a DsPoint object from the current DsPoint object.
Definition ds_geometry.h:190
DsPoint(int32_t x, int32_t y)
Creates a DsPoint object initialized to (x, y).
Definition ds_geometry.h:40
friend DsPoint operator-(const DsPoint &lhs, const DsPoint &rhs)
Subtraction operator - subtract two DsPoint objects.
Definition ds_geometry.h:161
friend DsPoint operator*(const DsPoint &lhs, int32_t multiplier)
Multiplication operator - multiplies both X and Y coordinates of a DsPoint object with the same multi...
Definition ds_geometry.h:223
float distanceY(const DsPoint &p) const
Calculates the Y component of the Euclidian distance between the current DsPoint object and a second ...
Definition ds_geometry.h:364
friend DsPoint operator+(const DsPoint &lhs, const DsPoint &rhs)
Addition operator - adds two DsPoint objects.
Definition ds_geometry.h:99
void swap(void)
Swaps the X and Y coordinates of the current DsPoint object.
Definition ds_geometry.h:56
DsPoint & operator+=(int32_t rhs)
Addition operator - adds a number to both the X and Y coordinates of the current DsPoint object.
Definition ds_geometry.h:144
float distanceX(const DsPoint &p) const
Calculates the X component of the Euclidian distance between the current DsPoint object and a second ...
Definition ds_geometry.h:351
DsPoint saturateMin(const DsPoint &min)
Saturates the current DsPoint object coordinates to the minimum specified.
Definition ds_geometry.h:267
friend DsPoint operator/(const DsPoint &lhs, float divisor)
Integer division operator - divides both X and Y coordinates of a DsPoint object by the same divisor.
Definition ds_geometry.h:253
DsPoint()
Creates a DsPoint object initialized to (0, 0).
Definition ds_geometry.h:29
DsPoint saturate(const DsPoint &min, const DsPoint &max)
Saturates the current DsPoint object coordinates to the minimum and maximum specified.
Definition ds_geometry.h:310
DsRect is a class that represents a 2D rectangle (X, Y, W, H)
Definition ds_geometry.h:1507
DsRect dilateRight(uint32_t size)
Dilates the current DsRect object by a specific size on the right side only.
Definition ds_geometry.h:1941
DsRect erodeBottom(uint32_t size) const
Erodes the current DsRect object by a specific size on the bottom side only.
Definition ds_geometry.h:1851
DsRect dilateTop(uint32_t size)
Dilates the current DsRect object by a specific size on the top side only.
Definition ds_geometry.h:1888
int32_t h
Height of the rectangle in pixels.
Definition ds_geometry.h:2050
DsRect getRightRegion(int32_t split_line)
Splits the rectangle in two using a vertical line and returns the right rectangle.
Definition ds_geometry.h:1973
DsRect getBottomRegion(int32_t split_line)
Splits the rectangle in two using a horizontal line and returns the bottom rectangle.
Definition ds_geometry.h:2004
DsPoint getPosition(void) const
Gets the position of the rectangle (top left corner).
Definition ds_geometry.h:1545
DsRect getLeftRegion(int32_t split_line)
Splits the rectangle in two using a vertical line and returns the left rectangle.
Definition ds_geometry.h:1958
int32_t x
X coordinate of the top left corner.
Definition ds_geometry.h:2047
void setPosition(const DsFPoint &pos)
Sets the position of the rectangle (top left corner).
Definition ds_geometry.h:1567
DsRect dilateBotom(uint32_t size)
Dilates the current DsRect object by a specific size on the bottom side only.
Definition ds_geometry.h:1906
DsFRect move(const DsFPoint &offset) override final
Moves the current DsRect object by a specified 2D offset.
DsRect()
Creates a DsRect object initialized to (0, 0, 0, 0).
Definition ds_geometry.h:1513
int32_t y
Y coordinate of the top left corner.
Definition ds_geometry.h:2048
DsSize getSize(void) const
Gets the size of the rectangle.
Definition ds_geometry.h:1579
DsRect dilateLeft(uint32_t size)
Dilates the current DsRect object by a specific size on the left side only.
Definition ds_geometry.h:1923
DsRect & align(const DsRect &boundary, const DsAlignment &alignment, const DsPoint &offset=DsPoint())
Changes the X and Y components of the current rectangle to align it in the specified parent rectangle...
Definition ds_geometry.h:2022
DsRect erodeLeft(uint32_t size) const
Erodes the current DsRect object by a specific size on the left side only.
Definition ds_geometry.h:1782
void setPosition(const DsPoint &pos)
Sets the position of the rectangle (top left corner).
Definition ds_geometry.h:1555
DsRect intersect(const DsRect &r) const
Gets the intersection rectangle of the current DsRect object with another rectangle.
Definition ds_geometry.h:1644
DsRect erodeHorizontal(uint32_t size) const
Erodes the current DsRect object by a specific size in the horizontal direction.
Definition ds_geometry.h:1765
friend DsRect operator+(const DsRect &lhs, const DsRect &rhs)
Addition operator - concatenates two DsRect objects.
Definition ds_geometry.h:1720
DsRect erode(uint32_t size) const
Erodes the current DsRect object by a specific size.
Definition ds_geometry.h:1744
uint32_t area(void) const
Gets the area of rectangle.
Definition ds_geometry.h:1617
DsRect erodeRight(uint32_t size) const
Erodes the current DsRect object by a specific size on the right side only.
Definition ds_geometry.h:1799
DsRect getTopRegion(int32_t split_line)
Splits the rectangle in two using a horizontal line and returns the top rectangle.
Definition ds_geometry.h:1989
int32_t w
Width of the rectangle in pixels.
Definition ds_geometry.h:2049
DsRect erodeTop(uint32_t size) const
Erodes the current DsRect object by a specific size on the top side only.
Definition ds_geometry.h:1833
DsFPoint getCenter(void) const
Gets the position of the center of the rectangle.
Definition ds_geometry.h:1601
DsRect dilate(uint32_t size)
Dilates the current DsRect object by a specific size.
Definition ds_geometry.h:1868
void setSize(const DsSize &size)
Sets the size of the rectangle.
Definition ds_geometry.h:1589
bool contains(const DsPoint &p) const
Does the rectangle contain a specific point?
Definition ds_geometry.h:1630
DsRect erodeVertical(uint32_t size) const
Erodes the current DsRect object by a specific size in the vertical direction only.
Definition ds_geometry.h:1816
DsRect & move(const DsPoint &offset)
Moves the current DsRect object by a specified 2D offset.
Definition ds_geometry.h:1666
DsRect(const DsPoint &pos, const DsSize &size)
Creates a DsPoint object initialized to (x, y, w, h).
Definition ds_geometry.h:1535
DsRect(int32_t x, int32_t y, int32_t w, int32_t h)
Creates a DsPoint object initialized to (x, y, w, h).
Definition ds_geometry.h:1525
DsRect & cat(const DsRect &r)
Concatenates the current DsRect object with another rectangle.
Definition ds_geometry.h:1690
Definition ds_geometry.h:1492
DsSize is class that represents the 2D size of a graphic object (width, height) as integer values.
Definition ds_geometry.h:780
friend DsSize operator-(const DsSize &lhs, int32_t rhs)
Subtraction operator - subtracts an integer from a DsSize object.
Definition ds_geometry.h:931
DsSize operator-() const
Unary minus operator. Reverses the signs of both the W and H of the current DsSize object.
Definition ds_geometry.h:838
friend DsSize operator+(const DsSize &lhs, const DsSize &rhs)
Addition operator - adds two DsSize objects.
Definition ds_geometry.h:856
DsSize & operator+=(const DsSize &rhs)
Addition operator - adds a DsSize object to the current DsSize object.
Definition ds_geometry.h:885
DsSize saturateMax(const DsSize &max)
Saturates the current DsSize object components to the maximum specified.
Definition ds_geometry.h:1026
friend DsSize operator-(const DsSize &lhs, const DsSize &rhs)
Subtraction operator - subtracts two DsSize objects.
Definition ds_geometry.h:916
DsSize swap(void)
Returns a DsSize object with the width and height swapped.
Definition ds_geometry.h:1046
DsSize & operator+=(int32_t rhs)
Addition operator - adds an integer to the current DsSize object (add to both w and h).
Definition ds_geometry.h:900
int32_t h
Height component.
Definition ds_geometry.h:1101
DsSize & operator-=(const DsSize &rhs)
Subtraction operator - subtracts a DsSize object from the current DsSize object.
Definition ds_geometry.h:945
DsSize(int32_t w, int32_t h)
Creates a DsSize object of size (w, h).
Definition ds_geometry.h:796
DsSize saturate(const DsSize &min, const DsSize &max)
Saturates the current DsSize object components to the minimum and maximum specified.
Definition ds_geometry.h:1062
friend DsSize operator/(const DsSize &lhs, float divisor)
Division operator - divides both W and H components of a DsSize object by the same divisor.
Definition ds_geometry.h:991
DsSize(const DsPoint &p)
Creates a DsSize object using the X and Y coordinates of a point as width and height.
Definition ds_geometry.h:806
DsSize saturateMin(const DsSize &min)
Saturates the current DsSize object components to the minimum specified.
Definition ds_geometry.h:1005
friend DsSize operator*(const DsSize &lhs, float multiplier)
Multiplication operator - multiplies both W and H components of a DsSize object with the same multipl...
Definition ds_geometry.h:976
friend DsSize operator+(const DsSize &lhs, int32_t rhs)
Addition operator - adds two DsSize objects.
Definition ds_geometry.h:871
DsSize & operator-=(int32_t rhs)
Subtraction operator - subtracts an integer from the current DsSize object.
Definition ds_geometry.h:960
int32_t w
Width component.
Definition ds_geometry.h:1100
DsSize()
Creates a DsSize object of size (0, 0).
Definition ds_geometry.h:785
bool operator!=(const DsSize &rhs) const
Comparison operator.
Definition ds_geometry.h:827
bool operator==(const DsSize &rhs) const
Comparison operator.
Definition ds_geometry.h:816
DsSurface is a class that represents a drawing surface.
Definition ds_surface.h:30
pair is a class that represents a pair of two values.
Definition ds_types_pair.h:20