mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-24 19:53:08 +00:00
23f66c2cdd
* GUI: canvas streaming * Fix right status bar icon alignment
54 lines
886 B
C
54 lines
886 B
C
#pragma once
|
|
|
|
#include "canvas.h"
|
|
#include <u8g2.h>
|
|
|
|
struct Canvas {
|
|
u8g2_t fb;
|
|
uint8_t offset_x;
|
|
uint8_t offset_y;
|
|
uint8_t width;
|
|
uint8_t height;
|
|
};
|
|
|
|
/*
|
|
* Allocate memory and initialize canvas
|
|
*/
|
|
Canvas* canvas_init();
|
|
|
|
/*
|
|
* Free canvas memory
|
|
*/
|
|
void canvas_free(Canvas* canvas);
|
|
|
|
/*
|
|
* Reset canvas drawing tools configuration
|
|
*/
|
|
void canvas_reset(Canvas* canvas);
|
|
|
|
/*
|
|
* Commit canvas. Send buffer to display
|
|
*/
|
|
void canvas_commit(Canvas* canvas);
|
|
|
|
/*
|
|
* Get canvas buffer.
|
|
* @return pointer to buffer
|
|
*/
|
|
uint8_t* canvas_get_buffer(Canvas* canvas);
|
|
|
|
/*
|
|
* Get canvas buffer size.
|
|
* @return size of canvas in bytes
|
|
*/
|
|
size_t canvas_get_buffer_size(Canvas* canvas);
|
|
|
|
/*
|
|
* Set drawing region relative to real screen buffer
|
|
*/
|
|
void canvas_frame_set(
|
|
Canvas* canvas,
|
|
uint8_t offset_x,
|
|
uint8_t offset_y,
|
|
uint8_t width,
|
|
uint8_t height);
|