Embedded SDK
Embedded SDK
Macros | Functions
nbgl_draw.h File Reference

Middle Level API of the new BOLOS Graphical Library. More...

#include "nbgl_types.h"
#include "nbgl_fonts.h"
Include dependency graph for nbgl_draw.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define QR_V4_NB_PIX_SIZE   33
 
#define QR_V10_NB_PIX_SIZE   57
 
#define QR_MAX_PIX_SIZE   QR_V10_NB_PIX_SIZE
 

Functions

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...
 
void nbgl_drawRoundedRect (const nbgl_area_t *area, nbgl_radius_t radius, 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 radius, uint8_t stroke, color_t innerColor, color_t borderColor)
 This functions draws a rounded corners rectangle with a border, with the given parameters. 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 backgroundColor)
 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...
 

Detailed Description

Middle Level API of the new BOLOS Graphical Library.

Definition in file nbgl_draw.h.

Macro Definition Documentation

◆ QR_MAX_PIX_SIZE

#define QR_MAX_PIX_SIZE   QR_V10_NB_PIX_SIZE

Definition at line 25 of file nbgl_draw.h.

◆ QR_V10_NB_PIX_SIZE

#define QR_V10_NB_PIX_SIZE   57

Definition at line 24 of file nbgl_draw.h.

◆ QR_V4_NB_PIX_SIZE

#define QR_V4_NB_PIX_SIZE   33

Definition at line 23 of file nbgl_draw.h.

Function Documentation

◆ nbgl_drawIcon()

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.

Parameters
areaArea of drawing
transformationTransformation to apply to this icon (only available for raw image, not image file)
color_mapColor map applied to icon
iconIcon details structure to draw

Definition at line 489 of file nbgl_draw.c.

◆ nbgl_drawQrCode()

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)

Note
y0 and height must be multiple 4 pixels, and background color is applied to 0's in 1BPP bitmap.
Parameters
areaposition, size and color of the QR code to draw
versionversion of QR Code
texttext to encode
foregroundColorcolor to be applied to the 1's in QR code

Definition at line 764 of file nbgl_draw.c.

◆ nbgl_drawRoundedBorderedRect()

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.

Parameters
areaposition, size and background color (outside of the rectangle) to use for the rectangle
radiusIndexradius size
strokethickness of border (fixed to 2)
innerColorcolor to use for inside the rectangle
borderColorcolor to use for the border

Definition at line 331 of file nbgl_draw.c.

◆ nbgl_drawRoundedRect()

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.

Parameters
areaposition, size and background color (outside of the rectangle) to use for the rectangle
radiusIndexradius size
innerColorcolor to use for inside the rectangle

Definition at line 237 of file nbgl_draw.c.

◆ nbgl_drawText()

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.

Parameters
areaposition, size and background color to use for text
textarray of characters (UTF-8)
textLennumber of chars to draw
fontIdfont to be used
fontColorcolor to use for font

Definition at line 538 of file nbgl_draw.c.