Embedded SDK
Embedded SDK
Loading...
Searching...
No Matches
nbgl_draw.h
Go to the documentation of this file.
1
7#ifndef NBGL_DRAW_H
8#define NBGL_DRAW_H
9
10#ifdef __cplusplus
11extern "C" {
12#endif
13
14/*********************
15 * INCLUDES
16 *********************/
17#include "nbgl_types.h"
18#include "nbgl_fonts.h"
19
20/*********************
21 * DEFINES
22 *********************/
23#define QR_V4_NB_PIX_SIZE 33 // qr V4 number of pixels
24#define QR_V10_NB_PIX_SIZE 57 // qr V10 number of pixels
25#define QR_MAX_PIX_SIZE QR_V10_NB_PIX_SIZE // we support up to V10 qr code version
26
27/**********************
28 * TYPEDEFS
29 **********************/
30
31// Structure used to hold character information
32typedef struct {
33 uint32_t unicode;
34 const uint8_t *buffer;
35 const uint8_t *patterns;
36 uint16_t byte_cnt;
37 int16_t x_min;
38 int16_t y_min;
39 int16_t x_max;
40 int16_t y_max;
41 uint16_t width;
42 uint16_t height;
43 int16_t real_y_min;
44 uint16_t real_height;
45 uint8_t encoding;
49
51
52/**********************
53 * GLOBAL PROTOTYPES
54 **********************/
55
56void nbgl_drawIcon(nbgl_area_t *area,
57 nbgl_transformation_t transformation,
58 nbgl_color_map_t color_map,
59 const nbgl_icon_details_t *icon);
60void nbgl_drawRoundedRect(const nbgl_area_t *area, nbgl_radius_t radius, color_t innerColor);
62 nbgl_radius_t radius,
63 uint8_t stroke,
64 color_t innerColor,
65 color_t borderColor);
67 const char *text,
68 uint16_t textLen,
69 nbgl_font_id_e fontId,
70 color_t fontColor);
71void nbgl_drawQrCode(const nbgl_area_t *area,
73 const char *text,
74 color_t backgroundColor);
75
76/**********************
77 * MACROS
78 **********************/
79
80#ifdef __cplusplus
81} /* extern "C" */
82#endif
83
84#endif /* NBGL_DRAW_H */
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.
Definition nbgl_draw.c:538
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.
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.
Definition nbgl_draw.c:372
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/qrcodeg...
Definition nbgl_draw.c:663
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.
Definition nbgl_draw.c:273
nbgl_font_id_e
Definition nbgl_fonts.h:132
common types for Graphical Library
color_t
Definition nbgl_types.h:140
uint8_t nbgl_transformation_t
Represents the transformation to be applied on the bitmap before rendering This is a bitfield using m...
Definition nbgl_types.h:383
uint8_t nbgl_color_map_t
Represents the color_map to be used for 2BPP image, or the foreground color for 1BPP image.
Definition nbgl_types.h:390
nbgl_radius_t
possible radius indexes for objects
Definition nbgl_types.h:363
nbgl_qrcode_version_t
possible modes for QR Code
Definition nbgl_types.h:229
struct PACKED__ nbgl_icon_details_s nbgl_icon_details_t
Represents all information about an icon.
struct PACKED__ nbgl_area_s nbgl_area_t
Represents a rectangle area of the screen.
const uint8_t * buffer
Definition nbgl_draw.h:34
const uint8_t * patterns
Definition nbgl_draw.h:35
uint32_t unicode
Definition nbgl_draw.h:33
uint16_t real_height
Definition nbgl_draw.h:44
int16_t real_y_min
Definition nbgl_draw.h:43
uint8_t encoding
Definition nbgl_draw.h:45
uint16_t byte_cnt
Definition nbgl_draw.h:36
uint8_t nb_skipped_bytes
Definition nbgl_draw.h:46
uint16_t width
Definition nbgl_draw.h:41
uint16_t height
Definition nbgl_draw.h:42