4#include <AH/STL/utility>
17template <
class VPot_t = Interfaces::MCU::IVPot &>
29 if (
vpot.getCenterLed())
33 uint8_t startOn =
vpot.getStartOn();
34 uint8_t startOff =
vpot.getStartOff();
35 for (uint8_t segment = startOn; segment < startOff; segment++)
58 uint16_t x_start =
x + std::round((
float)
innerRadius * sin(angle) / 2);
59 uint16_t y_start =
y - std::round((
float)
innerRadius * cos(angle) / 2);
61 uint16_t x_end =
x + std::round((
float)
innerRadius * sin(angle));
62 uint16_t y_end =
y - std::round((
float)
innerRadius * cos(angle));
#define BEGIN_CS_NAMESPACE
An interface for elements that draw to a display.
DisplayInterface & display
An interface for displays.
virtual void fillCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color)
Draw a disk (filled circle).
virtual void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color)=0
Draw a line between two points.
virtual void drawCircle(int16_t x0, int16_t y0, int16_t r, uint16_t color)
Draw a circle.
Displays the position of a MCU V-Pot.
bool getDirty() const override
Check if this DisplayElement has to be re-drawn.
VPotDisplay(DisplayInterface &display, VPot_t &&vpot, PixelLocation loc, uint16_t radius, uint16_t innerRadius, uint16_t color)
void setAngleSpacing(float spacing)
float getAngleSpacing() const
void drawVPotSegment(uint8_t segment)
void draw() override
Draw this DisplayElement to the display buffer.
A simple struct representing a pixel with integer coordinates.