GUI: internal Canvas API. More...
#include "canvas.h"
#include <u8g2.h>
#include <toolbox/compress.h>
#include <m-array.h>
#include <m-algo.h>
#include <furi.h>
Go to the source code of this file.
Data Structures | |
struct | CanvasCallbackPair |
struct | Canvas |
Canvas structure. More... | |
Macros | |
#define | ICON_DECOMPRESSOR_BUFFER_SIZE (128u * 64 / 8) |
#define | M_OPL_CanvasCallbackPairArray_t() |
Typedefs | |
typedef void(* | CanvasCommitCallback) (uint8_t *data, size_t size, CanvasOrientation orientation, void *context) |
Functions | |
ARRAY_DEF (CanvasCallbackPairArray, CanvasCallbackPair, M_POD_OPLIST) | |
ALGO_DEF (CanvasCallbackPairArray, CanvasCallbackPairArray_t) | |
Canvas * | canvas_init (void) |
Allocate memory and initialize canvas. | |
void | canvas_free (Canvas *canvas) |
Free canvas memory. | |
uint8_t * | canvas_get_buffer (Canvas *canvas) |
Get canvas buffer. | |
size_t | canvas_get_buffer_size (const Canvas *canvas) |
Get canvas buffer size. | |
void | canvas_frame_set (Canvas *canvas, int32_t offset_x, int32_t offset_y, size_t width, size_t height) |
Set drawing region relative to real screen buffer. | |
void | canvas_set_orientation (Canvas *canvas, CanvasOrientation orientation) |
Set canvas orientation. | |
CanvasOrientation | canvas_get_orientation (const Canvas *canvas) |
Get canvas orientation. | |
void | canvas_draw_u8g2_bitmap (u8g2_t *u8g2, int32_t x, int32_t y, size_t width, size_t height, const uint8_t *bitmap, IconRotation rotation) |
Draw a u8g2 bitmap. | |
void | canvas_add_framebuffer_callback (Canvas *canvas, CanvasCommitCallback callback, void *context) |
Add canvas commit callback. | |
void | canvas_remove_framebuffer_callback (Canvas *canvas, CanvasCommitCallback callback, void *context) |
Remove canvas commit callback. | |
GUI: internal Canvas API.
#define M_OPL_CanvasCallbackPairArray_t | ( | ) |
void canvas_add_framebuffer_callback | ( | Canvas * | canvas, |
CanvasCommitCallback | callback, | ||
void * | context ) |
Add canvas commit callback.
This callback will be called upon Canvas commit.
canvas | Canvas instance |
callback | CanvasCommitCallback |
context | CanvasCommitCallback context |
void canvas_draw_u8g2_bitmap | ( | u8g2_t * | u8g2, |
int32_t | x, | ||
int32_t | y, | ||
size_t | width, | ||
size_t | height, | ||
const uint8_t * | bitmap, | ||
IconRotation | rotation ) |
Draw a u8g2 bitmap.
u8g2 | u8g2 instance |
x | x coordinate |
y | y coordinate |
width | width |
height | height |
bitmap | bitmap |
rotation | rotation |
void canvas_frame_set | ( | Canvas * | canvas, |
int32_t | offset_x, | ||
int32_t | offset_y, | ||
size_t | width, | ||
size_t | height ) |
Set drawing region relative to real screen buffer.
canvas | Canvas instance |
offset_x | x coordinate offset |
offset_y | y coordinate offset |
width | width |
height | height |
void canvas_free | ( | Canvas * | canvas | ) |
Free canvas memory.
canvas | Canvas instance |
uint8_t * canvas_get_buffer | ( | Canvas * | canvas | ) |
Get canvas buffer.
canvas | Canvas instance |
size_t canvas_get_buffer_size | ( | const Canvas * | canvas | ) |
Get canvas buffer size.
canvas | Canvas instance |
CanvasOrientation canvas_get_orientation | ( | const Canvas * | canvas | ) |
Get canvas orientation.
canvas | Canvas instance |
Canvas * canvas_init | ( | void | ) |
Allocate memory and initialize canvas.
void canvas_remove_framebuffer_callback | ( | Canvas * | canvas, |
CanvasCommitCallback | callback, | ||
void * | context ) |
Remove canvas commit callback.
canvas | Canvas instance |
callback | CanvasCommitCallback |
context | CanvasCommitCallback context |
void canvas_set_orientation | ( | Canvas * | canvas, |
CanvasOrientation | orientation ) |
Set canvas orientation.
canvas | Canvas instance |
orientation | CanvasOrientation |