Embedded SDK
Embedded SDK
|
Implementation of middle-level API to draw rich forms like rounded rectangle. More...
#include <string.h>
#include "nbgl_front.h"
#include "nbgl_draw.h"
#include "nbgl_fonts.h"
#include "nbgl_debug.h"
#include "nbgl_side.h"
#include "qrcodegen.h"
#include "glyphs.h"
#include "os_pic.h"
#include "os_utils.h"
Go to the source code of this file.
Classes | |
struct | QrCodeBuffer_t |
Macros | |
#define | QR_PIXEL_WIDTH_HEIGHT 4 |
#define | qrcode ((QrCodeBuffer_t *) ramBuffer)->qrcode |
#define | tempBuffer ((QrCodeBuffer_t *) ramBuffer)->tempBuffer |
#define | QrDrawBuffer ((QrCodeBuffer_t *) ramBuffer)->QrDrawBuffer |
Enumerations | |
enum | quarter_t { BAGL_FILL_CIRCLE_0_PI2 , BAGL_FILL_CIRCLE_PI2_PI , BAGL_FILL_CIRCLE_PI_3PI2 , BAGL_FILL_CIRCLE_3PI2_2PI } |
Functions | |
CCASSERT (qr_code_buffer, sizeof(QrCodeBuffer_t)<=GZLIB_UNCOMPRESSED_CHUNK) | |
void | nbgl_drawRoundedRect (const nbgl_area_t *area, nbgl_radius_t radiusIndex, color_t innerColor) |
This functions draws a rounded corners rectangle (without border), with the given parameters. More... | |
void | nbgl_drawRoundedBorderedRect (const nbgl_area_t *area, nbgl_radius_t radiusIndex, uint8_t stroke, color_t innerColor, color_t borderColor) |
This functions draws a rounded corners rectangle with a border, with the given parameters. More... | |
void | nbgl_drawIcon (nbgl_area_t *area, nbgl_transformation_t transformation, nbgl_color_map_t color_map, const nbgl_icon_details_t *icon) |
Helper function to render an icon directly from its nbgl_icon_details_t structure. More... | |
nbgl_font_id_e | nbgl_drawText (const nbgl_area_t *area, const char *text, uint16_t textLen, nbgl_font_id_e fontId, color_t fontColor) |
This function draws the given single-line text, with the given parameters. More... | |
void | nbgl_drawQrCode (const nbgl_area_t *area, nbgl_qrcode_version_t version, const char *text, color_t foregroundColor) |
Draws the given text into a V10 QR code (QR code version is fixed using qrcodegen_VERSION_MIN/qrcodegen_VERSION_MAX in qrcodegen.h) More... | |
Implementation of middle-level API to draw rich forms like rounded rectangle.
Definition in file nbgl_draw.c.
#define QR_PIXEL_WIDTH_HEIGHT 4 |
Definition at line 34 of file nbgl_draw.c.
#define qrcode ((QrCodeBuffer_t *) ramBuffer)->qrcode |
Definition at line 46 of file nbgl_draw.c.
#define QrDrawBuffer ((QrCodeBuffer_t *) ramBuffer)->QrDrawBuffer |
Definition at line 48 of file nbgl_draw.c.
#define tempBuffer ((QrCodeBuffer_t *) ramBuffer)->tempBuffer |
Definition at line 47 of file nbgl_draw.c.
enum quarter_t |
Enumerator | |
---|---|
BAGL_FILL_CIRCLE_0_PI2 | |
BAGL_FILL_CIRCLE_PI2_PI | |
BAGL_FILL_CIRCLE_PI_3PI2 | |
BAGL_FILL_CIRCLE_3PI2_2PI |
Definition at line 27 of file nbgl_draw.c.
CCASSERT | ( | qr_code_buffer | , |
sizeof(QrCodeBuffer_t)<= | GZLIB_UNCOMPRESSED_CHUNK | ||
) |
void nbgl_drawIcon | ( | nbgl_area_t * | area, |
nbgl_transformation_t | transformation, | ||
nbgl_color_map_t | color_map, | ||
const nbgl_icon_details_t * | icon | ||
) |
Helper function to render an icon directly from its nbgl_icon_details_t
structure.
The icon is rendered whether it's an image file or not. No transformation is applied to the icon.
area | Area of drawing |
transformation | Transformation to apply to this icon (only available for raw image, not image file) |
color_map | Color map applied to icon |
icon | Icon details structure to draw |
Definition at line 489 of file nbgl_draw.c.
void nbgl_drawQrCode | ( | const nbgl_area_t * | area, |
nbgl_qrcode_version_t | version, | ||
const char * | text, | ||
color_t | foregroundColor | ||
) |
Draws the given text into a V10 QR code (QR code version is fixed using qrcodegen_VERSION_MIN/qrcodegen_VERSION_MAX in qrcodegen.h)
area | position, size and color of the QR code to draw |
version | version of QR Code |
text | text to encode |
foregroundColor | color to be applied to the 1's in QR code |
Definition at line 764 of file nbgl_draw.c.
void nbgl_drawRoundedBorderedRect | ( | const nbgl_area_t * | area, |
nbgl_radius_t | radiusIndex, | ||
uint8_t | stroke, | ||
color_t | innerColor, | ||
color_t | borderColor | ||
) |
This functions draws a rounded corners rectangle with a border, with the given parameters.
area | position, size and background color (outside of the rectangle) to use for the rectangle |
radiusIndex | radius size |
stroke | thickness of border (fixed to 2) |
innerColor | color to use for inside the rectangle |
borderColor | color to use for the border |
Definition at line 331 of file nbgl_draw.c.
void nbgl_drawRoundedRect | ( | const nbgl_area_t * | area, |
nbgl_radius_t | radiusIndex, | ||
color_t | innerColor | ||
) |
This functions draws a rounded corners rectangle (without border), with the given parameters.
area | position, size and background color (outside of the rectangle) to use for the rectangle |
radiusIndex | radius size |
innerColor | color to use for inside the rectangle |
Definition at line 237 of file nbgl_draw.c.
nbgl_font_id_e nbgl_drawText | ( | const nbgl_area_t * | area, |
const char * | text, | ||
uint16_t | textLen, | ||
nbgl_font_id_e | fontId, | ||
color_t | fontColor | ||
) |
This function draws the given single-line text, with the given parameters.
area | position, size and background color to use for text |
text | array of characters (UTF-8) |
textLen | number of chars to draw |
fontId | font to be used |
fontColor | color to use for font |
Definition at line 538 of file nbgl_draw.c.