Control Surface main
MIDI Control Surface library for Arduino
Loading...
Searching...
No Matches
BitmapDisplay.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <AH/STL/utility> // std::forward
7
9
16template <class Value_t = Interfaces::IValue &>
18 public:
20 const XBitmap &xbm, PixelLocation loc, uint16_t color)
21 : DisplayElement(display), value(std::forward<Value_t>(value)),
22 xbm(xbm), x(loc.x), y(loc.y), color(color) {}
23
24 void draw() override {
25 if (value.getValue())
27 value.clearDirty();
28 }
29
30 bool getDirty() const override { return value.getDirty(); }
31
32 private:
33 Value_t value;
34 const XBitmap &xbm;
35 int16_t x, y;
36 uint16_t color;
37};
38
39template <class Value_t = Interfaces::IValue>
40using NoteBitmapDisplay [[deprecated("Use BitmapDisplay instead")]] =
42
#define END_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
A class that displays a bitmap depending on the state of a MIDINote or any other object that has a ge...
bool getDirty() const override
Check if this DisplayElement has to be re-drawn.
BitmapDisplay(DisplayInterface &display, Value_t &&value, const XBitmap &xbm, PixelLocation loc, uint16_t color)
const XBitmap & xbm
void draw() override
Draw this DisplayElement to the display buffer.
An interface for elements that draw to a display.
DisplayInterface & display
An interface for displays.
virtual void drawXBitmap(int16_t x, int16_t y, const uint8_t bitmap[], int16_t w, int16_t h, uint16_t color)=0
Draw a bitmap to the display.
A simple struct representing a pixel with integer coordinates.
Definition Def.hpp:62
A struct containing X Bitmap width, height and data.
Definition XBitmaps.hpp:12
const uint8_t * bits
Definition XBitmaps.hpp:17
uint16_t height
Definition XBitmaps.hpp:16
uint16_t width
Definition XBitmaps.hpp:15