aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLukaswnd <lukas.windeln@rwth-aachen.de>2024-01-18 12:33:38 +0100
committerGitHub <noreply@github.com>2024-01-18 12:33:38 +0100
commit75e9478e7f98c063e98c1ce97b1011eee3afa840 (patch)
tree6da7c222d62064263981978d7b5c8eea6dedfa75 /src
parent692078352e51166194b916115dce9ba8a80d41fd (diff)
Add width() and height() for NO_GFX
add int16_t width() and int16_t height(), when NO_GFX is enabled. you also could get the dimesions the following way height = matrix.getCfg().mx_height; width = matrix.getCfg().mx_width * matrix.getCfg().chain_length; but I think the new funktions are simpler
Diffstat (limited to 'src')
-rw-r--r--src/ESP32-HUB75-MatrixPanel-I2S-DMA.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h
index 6fcca10..c5df926 100644
--- a/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h
+++ b/src/ESP32-HUB75-MatrixPanel-I2S-DMA.h
@@ -571,6 +571,11 @@ public:
void drawPixel(int16_t x, int16_t y, CRGB color);
#endif
+#ifdef NO_GFX
+ inline int16_t width() const { return m_cfg.mx_width * m_cfg.chain_length; }
+ inline int16_t height() const { return m_cfg.mx_height; }
+#endif
+
void drawIcon(int *ico, int16_t x, int16_t y, int16_t cols, int16_t rows);
// Colour 444 is a 4 bit scale, so 0 to 15, colour 565 takes a 0-255 bit value, so scale up by 255/15 (i.e. 17)!