Functions | |
void | Graphics_drawRectangle (const Graphics_Context *context, const Graphics_Rectangle *rect) |
void | Graphics_fillRectangle (const Graphics_Context *context, const Graphics_Rectangle *rect) |
int32_t | Graphics_isRectangleOverlap (Graphics_Rectangle *rect1, Graphics_Rectangle *rect2) |
int32_t | Graphics_getRectangleIntersection (Graphics_Rectangle *rect1, Graphics_Rectangle *rect2, Graphics_Rectangle *intersect) |
bool | Graphics_isPointWithinRectangle (const Graphics_Rectangle *rect, uint16_t x, uint16_t y) |
void Graphics_drawRectangle | ( | const Graphics_Context * | context, |
const Graphics_Rectangle * | rect | ||
) |
Draws a rectangle.
context | is a pointer to the drawing context to use. |
rect | is a pointer to the structure containing the extents of the rectangle. |
This function draws a rectangle. The rectangle will extend from xMin to xMax and yMin to yMax, inclusive.
References Graphics_drawLineH(), Graphics_drawLineV(), Graphics_Rectangle::xMax, Graphics_Rectangle::xMin, Graphics_Rectangle::yMax, and Graphics_Rectangle::yMin.
Referenced by Graphics_drawCheckBox(), and Graphics_drawReleasedCheckBox().
void Graphics_fillRectangle | ( | const Graphics_Context * | context, |
const Graphics_Rectangle * | rect | ||
) |
Draws a filled rectangle.
context | is a pointer to the drawing context to use. |
rect | is a pointer to the structure containing the extents of the rectangle. |
This function draws a filled rectangle. The rectangle will extend from xMin to xMax and yMin to yMax, inclusive. The clipping of the rectangle to the clipping rectangle is performed within this routine; the display driver's rectangle fill routine is used to perform the actual rectangle fill.
References Graphics_Context::clipRegion, Graphics_Context::display, Graphics_Context::foreground, Graphics_fillRectangleOnDisplay(), Graphics_Rectangle::xMax, Graphics_Rectangle::xMin, Graphics_Rectangle::yMax, and Graphics_Rectangle::yMin.
Referenced by Graphics_drawCheckBox(), Graphics_drawImageButton(), Graphics_drawReleasedCheckBox(), Graphics_drawReleasedImageButton(), and Graphics_drawSelectedImageButton().
int32_t Graphics_isRectangleOverlap | ( | Graphics_Rectangle * | rect1, |
Graphics_Rectangle * | rect2 | ||
) |
Determines if two rectangles overlap.
rect1 | is a pointer to the first rectangle. |
rect2 | is a pointer to the second rectangle. |
This function determines whether two rectangles overlap. It assumes that rectangles rect1 and rect2 are valid with xMin < xMax and yMin < yMax.
References Graphics_Rectangle::xMax, Graphics_Rectangle::xMin, Graphics_Rectangle::yMax, and Graphics_Rectangle::yMin.
Referenced by Graphics_getRectangleIntersection().
int32_t Graphics_getRectangleIntersection | ( | Graphics_Rectangle * | rect1, |
Graphics_Rectangle * | rect2, | ||
Graphics_Rectangle * | intersect | ||
) |
Determines the intersection of two rectangles.
rect1 | is a pointer to the first rectangle. |
rect2 | is a pointer to the second rectangle. |
intersect | is a pointer to a rectangle which will be written with the intersection of rect1 and rect2. |
This function determines if two rectangles overlap and, if they do, calculates the rectangle representing their intersection. If the rectangles do not overlap, 0 is returned and intersect is not written.
References Graphics_isRectangleOverlap(), max, min, Graphics_Rectangle::xMax, Graphics_Rectangle::xMin, Graphics_Rectangle::yMax, and Graphics_Rectangle::yMin.
bool Graphics_isPointWithinRectangle | ( | const Graphics_Rectangle * | rect, |
uint16_t | x, | ||
uint16_t | y | ||
) |
Determines if a point lies within a given rectangle.
rect | is a pointer to the rectangle which the point is to be checked against. |
x | is the X coordinate of the point to be checked. |
y | is the Y coordinate of the point to be checked. |
This function determines whether point (x, y) lies within the rectangle described by rect.