3#include <AH/STL/utility>
13template <
class VPot_t = Interfaces::MCU::IVPot &>
25 if (
vpot.getCenterLed())
29 uint8_t startOn =
vpot.getStartOn();
30 uint8_t startOff =
vpot.getStartOff();
31 for (uint8_t segment = startOn; segment < startOff; segment++)
54 uint16_t x_start =
x + round((
float)
innerRadius * sin(angle) / 2);
55 uint16_t y_start =
y - round((
float)
innerRadius * cos(angle) / 2);
57 uint16_t x_end =
x + round((
float)
innerRadius * sin(angle));
58 uint16_t y_end =
y - round((
float)
innerRadius * cos(angle));
A simple struct representing a pixel with integer coordinates.
#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.
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.