MPLABĀ® Harmony Graphics Suite  GFX v3.13.0
Legato API Documentation
legato_rect.h File Reference

Rectangle functions and definitions. More...

Include dependency graph for legato_rect.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

leBool leRectContainsPoint (const leRect *rect, const lePoint *point)
 Determines if a point is inside a rectangle. More...
 
leBool leRectContainsRect (const leRect *l_rect, const leRect *r_rect)
 Determines if a rectangle is completely inside another rectangle. More...
 
leBool leRectIntersects (const leRect *l_rect, const leRect *r_rect)
 Determines if two rectangles are intersecting. More...
 
void leRectCombine (const leRect *l_rect, const leRect *r_rect, leRect *res)
 Combine rectangles. More...
 
void leRectClip (const leRect *l_rect, const leRect *r_rect, leRect *result)
 Clips a rectangle to the space of another rectangle. More...
 
void leRectClipAdj (const leRect *l_rect, const leRect *r_rect, leRect *adj, leRect *res)
 Clips a rectangle to the space of another rectangle. More...
 
void leRectFromPoints (const lePoint *p1, const lePoint *p2, leRect *res)
 Create rectangle from two points. More...
 
void leRectToPoints (const leRect *rect, lePoint *p1, lePoint *p2)
 Create rectangle from two points. More...
 
uint32_t leRectSplit (const leRect *sub, const leRect *obj, leRect res[4])
 Split rectangles. More...
 
int32_t leRectCompare (const leRect *l, const leRect *r)
 Determines if two rectangles are similar. More...
 
leBool leRectsAreSimilar (const leRect *l, const leRect *r)
 Determine if two rectanges are similar. More...
 

Detailed Description

Rectangle functions and definitions.

Rectangle management functions.

Function Documentation

◆ leRectClip()

void leRectClip ( const leRect l_rect,
const leRect r_rect,
leRect result 
)

Clips a rectangle to the space of another rectangle.

Produces a single rectangle after cliping r_rect by l_rect.

Remarks
result is equalvent to l_rect if the rectangles do not intersect.
leRect* l_rect;
leRect* r_rect;
leRectClip(l_rect, r_rect, result);
Parameters
l_recta rectangle.
r_recta rectangle.
resultis the new rectangle.
Returns
void.
Here is the caller graph for this function:

◆ leRectClipAdj()

void leRectClipAdj ( const leRect l_rect,
const leRect r_rect,
leRect adj,
leRect res 
)

Clips a rectangle to the space of another rectangle.

Produces a single rectangle after cliping r_rect by l_rect.

Remarks
result is equalvent to l_rect if the rectangles do not intersect.
leRect* l_rect;
leRect* r_rect;
leRect* rect = leRectClipAdj(l_rect, r_rect, result);
Parameters
l_recta rectangle.
r_recta rectangle.
resultis the adjusted rectangle.
resthe resultant rectangle
Returns
void.

◆ leRectCombine()

void leRectCombine ( const leRect l_rect,
const leRect r_rect,
leRect res 
)

Combine rectangles.

Returns a single rectangle after combining l_rect and r_rect.

leRect* l_rect;
leRect* r_rect;
leRect res;
leRectCombine(l_rect, r_rect, &res);
Parameters
l_recta rectangle.
r_recta rectangle.
resthe resulting rectangle
Returns
leRect.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ leRectCompare()

int32_t leRectCompare ( const leRect l,
const leRect r 
)

Determines if two rectangles are similar.

Determines if l and r</> have the same position and dimensions.

leRect* l;
leRect* r;
int32_t isSimilar = leRectCompare(l, r);
Parameters
la point.
ra point.
Returns
leRect.

◆ leRectContainsPoint()

leBool leRectContainsPoint ( const leRect rect,
const lePoint point 
)

Determines if a point is inside a rectangle.

Returns true if point is inside rect.

const leRect* rect;
const lePoint* point;
leBool isInside = leRectContainsPoint(rect, point);
Parameters
rectis the area to search.
pointis the criteria
Returns
LE_TRUE if inside, otherwise LE_FALSE;

◆ leRectContainsRect()

leBool leRectContainsRect ( const leRect l_rect,
const leRect r_rect 
)

Determines if a rectangle is completely inside another rectangle.

Returns true if l_rect is inside r_rect.

leRect* l_rect;
leRect* r_rect;
leBool isInside = leRectContainsRect(l_rect, r_rect);
Parameters
rectis the area to search.
pointis the criteria
Returns
LE_TRUE if inside, otherwise LE_FALSE;
Here is the caller graph for this function:

◆ leRectFromPoints()

void leRectFromPoints ( const lePoint p1,
const lePoint p2,
leRect res 
)

Create rectangle from two points.

Creates a rectangle specified by p1 and p2.

lePoint* p1;
lePoint* p2;
leRect* r_rect = leRectFromPoints(p1, p2);
Parameters
p1the first point
p2the second point
resthe resultant rectangle
Returns
leRect structure based on 2 points.

◆ leRectIntersects()

leBool leRectIntersects ( const leRect l_rect,
const leRect r_rect 
)

Determines if two rectangles are intersecting.

Returns true if l_rect intersects r_rect.

leRect* l_rect;
leRect* r_rect;
leBool isInside = leRectIntersects(l_rect, r_rect);
Parameters
l_recta rectangle.
r_recta rectangle.
Returns
LE_TRUE if intersect, otherwise LE_FALSE;
Here is the caller graph for this function:

◆ leRectsAreSimilar()

leBool leRectsAreSimilar ( const leRect l,
const leRect r 
)

Determine if two rectanges are similar.

Determines if l and r are adjancent and vertically or horizontally aligned.

leRect* l;
leRect* r;
leBool isSimilar = leRectsAreSimilar(l, r);
Parameters
la point.
ra point.
Returns
LE_TRUE if similar, otherwise LE_FALSE;
Here is the caller graph for this function:

◆ leRectSplit()

uint32_t leRectSplit ( const leRect sub,
const leRect obj,
leRect  res[4] 
)

Split rectangles.

Splits sub and obj into a maximum of four non-overlapping rectangles res.

leRect* sub;
leRect* obj;
leRect res[4];
int32_t isSimilar = leRectSplit(sub, obj, res);
Parameters
subthe first rectangle.
objthe second rectangle.
res
Returns
the number of non-overlapping rectangles returned.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ leRectToPoints()

void leRectToPoints ( const leRect rect,
lePoint p1,
lePoint p2 
)

Create rectangle from two points.

Returns a rectangle specified by p1 and p2.

leRect* l_rect;
lePoint* p1;
lePoint* p2;
Parameters
rectthe rectangle
p1the point of upper left vertex
p2the point of the lower right vertex
Returns
void.