# Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

### Protego

# MLA -- Graphics Library

- 1
- 2
…
- 82
- 83
- 84
- 85
- 86
…
- 373
- 374

uint16_t x,
uint16_t y,
uint16_t radius)
1.6.1.1.3.2 GFX_PolygonDraw Function
This function renders a polygon using the currently set line style and color.
File
gfx_primitive.h
Syntax
GFX_STATUS GFX_PolygonDraw(uint16_t numPoints, uint16_t * polyPoints);
Returns
Status of the polygon rendering. GFX_STATUS_SUCCESS - polygon rendering done. GFX_STATUS_FAILURE - polygon
rendering is not done.
Description
This function renders a polygon using the currently set line style (see GFX_LineStyleSet()) and color (see GFX_ColorSet()).
The shape of the polygon is determined by the polygon points (an ordered array of x,y pairs) where the pair count is equal to
the parameter sides.
If any of the x,y pairs do not lie on the frame buffer, then the behavior is undefined. If color is not set, before this function is
called, the output is undefined.
Preconditions
Color must be set by GFX_ColorSet(). Line style must be set by GFX_LineStyleSet().
Example
uint16_t OpenShapeXYPoints[6] = {10, 10, 20, 10, 20, 20};
uint16_t ClosedShapeXYPoints[8] = {10, 10, 20, 10, 20, 20, 10, 10};
GFX_ColorSet(WHITE);
// set color
SetLineType(GFX_LINE_STYLE_THIN_DOTTED); // set line style
GFX_PolygonDraw(3, OpenShapeXYPoints); // draw an open shape
GFX_PolygonDraw(4, ClosedShapeXYPoints); // draw a closed shape
Parameters
Parameters Description
sides the number of sides of the polygon.
pPoints Pointer to the array of polygon points. The array defines the
x,y points of the polygon. The sequence should be x0, y0,
x1, y1, x2, y2, ... xn, yn where n is the # of polygon sides.
Function
GFX_STATUS GFX_PolygonDraw(
uint16_t sides,
uint16_t *pPoints)
1.6.1.1.3.3 GFX_RectangleDraw Function
This function renders a rectangular shape using the currently set line style and color.
File
gfx_primitive.h
1.6 Library Interface MLA - Graphics Library Help Graphics Primitive Layer
84

- 1
- 2
…
- 82
- 83
- 84
- 85
- 86
…
- 373
- 374