Iridescence 1.00
Embedded Graphic Framework
Loading...
Searching...
No Matches
ds_gauge_base.h
1/* Copyright (C) 2017 - 2024, Thornwave Labs Inc - All Rights Reserved.
2 * Unauthorized copying of this file, via any medium is strictly prohibited.
3 * Proprietary and confidential.
4 * Written by Razvan Turiac <razvan.turiac@thornwave.com>
5*/
6
7#ifndef _DS_GAUGE_BASE_H
8#define _DS_GAUGE_BASE_H
9
10
11#include <ds_types.h>
12#include <ds_color.h>
13#include <ds_geometry.h>
14#include <ds_font.h>
15
16
17
22{
23public:
25
33
34
42
43
51
52
58 DsGaugeBase& setBorderThickness(uint8_t thickness);
59
60
68
69
77
78
85 DsGaugeBase& setValueFormat(const char* format);
86
87
94 DsGaugeBase& setValueOffset(int16_t offset);
95
96
104
105
113
114
121 DsGaugeBase& setTitle(const char* title);
122
123
130 DsGaugeBase& setTitleOffset(int16_t offset);
131
132
140
141
149
150
157 DsGaugeBase& setUnit(const char* unit);
158
159
166 DsGaugeBase& setUnitOffset(int16_t offset);
167
168
169protected:
170 DsColor mBorderColor;
171 DsColor mTrackColor;
172 DsColor mActiveColor;
173
174 DsColor mValueColor;
175 const ds_bitmap_font_t* mValueFont;
176 const char* mValueFormat;
177 DsRect mValueRegion;
178
179 DsColor mTitleColor;
180 const ds_bitmap_font_t* mTitleFont;
181 const char* mTitleText;
182 DsRect mTitleRegion;
183
184 DsColor mUnitColor;
185 const ds_bitmap_font_t* mUnitFont;
186 const char* mUnitText;
187 DsRect mUnitRegion;
188
189 int16_t mValueOffset;
190 int16_t mTitleOffset;
191 int16_t mUnitOffset;
192 uint8_t mBorderThickness;
193};
194
195
196#endif
DsColor is a class that represents a 4 channel color (Alpha, Red, Green, Blue).
Definition ds_color.h:53
DsGaugeBase is a base class for all gauge views.
Definition ds_gauge_base.h:22
DsGaugeBase & setUnitFont(const ds_bitmap_font_t *font)
Sets the font used to render the unit.
DsGaugeBase & setTitleColor(DsColor color)
Sets the title color.
DsGaugeBase & setValueColor(DsColor color)
Sets the value text color.
DsGaugeBase & setTitle(const char *title)
Sets the title.
DsGaugeBase & setUnitOffset(int16_t offset)
Sets the vertical unit offset in pixels.
DsGaugeBase & setValueFormat(const char *format)
Sets the printf() style format string used to print the value.
DsGaugeBase & setUnitColor(DsColor color)
Sets the unit color.
DsGaugeBase & setTrackColor(DsColor color)
Sets the track color.
DsGaugeBase & setValueOffset(int16_t offset)
Sets the vertical value offset in pixels.
DsGaugeBase & setBorderColor(DsColor color)
Sets the border color.
DsGaugeBase & setTitleOffset(int16_t offset)
Sets the vertical title offset in pixels.
DsGaugeBase & setTitleFont(const ds_bitmap_font_t *font)
Sets the font used to render the title.
DsGaugeBase & setActiveColor(DsColor color)
Sets the active color.
DsGaugeBase & setValueFont(const ds_bitmap_font_t *font)
Sets the font used to render the value.
DsGaugeBase & setUnit(const char *unit)
Sets the unit.
DsGaugeBase & setBorderThickness(uint8_t thickness)
Sets the border thickness.
DsRect is a class that represents a 2D rectangle (X, Y, W, H)
Definition ds_geometry.h:1507
Definition ds_font.h:45