Merge pull request #11297 from SteveCEvans/baro_state
[betaflight.git] / src / main / io / frsky_osd.h
blob80dd427df95f77cd3b71f3132b530d7661001ec4
1 #pragma once
3 #include <stdbool.h>
4 #include <stdint.h>
6 #include "drivers/display.h"
7 #include "drivers/osd.h"
9 typedef enum {
10 FRSKY_OSD_TRANSACTION_OPT_PROFILED = 1 << 0,
11 FRSKY_OSD_TRANSACTION_OPT_RESET_DRAWING = 1 << 1,
12 } frskyOsdTransactionOptions_e;
14 typedef enum {
15 FRSKY_OSD_COLOR_BLACK = 0,
16 FRSKY_OSD_COLOR_TRANSPARENT = 1,
17 FRSKY_OSD_COLOR_WHITE = 2,
18 FRSKY_OSD_COLOR_GRAY = 3,
19 } frskyOsdColor_e;
21 typedef enum {
22 FRSKY_OSD_OUTLINE_TYPE_NONE = 0,
23 FRSKY_OSD_OUTLINE_TYPE_TOP = 1 << 0,
24 FRSKY_OSD_OUTLINE_TYPE_RIGHT = 1 << 1,
25 FRSKY_OSD_OUTLINE_TYPE_BOTTOM = 1 << 2,
26 FRSKY_OSD_OUTLINE_TYPE_LEFT = 1 << 3,
27 } frskyOsdLineOutlineType_e;
29 bool frskyOsdInit(videoSystem_e videoSystem);
30 bool frskyOsdIsReady(void);
31 void frskyOsdUpdate(void);
32 void frskyOsdBeginTransaction(frskyOsdTransactionOptions_e opts);
33 void frskyOsdCommitTransaction(void);
34 void frskyOsdFlushSendBuffer(void);
35 bool frskyOsdReadFontCharacter(unsigned char_address, osdCharacter_t *chr);
36 bool frskyOsdWriteFontCharacter(unsigned char_address, const osdCharacter_t *chr);
38 unsigned frskyOsdGetGridRows(void);
39 unsigned frskyOsdGetGridCols(void);
41 unsigned frskyOsdGetPixelWidth(void);
42 unsigned frskyOsdGetPixelHeight(void);
44 void frskyOsdDrawStringInGrid(unsigned x, unsigned y, const char *buff);
45 void frskyOsdDrawCharInGrid(unsigned x, unsigned y, uint16_t chr);
46 bool frskyOsdReadCharInGrid(unsigned x, unsigned y, uint16_t *c);
47 void frskyOsdClearScreen(void);
49 void frskyOsdSetStrokeColor(frskyOsdColor_e color);
50 void frskyOsdSetFillColor(frskyOsdColor_e color);
51 void frskyOsdSetStrokeAndFillColor(frskyOsdColor_e color);
52 void frskyOsdSetColorInversion(bool inverted);
53 void frskyOsdSetPixel(int x, int y, frskyOsdColor_e color);
54 void frskyOsdSetPixelToStrokeColor(int x, int y);
55 void frskyOsdSetPixelToFillColor(int x, int y);
56 void frskyOsdSetStrokeWidth(unsigned width);
57 void frskyOsdSetLineOutlineType(frskyOsdLineOutlineType_e outlineType);
58 void frskyOsdSetLineOutlineColor(frskyOsdColor_e outlineColor);
60 void frskyOsdClipToRect(int x, int y, int w, int h);
61 void frskyOsdClearRect(int x, int y, int w, int h);
62 void frskyOsdResetDrawingState(void);
63 void frskyOsdDrawCharacter(int x, int y, uint16_t chr, uint8_t opts);
64 void frskyOsdDrawCharacterMask(int x, int y, uint16_t chr, frskyOsdColor_e color, uint8_t opts);
65 void frskyOsdDrawString(int x, int y, const char *s, uint8_t opts);
66 void frskyOsdDrawStringMask(int x, int y, const char *s, frskyOsdColor_e color, uint8_t opts);
67 void frskyOsdMoveToPoint(int x, int y);
68 void frskyOsdStrokeLineToPoint(int x, int y);
69 void frskyOsdStrokeTriangle(int x1, int y1, int x2, int y2, int x3, int y3);
70 void frskyOsdFillTriangle(int x1, int y1, int x2, int y2, int x3, int y3);
71 void frskyOsdFillStrokeTriangle(int x1, int y1, int x2, int y2, int x3, int y3);
72 void frskyOsdStrokeRect(int x, int y, int w, int h);
73 void frskyOsdFillRect(int x, int y, int w, int h);
74 void frskyOsdFillStrokeRect(int x, int y, int w, int h);
75 void frskyOsdStrokeEllipseInRect(int x, int y, int w, int h);
76 void frskyOsdFillEllipseInRect(int x, int y, int w, int h);
77 void frskyOsdFillStrokeEllipseInRect(int x, int y, int w, int h);
79 void frskyOsdCtmReset(void);
80 void frskyOsdCtmSet(float m11, float m12, float m21, float m22, float m31, float m32);
81 void frskyOsdCtmTranslate(float tx, float ty);
82 void frskyOsdCtmScale(float sx, float sy);
83 void frskyOsdCtmRotate(float r);
85 void frskyOsdContextPush(void);
86 void frskyOsdContextPop(void);