# Vault 7: Projects

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

### Protego

# MLA -- Graphics Library

- 1
- 2
…
- 88
- 89
- 90
- 91
- 92
…
- 373
- 374

uint16_t x,
uint16_t y,
uint16_t radius)
1.6.1.1.4.3 GFX_RectangleFillDraw Function
This function renders a filled rectangular shape using the currently set fill style and colors.
File
gfx_primitive.h
Syntax
GFX_STATUS GFX_RectangleFillDraw(uint16_t left, uint16_t top, uint16_t right, uint16_t
bottom);
Returns
Status of the rectangle rendering. GFX_STATUS_SUCCESS - rectangle fill rendering done. GFX_STATUS_FAILURE -
rectangle fill rendering is not done.
Description
This function renders a filled rectangular shape with the currently set fill style (see GFX_FILL_STYLE) with the given left,
top, right, and bottom parameters to define the shape dimension. The shape is rendered depending on the fill style. If a flat
color is used, color must be set (see GFX_ColorSet()) before calling this function. If gradient color is used, gradient start and
end color must be set (see GFX_GradientColorSet()) before calling this function. After the fill style and colors are set,
multiple calls to this function can be performed.
The rendering of this shape becomes undefined when any one of the following is true:
• Any of the following pixel locations left,top or right,bottom falls outside the frame buffer.
• Fill style is not set (GFX_FillStyleSet(), before this function is called.
• Colors are not set before this function is called.
• When right < left
• When bottom < top
• When pixel locations defined by left, top and/or right, bottom are not on the frame buffer.
Preconditions
Fill style must be set by GFX_FillStyleSet(). Color must be set by GFX_ColorSet().
Example
// assume BLUE and RED are macros that define GFX_COLOR types
GFX_STATUS status;
// render a rectangle with gradient colors from BLUE to RED
GFX_FillStyleSet(GFX_FILL_STYLE_GRADIENT_LEFT);
GFX_GradientColorSet(BLUE, RED);
status = GFX_RectangleFillDraw(10, 110, 100, 200);
// render an alpha blended rounded rectangle with
// the current contents of the frame buffer
GFX_FillStyleSet(GFX_FILL_STYLE_ALPHA_COLOR);
GFX_AlphaBlendingValueSet(50);
GFX_BackgroundTypeSet(GFX_BACKGROUND_DISPLAY_BUFFER);
GFX_ColorSet(RED);
status = GFX_RectangleRoundFillDraw(10, 110, 100, 200, 10);
// render an alpha blended rectangle with an image
GFX_FillStyleSet(GFX_FILL_STYLE_ALPHA_COLOR);
GFX_AlphaBlendingValueSet(50);
GFX_BackgroundTypeSet(GFX_BACKGROUND_IMAGE);
GFX_ColorSet(RED);
1.6 Library Interface MLA - Graphics Library Help Graphics Primitive Layer
90

- 1
- 2
…
- 88
- 89
- 90
- 91
- 92
…
- 373
- 374