[FL-2524] Graphics cleanup and icon rotation (#2561)

* Canvas with rotation
* Full icon rotation, cleanup of unused resources
* F18 API update
* Bitmap draw cleanup
* More cleaning up
* Migrate recovery and DFU to canvas
* Make the internal draw function static
* Remove all calls to u8g2_DrawXBM

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Astra
2023-04-06 06:36:12 +03:00
committed by GitHub
parent a91d319839
commit b4ceb55fd2
20 changed files with 236 additions and 66 deletions

View File

@@ -64,6 +64,22 @@ typedef struct {
uint8_t descender;
} CanvasFontParameters;
/** Icon flip */
typedef enum {
IconFlipNone,
IconFlipHorizontal,
IconFlipVertical,
IconFlipBoth,
} IconFlip;
/** Icon rotation */
typedef enum {
IconRotation0,
IconRotation90,
IconRotation180,
IconRotation270,
} IconRotation;
/** Canvas anonymous structure */
typedef struct Canvas Canvas;
@@ -217,6 +233,22 @@ void canvas_draw_bitmap(
uint8_t height,
const uint8_t* compressed_bitmap_data);
/** Draw icon at position defined by x,y with rotation and flip.
*
* @param canvas Canvas instance
* @param x x coordinate
* @param y y coordinate
* @param icon Icon instance
* @param flip IconFlip
* @param rotation IconRotation
*/
void canvas_draw_icon_ex(
Canvas* canvas,
uint8_t x,
uint8_t y,
const Icon* icon,
IconRotation rotation);
/** Draw animation at position defined by x,y.
*
* @param canvas Canvas instance