Files | |
file | metrics.c |
Metric functions Rect, point and rect list calculations. | |
file | metrics.h |
Metrics Declarations and structures for metrics. | |
Data Structures | |
struct | TPoint |
2 dimension point More... | |
struct | TSPoint |
3 dimension point More... | |
struct | TRect |
2 dimension rectangle More... | |
struct | TSize |
2 dimension rectange size More... | |
Defines | |
#define | _PointInRect(p, r) (p.x >= r.a.x && p.y >= r.a.y && p.x <= r.b.x && p.y <= r.b.y) |
Inline version of PointInRect (faster, use only if you need high performances). | |
#define | _RectOverlay(r, d) !( (r).a.x > (d).b.x || (r).a.y > (d).b.y || (r).b.x < (d).a.x || (r).b.y < (d).a.y ) |
Inline version of RectOverlay (faster, use only if you need high performances). | |
#define | _RectIntersept(i, r, d) (i)->b.x = max((r).a.x, min((r).b.x, (d).b.x)); (i)->b.y = max((r).a.y, min((r).b.y, (d).b.y)); (i)->a.x = min((r).b.x, max((r).a.x, (d).a.x)); (i)->a.y = min((r).b.y, max((r).a.y, (d).a.y)); |
Inline version of RectIntersept (faster, use only if you need high performances). | |
Typedefs | |
typedef TPoint | TPoint |
2 dimension point | |
typedef TPoint * | PPoint |
2 dimension point | |
typedef TSPoint | TSPoint |
3 dimension point | |
typedef TSPoint * | PSPoint |
3 dimension point | |
typedef TRect | TRect |
2 dimension rectangle | |
typedef TRect * | PRect |
2 dimension rectangle | |
typedef TSize | TSize |
2 dimension rectange size | |
typedef TSize * | PSize |
2 dimension rectange size | |
Functions | |
void | PointAssign (TPoint *p, l_int x, l_int y) |
Assign a point with the specified x and y coordinates. | |
l_bool | PointInRect (TPoint p, TRect r) |
Calculates wherever a point is located in the specified rectangle. | |
void | RectAssign (TRect *r, l_int ax, l_int ay, l_int bx, l_int by) |
Assigns the specified coordinates to a rectangle structure. | |
void | RectMove (TRect *d, TRect r, TPoint p) |
Moves a rectangle using a point to define x and y move. | |
void | RectUnMove (TRect *d, TRect r, TPoint p) |
Moves a rectangle back from a prevoius call of RectMove. | |
l_int | GetXDelta (TRect r) |
Calculates the position of the x coordinate of the rectangle. | |
l_int | GetYDelta (TRect r) |
Calculates the position of the y coordinate of the rectangle. | |
l_int | GetWidth (TRect r) |
Calculates the width of the rectangle. | |
l_int | GetHeight (TRect r) |
Calculates the height of the rectangle. | |
l_bool | RectOverlay (TRect r, TRect d) |
Dertermines if rects r and d has a common part. | |
void | RectIntersept (TRect *i, TRect r, TRect d) |
Calculate the common part of r and d ans assign it into i. |
|
Inline version of PointInRect (faster, use only if you need high performances).
|
|
Inline version of RectIntersept (faster, use only if you need high performances).
|
|
Inline version of RectOverlay (faster, use only if you need high performances).
|
|
Calculates the height of the rectangle.
|
|
Calculates the width of the rectangle.
|
|
Calculates the position of the x coordinate of the rectangle.
|
|
Calculates the position of the y coordinate of the rectangle.
|
|
Assign a point with the specified x and y coordinates.
|
|
Calculates wherever a point is located in the specified rectangle.
|
|
Assigns the specified coordinates to a rectangle structure. Passed values are not checked.
|
|
Calculate the common part of r and d ans assign it into i.
|
|
Moves a rectangle using a point to define x and y move.
|
|
Dertermines if rects r and d has a common part.
|
|
Moves a rectangle back from a prevoius call of RectMove. It corresponds to a negative move.
|