Control Surface
main
MIDI Control Surface library for Arduino
Toggle main menu visibility
Loading...
Searching...
No Matches
src
Display
BitmapDisplay.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <AH/STL/utility>
// std::forward
4
#include <
Display/Bitmaps/XBitmaps.hpp
>
5
#include <
Display/DisplayElement.hpp
>
6
#include <
MIDI_Inputs/InterfaceMIDIInputElements.hpp
>
7
8
BEGIN_CS_NAMESPACE
9
16
template
<
class
Value_t = Interfaces::IValue &>
17
class
BitmapDisplay
:
public
DisplayElement
{
18
public
:
19
BitmapDisplay
(
DisplayInterface
&
display
, Value_t &&
value
,
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())
26
display
.drawXBitmap(
x
,
y
,
xbm
.bits,
xbm
.width,
xbm
.height,
color
);
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
39
template
<
class
Value_t = Interfaces::IValue>
40
using
NoteBitmapDisplay
[[deprecated(
"Use BitmapDisplay instead"
)]] =
41
BitmapDisplay<Value_t>
;
42
43
END_CS_NAMESPACE
NoteBitmapDisplay
BitmapDisplay< Value_t > NoteBitmapDisplay
DisplayElement.hpp
InterfaceMIDIInputElements.hpp
END_CS_NAMESPACE
#define END_CS_NAMESPACE
Definition
Settings/NamespaceSettings.hpp:14
BEGIN_CS_NAMESPACE
#define BEGIN_CS_NAMESPACE
Definition
Settings/NamespaceSettings.hpp:11
XBitmaps.hpp
BitmapDisplay
A class that displays a bitmap depending on the state of a MIDINote or any other object that has a ge...
Definition
BitmapDisplay.hpp:17
BitmapDisplay::getDirty
bool getDirty() const override
Check if this DisplayElement has to be re-drawn.
Definition
BitmapDisplay.hpp:30
BitmapDisplay< Value_t >::color
uint16_t color
Definition
BitmapDisplay.hpp:36
BitmapDisplay::BitmapDisplay
BitmapDisplay(DisplayInterface &display, Value_t &&value, const XBitmap &xbm, PixelLocation loc, uint16_t color)
Definition
BitmapDisplay.hpp:19
BitmapDisplay< Value_t >::value
Value_t value
Definition
BitmapDisplay.hpp:33
BitmapDisplay< Value_t >::xbm
const XBitmap & xbm
Definition
BitmapDisplay.hpp:34
BitmapDisplay< Value_t >::x
int16_t x
Definition
BitmapDisplay.hpp:35
BitmapDisplay< Value_t >::y
int16_t y
Definition
BitmapDisplay.hpp:35
BitmapDisplay::draw
void draw() override
Draw this DisplayElement to the display buffer.
Definition
BitmapDisplay.hpp:24
DisplayElement::DisplayElement
DisplayElement(DisplayInterface &display)
Create a new DisplayElement.
Definition
DisplayElement.hpp:18
BitmapDisplay< Value_t >::display
DisplayInterface & display
Definition
DisplayElement.hpp:103
DisplayInterface
An interface for displays.
Definition
DisplayInterface.hpp:16
PixelLocation
A simple struct representing a pixel with integer coordinates.
Definition
Def.hpp:64
XBitmap
A struct containing X Bitmap width, height and data.
Definition
XBitmaps.hpp:18
Generated by
1.17.0